【问题标题】:convert simple automator application to applescript将简单的 automator 应用程序转换为 applescript
【发布时间】:2014-10-15 05:28:15
【问题描述】:
我对 automator 和 applescript 都很陌生。我创建了一个应用程序,它使用 automator 打印拖放到程序图标上的文件。这很简单。在automator中,我只是运行
Print Finder Items
并且该程序有效。现在我需要做更复杂的事情,我需要弄清楚如何将那个命令转换为 applescript。我已经尝试过多篇堆栈溢出文章中给出的建议,包括:Automator to Applescript for Editing Code,但这对我没有帮助。如何将其转换为 applescript?
【问题讨论】:
标签:
applescript
automator
【解决方案1】:
tell application "Finder"
set theItems to selection
print theItems
end tell
您需要学习如何自己查找命令,以便探索它们的作用。打开 AppleScript 编辑器。在“文件”菜单下选择“打开字典”并选择 Finder。这本词典告诉你所有你可以用applescripting Finder 做的事情。每个应用程序都有自己的字典,因此您需要开始查看这些字典。
该脚本适用于您在 Finder 中选择的任何文件。祝你好运。