执行脚本

时间:2017-08-04 01:19:31

标签: applescript

使用Apple脚本编辑器运行脚本以自动执行Cisco AnyConnect登录时,我收到以下错误。

错误:“系统事件出错:不允许任何连接辅助访问。( - 25211)”

我提供的选项是编辑或确定。确定结束脚本,编辑允许我从脚本编辑器运行脚本,该脚本成功。

我已将此脚本保存为.app文件,以便从Launchpad

运行它

脚本:

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 

1 个答案:

答案 0 :(得分:0)

您保存为.app的脚本文件需要添加到允许控制您的计算机的应用程序列表中。还要将Cisco AnyConnect应用程序和ScriptEditor.app添加到允许的应用程序列表中。

enter image description here