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行以上が必要ですが、エディターオートマターの間のapplescriptについて、過去1時間に見た奇妙な一貫性のない動作はこれらだけではありません。アイコンは別のものです。

この例では、Automatorで試してみるとエラーが発生します。

構文エラー

録音、ここでの質問は次のとおりです。

  1. なんで?なぜアップル、なぜ?
  2. 少なくともタイトルを機能させる方法はありますか?
4

1 に答える 1

10

この問題の原因は、Automator が Applescript Studio の用語をインポートすることdisplay dialogですPanel Suitewith titleそのバージョンにはパラメーターがありません。AutomatorApplescriptエディターを使用して開くことで確認できます。(File→Open Dictionary を使用...) これが 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 に答える