2011-09-14 92 views

回答

1

你非常接近,但這裏是正確的腳本。

tell application "Finder" to duplicate "somefile.txt" of (container of (path to me)) to applications folder 

tell application "Finder" 
    set prevTIDs to Applescript's text item delimiters 
    set Applescript's text item delimiters to ":" 
    duplicate "somefile.txt" of (text items 1 thru -2 of (path to me as string)) as alias to applications folder 
    set Applescript's text item delimiters to prevTIDs 
end tell 
+0

謝謝 - 當我運行該腳本就回來了:無法獲得(的(路徑容器我))的 「somefile.txt」。不允許訪問。 – Jayer

+0

@Jayer它應該工作。我更新了該帖子,向您展示了另一種方式。 – fireshadow52

相關問題