Skip to content

Instantly share code, notes, and snippets.

@lzilioli
Last active August 29, 2015 14:01
Show Gist options
  • Save lzilioli/ee9193d44ed0fe30f5af to your computer and use it in GitHub Desktop.
Save lzilioli/ee9193d44ed0fe30f5af to your computer and use it in GitHub Desktop.
AppleScripts for stay.app
# hide applications on monitor disconnect
set appNames to ["Spotify", "Mail", "Finder", "Calendar", "HipChat", "Stickies", "Tweetbot", "iTunes", "2Do", "Slack"]
tell application "Finder"
repeat with appName in appNames
if (name of processes) contains appName then
set visible of process appName to false
end if
end repeat
end tell
# show applications on monitor connect
set appNames to ["Spotify", "Mail", "Finder", "Calendar", "HipChat", "Stickies", "Tweetbot", "iTunes", "2Do", "Slack"]
tell application "Finder"
repeat with appName in appNames
if (name of processes) contains appName then
set visible of process appName to true
end if
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment