执行脚本时,Applescript错误-25211

执行脚本时,Applescript错误-25211,applescript,Applescript,使用Apple脚本编辑器运行脚本以自动登录Cisco AnyConnect时,我收到以下错误 错误:“系统事件”出错:不允许任何连接进行辅助访问。(-25211) 我看到的选项是“编辑”或“确定”。OK结束脚本,Edit允许我从脚本编辑器运行脚本,这是成功的 我已将此脚本保存为.app文件,以便从Launchpad运行它 脚本: tell application "Cisco AnyConnect" activate end tell repeat until application "

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

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

我看到的选项是“编辑”或“确定”。OK结束脚本,Edit允许我从脚本编辑器运行脚本,这是成功的

我已将此脚本保存为.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 

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


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


太棒了,它修好了。Thanks@ArtMazza如果你能在我的帖子上打+1分并接受我的回答,我将不胜感激。。只是说:-)太棒了,这就解决了。Thanks@ArtMazza如果你能在我的帖子上打+1分并接受我的回答,我将不胜感激。。只是说:——)