2013-02-27 275 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 
相關問題