为什么AppleScript显示对话框在Editor和Automator之间的表现如此不同?

cre*_*gox 0 applescript automator

例如,为什么这个脚本适用于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上评论标题之后的所有内容,这是我得到的差异:

替代文字

标题和超过3行,如果有可能,但这些都不是唯一的怪异行为不一致,我在大约之间的AppleScript过去一小时似乎编辑器自动机.图标是另一个图标.

在实例中,我在Automator中尝试的错误是这样的:

语法错误

录音,这里的问题是:

  1. 为什么?为什么哦Apple,为什么?
  2. 任何方式至少使标题工作?

Yuj*_*uji 10

问题的原因是Automator导入了Applescript Studio术语,它重新定义了重新定义的display dialog部分Panel Suite; 该版本没有with title参数.您可以Automator使用Applescript编辑器打开来检查.(使用文件→打开字典...)我同意这是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
Run Code Online (Sandbox Code Playgroud)

来自Automator; 这告诉Applescript的编译器使display dialog命令调用标准定义.