使用 Applescript 将文件从服务器共享复制到本地文件夹

发布于 2024-09-02 06:38:12 字数 361 浏览 2 评论 0原文

我在服务器上有一个与启用来宾访问共享的文件夹。我希望能够使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

給妳壹絲溫柔 2024-09-09 06:38:12

您需要删除声明的属性周围的引号:

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

用“:”终止文件夹路径也是一个好习惯。

华泰

you need to remove the quotes around your declared properties:

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

It is also good practice to terminate your folder paths with a ":".

HTH

夜灵血窟げ 2024-09-09 06:38:12

您当前的脚本为:“将变量复制到变量目标。”我假设你不想只是改变周围的变量;你使用了错误的命令。请参阅我的对此问题的回答以了解更多信息。

Your current script reads: "Copy the variable source to the variable destination." 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文