2013-02-27 121 views
1

我对苹果脚本相当新颖,我希望得到一些帮助,做这个简单但冗余的任务。苹果脚本:将文件移动到适当的文件夹

比方说,我有了这些文件夹

贾巴 富 大不了

一个文件夹,我想在这个文件夹拖放文件,并有自动排序1 4的选项由刚刚文件名称。 如果文件名包含jabba转到Jabba文件夹,如果foo然后Foo文件夹,...如果没有,请不要做任何事情。

感谢

我有OSX 10.7.5

回答

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 
相关问题