Skip to content

Instantly share code, notes, and snippets.

@hernamesbarbara
Last active August 29, 2015 14:08
Show Gist options
  • Save hernamesbarbara/8ffd765aa5797f9b0e33 to your computer and use it in GitHub Desktop.
Save hernamesbarbara/8ffd765aa5797f9b0e33 to your computer and use it in GitHub Desktop.
#!/usr/bin/osascript
(* subroutine to bring an application to front.
you could invoke it from an alias in your
~/.bash_profile, another script or an alfred workflow
*)
property default_app : ""
on bring_to_front(app_name)
set res to false
if app_name is not "" then
try
tell application app_name
activate # open the app even if not running yet
reopen # ensure minimized windows pop open
end tell
set res to true
end try
end if
return res
end bring_to_front
bring_to_front("Skype")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment