【发布时间】:2020-11-18 06:06:48
【问题描述】:
我正在尝试使用以下代码将文件从一个文件夹复制到另一个文件夹。
在运行{输入,参数}
set collectPaths to {}
repeat with i from 1 to (input count)
set collectPaths to item i of input as string
end repeat
tell application "System Events"
set fileList to (every folder of folder collectPaths whose name is "Old")
if (count of fileList) is equal to 0 then
tell application "Finder"
set x to make new folder at input with properties {name:"Old"}
end tell
else
set x to fileList
end if
end tell
tell application "System Events"
set fileList to (every file of folder collectPaths whose name extension is "ai")
repeat with i from 1 to count of fileList
set theItem to item i of fileList
tell application "Finder"
duplicate the file theItem to the folder x
end tell
end repeat
end tell
结束运行
但我得到一个错误 “操作“运行 AppleScript”遇到错误:“Finder 出错:无法为文件夹“无标题文件夹 2”的文件夹“桌面”的文件夹“旧”创建别名将启动盘文件夹“Users”文件夹“asuvathdhamank”的“输入字符串。”
请帮我解决这个问题并复制旧文件夹中的文件
【问题讨论】:
标签: applescript