我已经检查了Stackoverflow中类似问题的先前答案,即使使用移动功能的最基本的句子也似乎存在问题。就我而言,我正在使用以下脚本。
set theFile to "Macintosh HD/Users/sergioguerra1/Downloads/Reporte General.csv"
set theFolder to "Macintosh HD/Users/sergioguerra1/Desktop/Detektor/Etapa II/"
tell application "Finder"
move file theFile to folder theFolder with replacing
end tell
我得到了以下错误:
“错误” Finder出现错误:无法获取文件“ Macintosh HD / Users / sergioguerra1 / Downloads / Reporte General.csv”。”文件“ Macintosh HD / Users / sergioguerra1 / Downloads / Reporte General”的编号-1728。 csv“”
我稍微修改了剧本
tell application "Finder"
move theFile to theFolder with replacing
end tell
我有一个不同的错误
“错误” Finder出现错误:AppleEvent处理程序失败。“数字-10000”
这是一个非常简单的代码,但是不起作用。谁能找到错误?小牛有事吗?
在AppleScript中,您使用了不同的路径符号,并且将这两种符号混合在一起。文件和别名类使用HFS路径。该路径以卷名开头,并以“:”分隔。posix文件类使用Posix路径文件符号。它始终以文件系统的根文件夹(其他系统已装入此文件系统)开头,并使用“ /”作为分隔符。由于命令以开头,因此move file
您已经表明文件路径符号必须是HFS路径:
set theFile to "Macintosh HD:Users:sergioguerra1:Downloads:Reporte General.csv"
set theFolder to "Macintosh HD:Users:sergioguerra1:Desktop:Detektor:Etapa II"
tell application "Finder"
move file theFile to folder theFolder with replacing
end tell
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句