2017-08-04 28 views
1

使用Apple腳本編輯器運行腳本以自動執行Cisco AnyConnect登錄時,我收到以下錯誤消息。執行腳本時發生Applescript錯誤-25211

錯誤:「系統事件得到了一個錯誤:的AnyConnect不允許輔助接入(-25211)」

我呈現的選項編輯或確定。確定結束腳本,編輯允許我從成功的腳本編輯器運行腳本。

我已保存這個腳本爲.app文件從啓動板運行

腳本:

tell application "Cisco AnyConnect" 
    activate 
end tell 
repeat until application "Cisco AnyConnect" is running 
    delay 1 
end repeat 
tell application "System Events" 
    repeat until (window 1 of process "Cisco AnyConnect Secure Mobility Client" exists) 
     delay 1 
    end repeat 
    tell process "Cisco AnyConnect Secure Mobility Client" 
     keystroke ("**access URL**" as string) 
     keystroke return 
    end tell 
    repeat until (window 2 of process "Cisco AnyConnect Secure Mobility Client" exists) 
     delay 1 
    end repeat 
    tell process "Cisco AnyConnect Secure Mobility Client" 
     keystroke ("**the password is entered here**" as string) 
     keystroke return 
    end tell 
end tell 

回答

0

您保存爲的.app需要添加到列表中的腳本文件允許控制您的計算機的應用程序。同時將Cisco AnyConnect應用程序和ScriptEditor.app添加到允許的應用程序列表中。

enter image description here

+1

真棒,修復它。謝謝 –

+0

@ArtMazza我會很感激你用+1和接受的答案來標記我的帖子。只是說:-) – wch1zpink

相關問題