Homekoti |
Mac /
ApplicationHider(* ApplicationHider
Keep an application running. Hide it, when not in use.
Paste into AppleScript Editor. Save as an application with 'Stay open' ticked.
Add the script app to your login items in System Preferences.
Tuomas Rosberg 2011
*)
property appName : ""
property firstRun : false
on run
if firstRun is false then -- this script app hasn't been used before
set anApp to choose application -- launches the application user chooses. Returns item "application"
set appName to name of anApp
set firstRun to true
else -- firstRun is true in subsequent runs, continue to idling
end if
end run
on idle
tell application "System Events"
if exists of application process appName then
if frontmost of application process appName is false then
set visible of application process appName to false
end if
else -- the app process does not exist
tell application "Finder" to launch application appName
end if
end tell
return 3 -- seconds to idle
end idle
|