Skip to content

Instantly share code, notes, and snippets.

@masawada
Created November 20, 2013 08:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masawada/7559737 to your computer and use it in GitHub Desktop.
Save masawada/7559737 to your computer and use it in GitHub Desktop.
Toggle Application (Hide/Front)
set appName to "AppName"
set is_start to false
tell application "System Events"
if not (exists process appName) then
set is_start to true
else
if visible of process appName then
set visible of process appName to false
else
set frontmost of process appName to true
end if
end if
end tell
if is_start then
tell application appName to activate
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment