gpt4 book ai didi

applescript - 使用applescript在finder中移动文件

转载 作者:行者123 更新时间:2023-12-01 08:34:20 24 4
gpt4 key购买 nike

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

tell application "Finder"
copy file "/Users/xx/Documents/img.jpg" to folder "/Users/xx/Documents/State"
end tell

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

Finder got an error: Can’t set folder [path] to file [path]"."number -10006 from folder [path]



请帮我!

最佳答案

尝试:

tell application "Finder"
duplicate POSIX file "/Users/xx/Documents/img.jpg" to POSIX file "/Users/xx/Documents/State" with replacing
end tell

或者
tell application "Finder"
move POSIX file "/Users/xx/Documents/img.jpg" to POSIX file "/Users/xx/Documents/State" with replacing
end tell

关于applescript - 使用applescript在finder中移动文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14058061/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com