【发布时间】:2013-12-04 02:35:40
【问题描述】:
我对使用 Automator 和 Applescript 非常陌生。
我想使用 Automator 和 AppleScript 来检测下载到“下载”文件夹的 PDF 文件,并打开一个显示对话框,让我可以选择文件路径和移动文件。到目前为止,我所拥有的(这是不对的)是这样的:
set question to display dialog "Save fileName in..." buttons {"Figuring Relation", "Iconoclasm", "Elsewhere"} default button 3
set answer to button returned of question
if answer is equal to "Figuring Relation" then
tell application "Finder" to move fileName to POSIX file "/Users/mac/Documents/College/Junior/Fall/Art 347 - Figuring Relation"
我希望“计算关系”和“Iconoclasm”按钮将文件路径更改为指定的文件路径(我不想浏览它),并希望“其他地方”按钮打开一个 Finder 窗口,我可以选择/浏览路径。
如果可能,我还希望将日期添加到文件名的开头作为“mm-dd_filename”。
我不确定如何将 Automator 输入转换为 Applescript,或者如何在显示对话框文本中包含文件名。非常感谢您的帮助。
【问题讨论】:
-
AppleScript-Editor 中包含的 code-sn-ps 总是有帮助的:CTRL-单击脚本以查看它们。查看“迭代项目”,您会在其中找到一些有用的代码。
标签: pdf applescript filepath automator