Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Restart frontmost application with AppleScript (revised version of my script from c. 2011)
tell application "System Events" to set _app to the name of the first process whose frontmost is true
tell application _app
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