Created
November 20, 2013 08:32
-
-
Save masawada/7559737 to your computer and use it in GitHub Desktop.
Toggle Application (Hide/Front)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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