Skip to content

Instantly share code, notes, and snippets.

@yukirii
Last active January 17, 2017 14:55
Show Gist options
  • Save yukirii/8dee45581fa86b8a36cbea33e1893fcc to your computer and use it in GitHub Desktop.
Save yukirii/8dee45581fa86b8a36cbea33e1893fcc to your computer and use it in GitHub Desktop.
on isRunning(appName)
tell application "Finder" to activate
tell application "System Events" to tell process "Finder" to (name of windows) contains appName
end isRunning
on closeDialog(appName)
tell application "System Events"
tell process "Finder"
click button "OK" of window appName
end tell
end tell
end closeDialog
set appName to "Cisco AnyConnect Secure Mobility Client"
try
if isRunning(appName) then
closeDialog(appName)
delay 0.5
closeDialog(appName)
end if
end try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment