Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Applescript Apple脚本:将文件移动到适当的文件夹_Applescript_Filenames_Move - Fatal编程技术网

Applescript Apple脚本:将文件移动到适当的文件夹

Applescript Apple脚本:将文件移动到适当的文件夹,applescript,filenames,move,Applescript,Filenames,Move,我对苹果的脚本相当陌生,我希望能得到一些帮助来完成这个简单但多余的任务 假设我有一个包含这些文件夹的文件夹 贾巴 福 大人物 我想把文件放到这个文件夹中,让它自动按文件名对4个选项中的1个进行排序。 如果文件名包含jabba,则转到jabba文件夹,如果是foo,则转到foo文件夹。。。如果没有,不要做任何事,让它去吧 谢谢 我有OSX 10.7.5试试: on adding folder items to theFolder after receiving theFiles repea

我对苹果的脚本相当陌生,我希望能得到一些帮助来完成这个简单但多余的任务

假设我有一个包含这些文件夹的文件夹

贾巴 福 大人物

我想把文件放到这个文件夹中,让它自动按文件名对4个选项中的1个进行排序。 如果文件名包含jabba,则转到jabba文件夹,如果是foo,则转到foo文件夹。。。如果没有,不要做任何事,让它去吧

谢谢

我有OSX 10.7.5

试试:

on adding folder items to theFolder after receiving theFiles
    repeat with aFile in theFiles
        tell application "Finder"
            if aFile's name contains "Jabba" then
                move aFile to (first folder of theFolder whose name = "Jabba")
            else if aFile's name contains "Foo" then
                move aFile to (first folder of theFolder whose name = "Foo")
            else if aFile's name contains "Biggie" then
                move aFile to (first folder of theFolder whose name = "Biggie")
            end if
        end tell
    end repeat
end adding folder items to
尝试: