2016-09-26 99 views
0

我只是試圖將我的路徑內容從一個目錄移動到另一個目錄,但我不斷收到錯誤,我不確定自己做錯了什麼。任何幫助將不勝感激。移動內容:無法獲取路徑的全部內容

tell application "Finder" 
    set srcPath to POSIX path of ((parent of (path to me) as text) & "M Templates") 
    set dstPath to POSIX path of (((path to movies folder) as text) & "M Templates") 


    duplicate entire contents of srcPath to dstPath 
end tell 

回答

1

假設~/Movies/M Templates已經存在,並且要附加文件拷貝到其中,而不僅僅是完全替代它:

set src to path to me 
set dst to path to movies folder 

tell application "Finder" 
    duplicate items of folder "M Templates" of parent of src ¬ 
     to folder "M Templates" of dst with replacing 
end tell 

(使用如果你想查找自動覆蓋所有現有項目duplicate...with replacing。)

或者過度複製M Templates文件夾,替換以前的任何一個:

set src to path to me 
set dst to path to movies folder 

tell application "Finder" 
    duplicate folder "M Templates" of parent of src to dst with replacing 
end tell