Automate an Internet content filter

Aug 03, '10 07:30:00AM

Contributed by: Anonymous

As an adult with ADD, I'm a huge fan of Steve Lambert's SelfControl. This nifty app, for those who don't know, is a great boon to the Internet addict and to easily distractible folks such as myself. It is a timed Internet filter that can block sites based on a whitelist or blacklist. Once you turn it on, it's virtually impossible to deactivate until its timer runs out. So, if I wanted to work on a project for 3 hours without checking Twitter or Facebook, I would simply add facebook.com and twitter.com to SelfControl's list of blocked sites, set its timer for 3 hours, and get some real work done.

I find it helpful to be able to automate this app, so that I don't change my mind and decide to blow off work at the beginning of the day. To this end I have an AppleScript scheduled to activate SelfControl every weekday morning while I'm still sleeping, which lasts until mid-day, so I can get stuff done when I wake up, rather than just roll out of bed onto Facebook.

Prerequisites:

The Hint: You can now run selfcontrol.scpt easily from Quicksilver, put it in the Dock, or schedule it in iCal. 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.

The script can also be run with arguments from the command line to achieve different timings. I like to have SelfControl automatically run from 7-10am every weekday morning, so my crontab has the following line in it:
0 7 * * 1,2,3,4,5 osascript /Applications/kerfi/Applescript/selfcontrol.scpt 180

[crarko adds: I haven't tested this one, although I can think of a number of applications for it.]

Comments (38)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20100801214648362