あるフォルダーから別のフォルダーに 2 つのファイルを複製する Apple スクリプトを作成しようとしています。さまざまな方法を試しましたが、エラーが発生し続けます。
方法 1:
tell application "Finder"
set home_path to home as text
set framework to alias (home_path & "Library:Developer:Xcode:DerivedData:ReaderKit-cusaxqpwrepxbfcmixaiszkolkkv:Build:Products:Debug-iphoneos:ReaderKit.framework")
set bundle to alias (home_path & "Library:Developer:Xcode:DerivedData:ReaderKit-cusaxqpwrepxbfcmixaiszkolkkv:Build:Products:Debug-iphoneos:ReaderKit.framework")
set destination to home_path & "Documents:WillowTree:BIA-Kelsey:BIA-Kelsey:ThirdParty"
duplicate file framework to folder destination with replacing
duplicate file bundle to folder destination with replacing
end tell
方法 2
tell application "Finder"
set framework to "Macintosh HD:Users:nayef:Library:Developer:Xcode:DerivedData:ReaderKit-cusaxqpwrepxbfcmixaiszkolkkv:Build:Products:Debug-iphoneos:ReaderKit.framework"
set bundle to "Macintosh HD:Users:nayef:Library:Developer:Xcode:DerivedData:ReaderKit-cusaxqpwrepxbfcmixaiszkolkkv:Build:Products:Debug-iphoneos:ReaderKit.bundle"
set destination to "Macintosh HD:Users:User:nayef:Documents:WillowTree:BIA-Kelsey:BIA-Kelsey:ThirdParty"
duplicate file framework to folder destination with replacing
duplicate file bundle to folder destination with replacing
end tell
エラー
error "Finder got an error: Can’t set folder \"Macintosh HD:Users:User:nayef:Documents:WillowTree:BIA-Kelsey:BIA-Kelsey:ThirdParty\" to file \"Macintosh HD:Users:nayef:Library:Developer:Xcode:DerivedData:ReaderKit-cusaxqpwrepxbfcmixaiszkolkkv:Build:Products:Debug-iphoneos:ReaderKit.framework\"." number -10006 from folder "Macintosh HD:Users:User:nayef:Documents:WillowTree:BIA-Kelsey:BIA-Kelsey:ThirdParty"
スクリプトの何が問題になっていますか?