1

我对 Apple Script 相当陌生,我希望能在完成这项简单但多余的任务时获得一些帮助。

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

贾巴 Foo Biggie

我想将文件放入此文件夹,并让它自动按文件名对 4 个选项中的 1 个进行排序。如果文件名包含 jabba,则转到 Jabba 文件夹,如果 foo 然后 Foo 文件夹,... 如果没有,不要做任何事情,让它保持不变。

谢谢

我有 OSX 10.7.5

4

1 回答 1

1

尝试:

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
于 2013-02-27T04:38:31.127 回答