重复文件-AppleScript
我正在尝试编写一个苹果脚本,将两个文件从一个文件夹复制到另一个文件夹。我尝试了不同的方法,但总是出错 方法1:重复文件-AppleScript,applescript,finder,Applescript,Finder,我正在尝试编写一个苹果脚本,将两个文件从一个文件夹复制到另一个文件夹。我尝试了不同的方法,但总是出错 方法1: tell application "Finder" set home_path to home as text set framework to alias (home_path & "Library:Developer:Xcode:DerivedData:ReaderKit-cusaxqpwrepxbfcmixaiszkolkkv:Build:Produc
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"
我的脚本有什么问题?这是因为“ReaderKit.framework”不是文件,请使用文件夹、项目或别名
duplicate folder framework to folder destination with replacing