例如,为什么此脚本适用于 AppleScript编辑器但不适用于 Automator ?
display dialog "a lot of text just to break to line 4 whatever continuing... few more... argh... there!" with title "just a test" buttons {"Cancel", "Uninstall", "Continue"} default button 3 with icon caution
在Automator上评论 title 之后的所有内容,这就是我得到的差异:
如果可能的话,我想 标题以及 3行,但这些并不是我看来的唯一奇怪的不一致行为关于编辑器和 automator 之间的AppleScript的过去一小时。图标是另一个。
在实例中,我在Automator中尝试的错误是:
录制,问题如下:
答案 0 :(得分:9)
问题的原因是Automator会导入terminologies of Applescript Studio,重新定义display dialog
作为Panel Suite
的一部分;该版本没有with title
参数。您可以使用Applescript编辑器打开Automator
来检查。 (使用文件→打开字典...)我同意这是Apple的一个愚蠢的决定:(
您可以使用
解决此问题using terms from application "Finder"
display dialog "a lot of text just to break to line 4 whatever continuing... few more... argh... there!" with title "just a test" buttons {"Cancel", "Uninstall", "Continue"} default button 3 with icon caution
end using terms from
来自Automator;这告诉Applescript的编译器使display dialog
命令调用标准定义。