2012-07-28 124 views
1

我嘗試從應用內運行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:一旦解決了問題,我希望有一些幫助將焦點轉移到「請求文本」對話框,以便我可以觸發該操作並開始鍵入我的答案。

回答

0

不知道它是什麼,但它現在工作。

我唯一能想到的是我關閉了Automator。

0

我最近收到與Automator服務相同的錯誤消息。這個問題是由於Automator自動在applescript代碼中的'end run'之後附加了「...」。我在Applescript Editor中打開了代碼完成功能,所以當編輯器有可能完成建議時會顯示3個點,並且它在Automator中也是如此。

出於某種原因,它在「運行Applescript」automator操作窗口中的'結束運行'後附加了這些點,之後我關閉了Automator。所以這是我的腳本的最後一行:「結束運行...」因此,我在'運行'後附加了一個空格,這將刪除尾隨句點,並且現在服務運行良好。

我不確定這是你遇到的問題,但它可能值得檢查。(令人沮喪的問題,我知道。)