使用applescript在finder中移动文件

Jam*_*Vth 3 applescript finder

我只想将图像从一个文件夹移动到另一个文件夹,替换已经存在的图像:

tell application "Finder"
      copy file "/Users/xx/Documents/img.jpg" to folder "/Users/xx/Documents/State"
   end tell
Run Code Online (Sandbox Code Playgroud)

当我运行它时,我收到一条错误消息

Finder出错:无法将文件夹[path]设置为文件[path]"."文件夹[path]中的数字-10006

请帮我!

ada*_*one 7

尝试:

tell application "Finder"
    duplicate POSIX file "/Users/xx/Documents/img.jpg" to POSIX file "/Users/xx/Documents/State" with replacing
end tell
Run Code Online (Sandbox Code Playgroud)

要么

tell application "Finder"
    move POSIX file "/Users/xx/Documents/img.jpg" to POSIX file "/Users/xx/Documents/State" with replacing
end tell
Run Code Online (Sandbox Code Playgroud)