Skip to content

Instantly share code, notes, and snippets.

@jondkinney
Last active December 12, 2015 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jondkinney/4771797 to your computer and use it in GitHub Desktop.
Save jondkinney/4771797 to your computer and use it in GitHub Desktop.
You can add each of these scripts to Pomodoro.app's start/end AppleScript actions and disable / enable notification center as well as quit / launch some apps.
tell application "System Events"
tell process "Notification Center"
key down option
click menu bar item 1 of menu bar 1
key up option
end tell
end tell
--quit some apps that I tend to check too often when I should be focusing on coding.
try
set quitApps to {¬
"Tweetbot", ¬
"Sparrow"}
set num_of_apps to count quitApps
repeat with i from 1 to num_of_apps
set varapp to (item i of quitApps)
tell application varapp to quit
end repeat
on error
tell the current application to display dialog "An error has occurred!" & return & "This script will now quit" buttons {"Quit"} default button 1 with icon 0
end try
tell application "System Events"
tell process "Notification Center"
key down option
click menu bar item 1 of menu bar 1
key up option
end tell
end tell
--re-enable the previously quit apps when you come up for air
set launchApps to {¬
"Sparrow", ¬
"Tweetbot"}
set num_of_apps to count launchApps
repeat with i from 1 to num_of_apps
set varapp to (item i of launchApps)
tell application varapp to activate
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment