
The script can also be run with arguments from the command line to achieve different timings. All of these methods will activate SelfControl (with its current blacklist or whitelist setting) for 45 minutes, or for whatever you set the default time to be.

You can now run selfcontrol.scpt easily from Quicksilver, put it in the Dock, or schedule it in iCal. Now save the script and name it something like selfcontrol.scpt. In your script, at the line that says defaultTime to 1, change 1 to 45 (or whatever number of minutes you'd like the default time to be.) I use 45, so that I can run this script hourly: work 45 minutes, play for 15.Click 'Always Allow.' Note: This will activate SelfControl for 1 minute, so don't navigate away from this page during that time! Run the script once you will be prompted to allow Usable Keychain Scripting to access your keychain.
#App self control for mac password
On run argv set defaultTime to 1 try set myTime to item 1 of argv as number on error set myTime to defaultTime end try tell application "Usable Keychain Scripting" tell current keychain set myPass to (password of first generic item ¬ whose name contains "SelfControl") - eliminate invisible characters, or "gremlins," from password set x to quoted form of myPass set myPass to do shell script "echo " & x & " | perl -pe 's/]//g'" end tell end tell tell application "SelfControl" to activate tell application "System Events" tell process "SelfControl" tell slider of window "SelfControl" to set value to myTime click button "Start" of window "SelfControl" end tell tell window 1 of process "SecurityAgent" with timeout of 15 seconds repeat set tryAgain to false try set value of text field 2 of scroll area 1 of group 1 to myPass on error delay 1 set tryAgain to true end try if not tryAgain then exit repeat end repeat click button 2 of group 2 end timeout end tell end tellend run Open AppleScript Editor and paste in the following code:.Click 'Add', and you should now have a new application password entitled 'SelfControl' in your Keychain. Under Keychain Item Name, type 'SelfControl.' Make up any Account Name in the next field, and in the Password field, type the password for your user account (the password you would use to authenticate anything in OS X).Create a new password by typing Cmd-N or going to File » New Password Item. As of this writing, OS X's current Keychain Scripting is rather slow.
#App self control for mac install
