1

アプリ内からAutomatorアクションを実行しようとすると、エラーが発生します。サービスとして設定しました。オートマター内から実行すると機能しますが、サービスを呼び出すと、次のようなダイアログエラーが表示されます。

The action "Run AppleScript encountered an error"

ログを確認したところ、完全なエラーは次のとおりです。

12-07-28 1:03:01.319 PM com.apple.automator.xpc.workflowServiceRunner: Could not connect the action buttonPressed: to target of class NSApplication
12-07-28 1:03:01.319 PM com.apple.automator.xpc.workflowServiceRunner: 2012-07-28 13:03:01.317 WorkflowServiceRunner[77170:1707] Could not connect the action buttonPressed: to target of class NSApplication
12-07-28 1:03:01.319 PM com.apple.automator.xpc.workflowServiceRunner: Could not connect the action buttonPressed: to target of class NSApplication
12-07-28 1:03:01.320 PM com.apple.automator.xpc.workflowServiceRunner: 2012-07-28 13:03:01.318 WorkflowServiceRunner[77170:1707] Could not connect the action buttonPressed: to target of class NSApplication
12-07-28 1:03:01.320 PM com.apple.automator.xpc.workflowServiceRunner: Could not connect the action buttonPressed: to target of class NSApplication
12-07-28 1:03:01.320 PM com.apple.automator.xpc.workflowServiceRunner: 2012-07-28 13:03:01.319 WorkflowServiceRunner[77170:1707] Could not connect the action buttonPressed: to target of class NSApplication
12-07-28 1:03:01.321 PM com.apple.automator.xpc.workflowServiceRunner: Could not connect the action buttonPressed: to target of class NSApplication
12-07-28 1:03:01.321 PM com.apple.automator.xpc.workflowServiceRunner: 2012-07-28 13:03:01.320 WorkflowServiceRunner[77170:1707] Could not connect the action buttonPressed: to target of class NSApplication
12-07-28 1:03:01.358 PM com.apple.automator.xpc.workflowServiceRunner: -[AMApplicationRegistry loadDefinitionAtURL:]: No application name for definition at URL file://localhost/Library/Automator/Office.definition/
12-07-28 1:03:01.358 PM com.apple.automator.xpc.workflowServiceRunner: 2012-07-28 13:03:01.356 WorkflowServiceRunner[77170:1707] -[AMApplicationRegistry loadDefinitionAtURL:]: No application name for definition at URL file://localhost/Library/Automator/Office.definition/
12-07-28 1:03:01.358 PM com.apple.automator.xpc.workflowServiceRunner: -[AMApplicationRegistry _loadDefinitionsAtURLS:]: Failed to load definition at URL file://localhost/Library/Automator/Office.definition/
12-07-28 1:03:01.358 PM com.apple.automator.xpc.workflowServiceRunner: 2012-07-28 13:03:01.357 WorkflowServiceRunner[77170:1707] -[AMApplicationRegistry _loadDefinitionsAtURLS:]: Failed to load definition at URL file://localhost/Library/Automator/Office.definition/
12-07-28 1:03:06.787 PM com.apple.automator.xpc.workflowServiceRunner: WorkflowServiceRunner received error running Workflow Service at /Users/juan/Library/Services/Lookup Citation.workflow: The action “Run AppleScript” encountered an error.
12-07-28 1:03:06.787 PM com.apple.automator.xpc.workflowServiceRunner: 2012-07-28 13:03:06.786 WorkflowServiceRunner[77170:1707] WorkflowServiceRunner received error running Workflow Service at /Users/juan/Library/Services/Lookup Citation.workflow: The action “Run AppleScript” encountered an error.

あなたはここで私のワークフローを見ることができます:

これは2つの部分で構成されています:1)「テキストを要求」アクション2)1からテキストを取得し、それを使用して処理を実行し、ユーザーに「リストから選択」するように求める「AppleScriptの実行」アクション

繰り返しますが、これはAutomatorで実行するとすべて機能しますが、アプリ内からサービスとして呼び出すと失敗します。

PS:それが解決したら、アクションをトリガーして回答の入力を開始できるように、フォーカスを[テキストを要求]ダイアログに移動してもらいたいと思います。

4

2 に答える 2

0

何が原因かはわかりませんが、現在は機能しています。

私が考えることができる唯一のことは、Automator を閉じたことです。

于 2012-07-28T21:14:28.233 に答える
0

最近、Automator サービスで同じエラー メッセージを受け取りました。この問題は、AppleScript コードの「実行終了」の後に Automator が「...」を自動追加することが原因でした。私は Applescript Editor でコード補完をオンにしているので、エディターが提案する補完候補がある場合に 3 つのドットが表示され、Automator 内でもこれが行われます。

何らかの理由で、Automator を閉じた後、「Run Applescript」automator アクション ウィンドウで、「end run」の後にこれらのドットを追加していました。つまり、これがスクリプトの最後の行でした:「実行を終了...」だから、「実行」の後にスペースを追加しました。これにより、末尾のピリオドが削除され、サービスが正常に実行されるようになりました。

これがあなたが経験している問題かどうかはわかりませんが、おそらく確認する価値はあるでしょう (イライラする問題であることはわかっています)。

于 2013-04-01T22:57:04.473 に答える