如何使用 AppleScript 下载文件?
例如:
set the file_tgt to (path to downloads as string) as file specification
set file_src to "http://my_file.png"
tell application "URL Access Scripting"
download file_src to file_tgt
end tell
- 如何获取用户默认下载文件夹的路径?
- AppleScript 不喜欢路径转换。我该如何解决这个问题?
Something like:
set the file_tgt to (path to downloads as string) as file specification
set file_src to "http://my_file.png"
tell application "URL Access Scripting"
download file_src to file_tgt
end tell
- How do I get the path to the default downloads folder for the user?
- AppleScript doesn't like the path conversion. How can I fix that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我自己找到了解决方案:
设置 file_tgt to(下载文件夹的路径作为字符串)& “文件.png”
I found the solution myself:
set the file_tgt to (path to downloads folder as string) & "file.png"
使用 applescript 和 shell 脚本下载目录中托管的文件集合 -
这会将这 36 个文件下载
到您的桌面上。
希望这有帮助。
To download a collection of files hosted in a directory using applescript and shell script -
This will download these 36 files
at your desktop.
Hope this helps.