0

例如,为什么这个脚本适用于AppleScript Editor而不是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 行,但这些并不是我在过去一个小时中出现的关于editorautomator之间的 applescript 的唯一奇怪的不一致行为。图标是另一个。

在该实例中,我在 Automator 中尝试它时遇到的错误是:

语法错误

录音,这里的问题是:

  1. 为什么?为什么哦苹果,为什么?
  2. 有什么方法至少可以使标题起作用吗?
4

1 回答 1

10

问题的原因是 Automator 导入了Applescript Studio 的术语,将重新定义重新定义display dialogPanel 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

从 Automator 内部;这告诉 Applescript 的编译器使display dialog命令调用标准定义。

于 2011-01-10T12:14:48.467 回答