2017-01-21 17 views
1

私はAirMac Extremeを再起動するAutomatorからAppleScriptを実行しようとしています。 Automatorスクリプトはカレンダーアラームタイプです。 Automatorから直接スクリプトを実行すると、うまく動作します。カレンダーは、Automatorのをトリガすると、私は次を得る:AutomatorでApple AirPort Extremeを再起動

「アクション」を実行するAppleScriptは、「エラーが発生しました」

私は確信してなど、Automatorを、スクリプト自体ことを作った...すべては、アクセスを持っていますセキュリティとプライバシー - >アクセシビリティ。私はapplescriptからdelayを取り除こうとしました。私は迷っている。私はこの問題の解決に役立つアイディアを感謝します。ありがとう!

これは私がAutomatorのに使用しようとしているのAppleScriptです:

activate application "AirPort Utility" 
delay 4 
tell application "System Events" 
    click image 2 of group 1 of scroll area 1 of window 1 of application process "AirPort Utility" 
    delay 3 
    click menu item 3 of menu "Base Station" of menu bar 1 of application process "AirPort Utility" 
    delay 1 
    keystroke tab 
    keystroke tab 
    keystroke space 
end tell 
delay 300 
tell application "AirPort Utility" to quit 
+0

あなたはアクセシビリティ設定にもアクセスを許可するには、カレンダーアプリ、空港ユーティリティを追加しましたか? AppleScriptのすべてのキーストロークの間に遅延を追加することもできますか? – wch1zpink

+0

ありがとうございます。私は空港ユーティリティを追加しました。カレンダーアプリを追加します。また、私はキーストロークの間にいくつかの遅延を追加しようとします。私は戻って報告します。 –

答えて

0

私はあなたのスクリプトにtry文を追加し、すべての問題なくスクリプトエディタから直接実行しました。


activate application "AirPort Utility" 
delay 4 
tell application "System Events" 
    try 
     click image 2 of group 1 of scroll area 1 of window 1 of application process "AirPort Utility" 
     delay 3 
     click menu item 3 of menu "Base Station" of menu bar 1 of application process "AirPort Utility" 
     delay 1 
     keystroke tab 
     keystroke tab 
     keystroke space 
    end try 
end tell 
delay 300 
tell application "AirPort Utility" to quit 

あなたは、新しいアプリへのアクセスへのアクセスを許可し、アプリケーションとしてスクリプトエディタでスクリプトを保存も試すことができ、そしてちょうどカレンダーイベントのAutomatorの実行という新しいアプリを持っています。


さらに、Automatorを完全にバイパスしないのはなぜですか?スクリプトエディタで、そのコードをアプリとしてエクスポートし、システム設定でアクセシビリティアクセスを許可します。その後、カレンダーアプリから直接カレンダーイベントでそのファイルを実行できます。

enter image description here

関連する問題