我最近開始擺弄AppleScript,但我似乎無法讓我的腳本工作。但是,我沒有得到任何錯誤。腳本執行並且'沒有'發生。需要我的自定義AppleScript的一些觀點
tell application "Finder"
set theWin to window 1
set thePath to (POSIX path of (target of theWin as alias))
copy file "Macintosh HD:Users:thijmendam:Documents:NieuwBestandSource:Naamloos.pages" to thePath
end tell
我想要做的是將文件Naamloos.pages移動到當前打開的Finder窗口。如果我想將它複製到一個文件夾,這工作正常。但是,如果我使用路徑,'沒有'發生。 在例如,下面的腳本不工作:
'tell application "Finder"
set theWin to window 1
set thePath to (POSIX path of (target of theWin as alias))
copy file "Macintosh HD:Users:thijmendam:Documents:NieuwBestandSource:Naamloos.pages" to folder "this:is:a:destination:folder"
end tell
顯然,這不是我想要達到的目標。我只是不知道如何將文件複製到路徑。誰能幫我嗎?
乾杯!
謝謝你很多相對路徑!這工作。再次讓我頭痛:-) –
不客氣Posix的路徑是好的,如果你想運行shell命令 – mcgrailm
此外,是否有可能重命名文件到某個名稱,我必須在彈出的文本框或類似的東西那? –