使用 Automator / Applescript 将图像下载到特定目录
我尝试使用 Automator 中的变量将图像保存到特定文件夹中。
奇怪的是,当您创建新文件夹并使用变量时,它允许您设置基本路径...但是如果您尝试“下载 URL”,它不允许您选择基本路径来添加变量,并且它破坏交易。
我确信 applescript 可以做得更好,但我似乎无法弄清楚。
例子。
有一个名为“猫和狗”的照片库。
我能够抓取猫和狗的标题并将其设为我的变量...它在我的桌面上创建一个名为猫和狗的新文件夹(来自变量)...然后我能够抓取图库中的所有图像作为“从网页获取图像 URL”的结果...
这效果很好...然后我尝试“下载 URL”,我想将它们下载到我创建的新“猫和狗”文件夹中。但我似乎无法做到这一点,因为我无法在自动程序中的“下载 URL”框中设置路径...
当我需要将 100 个画廊复制到桌面时,这最终非常有用。 当然,
我可以在保存后手动移动新创建的文件夹中的文件...但是我必须为每个图库执行此操作...
有什么建议吗?
Im trying to use a variable in Automator to save images into a specific folder.
Strangely when you create a new folder and you use a variable, it allows you to set the base path... but if you try to "Download URL" it does not allow you to select the base path to add the variable onto and it breaks the transaction.
Im sure applescript could do a better job, but I can't seem to figure it out.
Example.
There is a photo gallery called Cats and Dogs.
I am able to grab the Cats and Dogs title and make it my variable... it makes a new folder on my desktop called Cats and Dogs (from the Variable)... I am then able to grab all the images in the gallery as a result from "Get Image URL's from webpage"...
This works great... then I try to "Download the URLs" and I want to download them to the new "Cats and Dogs" folder I have created. But I can't seem to make that work, because I can't set the path in the Download the URLs box in automator...
This ends up being really useful when I have 100 galleries I need to rip to my desktop...
Of course I could move the files in the newly created folder by hand once saved... but then I would have to do this for each gallery...
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 applescript 中,您可以使用命令行程序curl 来下载某些内容。使用 -o 选项,您可以指定保存下载的位置。所以你需要一个像这样的苹果脚本......
From applescript you can use the command line program curl to download something. With the -o option you can specify where to save the download. So you would need an applescript like this...