Last active
December 12, 2015 12:28
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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