我嘗試從應用內運行Automator操作時遇到錯誤。我將其設置爲服務。它的工作原理,當我從自動機中運行,但是當我撥打服務它給了我一個對話框錯誤,上面寫着:Apple Automator發出「無法連接操作」錯誤的AppleScript操作
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.
你可以看到我的工作流here:
它由兩個部分組成: 1)「請求文本」行動 2)「運行AppleScript」用語,使文字從1,做事情它,然後提示用戶t o「從列表中選擇」
同樣,這一切在我在Automator中運行時都有效,但是當我將它作爲服務從應用程序中調用時會失敗。 PS:一旦解決了問題,我希望有一些幫助將焦點轉移到「請求文本」對話框,以便我可以觸發該操作並開始鍵入我的答案。