2012-11-05 50 views
0

試圖製作一個AppleScript液滴,將文件拖動到液滴時將文件移動到給定文件夾;不知道如何告訴腳本我剛剛拖動的文件是我想要移動的文件;我試過,但它不工作:AppleScript液滴移動文件

on open dragged_file 
    tell application "Finder" 
    move dragged_file to "Macintosh HD:Users...etc." 
    end tell 
end open --script runs but doesn't move file 

回答

1

嘗試:

on open of theFiles 
    tell application "Finder" 
     move theFiles to folder "Macintosh HD:Users...etc." 
    end tell 
end open 
+0

甜!!!! (我怎麼知道語法是「打開文件」而不是「打開文件」?) – user1720207

+1

「的」沒有什麼區別。你的問題是你沒有在HFS路徑前面加入「文件夾」。 – adayzdone

+0

我很高興它爲你工作。請接受答案,以便其他用戶知道問題不再公開。 – adayzdone

0

要使用液滴,你就來介紹與CURRENTITEM循環重複在draggeditem 現在你的腳本 ,然後結束重複 您爲例

on open dragged_file 
repeat with currentitem in dragged_file 
    tell application "Finder" 
    move dragged_file to folder "Macintosh HD:Users...etc." 
    end tell 
end repeat 
end open --script runs but doesn't move file 
相關問題