Created
June 11, 2015 08:40
-
-
Save dpk/a92d3ea83aa7142e3317 to your computer and use it in GitHub Desktop.
Restart frontmost application with AppleScript (revised version of my script from c. 2011)
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
tell application "System Events" to set _app to the name of the first process whose frontmost is true | |
tell application _app | |
quit | |
set _isRunning to true | |
repeat while (_isRunning) | |
delay 1 | |
tell application "System Events" | |
set _isRunning to ((name of processes) contains _app) | |
end tell | |
end repeat | |
end tell | |
tell application _app to activate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment