使用 Applescript 将文件从服务器共享复制到本地文件夹
我在服务器上有一个与启用来宾访问共享的文件夹。我希望能够使用 Applescript 将文件从该文件夹复制到本地计算机。到目前为止我已经:
property source : "server:sharedfolder:file.ext"
property destination : "Macintosh HD:Users:User:Documents:Folder"
tell application "Finder"
copy file "source" to folder "destination"
end tell
我认为应该有效。但我收到错误:无法将文件夹源设置为目标编号 10006。有什么想法吗?
谢谢。
I have a folder on a server which is shared with guest access enabled. I want to be able to copy a file from that folder to a local machine with Applescript. So far I have:
property source : "server:sharedfolder:file.ext"
property destination : "Macintosh HD:Users:User:Documents:Folder"
tell application "Finder"
copy file "source" to folder "destination"
end tell
Which I think should work. But I get the error: Can't set folder source to destination number 10006. Any ideas?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要删除声明的属性周围的引号:
用“:”终止文件夹路径也是一个好习惯。
华泰
you need to remove the quotes around your declared properties:
It is also good practice to terminate your folder paths with a ":".
HTH
您当前的脚本为:“将变量
源
复制到变量目标
。”我假设你不想只是改变周围的变量;你使用了错误的命令。请参阅我的对此问题的回答以了解更多信息。Your current script reads: "Copy the variable
source
to the variabledestination
." I'm assuming you don't want to just change the variables around; you're using the wrong command. See my answer to this question to learn more.