Created
April 27, 2016 14:58
-
-
Save infinitewarp/2d3d7f77c990b4eb6274a3daa9c9921e to your computer and use it in GitHub Desktop.
script runs after waking up in the morning
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 Preferences" | |
activate | |
set the current pane to pane id "com.apple.preference.security" | |
tell application "System Events" to tell process "System Preferences" | |
repeat until radio button "General" of tab group 1 of window 1 exists | |
end repeat | |
click radio button "General" of tab group 1 of window 1 | |
set timeout_menu to pop up button 1 of (tab group 1 of window "Security & Privacy") | |
click timeout_menu | |
click menu item "5 minutes" of menu of timeout_menu | |
end tell | |
set the current pane to pane id "com.apple.preference.energysaver" | |
tell application "System Events" to tell process "System Preferences" | |
repeat until radio button "Power Adapter" of tab group 1 of window 1 exists | |
end repeat | |
click radio button "Power Adapter" of tab group 1 of window 1 | |
(* note: 1.0 is "1 min" and 241.0 is "15 min" *) | |
(* note: for some reason you have to decrement this one; you can't just set it? *) | |
(* set value of slider 1 of tab group 1 of window 1 to 1.0 *) | |
set s to slider 1 of tab group 1 of window 1 | |
repeat while value of s is less than 241 | |
increment s | |
end repeat | |
end tell | |
set the current pane to pane id "com.apple.preference.universalaccess" | |
tell application "System Events" to tell process "System Preferences" | |
repeat until slider "Cursor size:" of window "Accessibility" exists | |
(* waits until the panel is visible *) | |
(* note: the sidebar in Accessibility is a table that doesn't seem to accept input. *) | |
(* so, this may wait forever if not selected or until you manually click it. *) | |
end repeat | |
set s to slider "Cursor size:" of window "Accessibility" | |
set value of s to 1.0 | |
end tell | |
quit | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment