Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Automate an Internet content filter' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automate an Internet content filter
Authored by: redmacuser on Sep 03, '10 01:33:34PM

I couldn't get the script to work. I followed the directions exactly but got the text below in the replies section of AppleScript Editor (I replaced the password for my MacBook with PASSWORD below):



tell application "AppleScript Editor"
get item 1
end tell
tell application "Usable Keychain Scripting"
get password of generic item 1 of current keychain whose name contains "SelfControl"
--> "PASSWORD"
do shell script "echo 'PASSWORD' | perl -pe 's/[^[:print:]]//g'"
--> error number -1708
«event ascrgdut»
--> error number -1708
do shell script "echo 'PASSWORD' | perl -pe 's/[^[:print:]]//g'"
--> error number -10004
end tell
tell current application
do shell script "echo 'PASSWORD' | perl -pe 's/[^[:print:]]//g'"
--> "PASSWORD"
end tell
tell application "SelfControl"
activate
end tell
tell application "System Events"
set value of slider of window "SelfControl" of process "SelfControl" to 1
click button "Start" of window "SelfControl" of process "SelfControl"
--> button "Start" of window "SelfControl" of application process "SelfControl"
set value of text field 2 of scroll area 1 of group 1 of window 1 of process "SecurityAgent" to "PASSWORD"



Then the lines below just repeated endlessly.

set value of text field 2 of scroll area 1 of group 1 of window 1 of process "SecurityAgent" to "PASSWORD"
--> error number -1719 from window 1 of process "SecurityAgent"


Anyone know hot to fix the problem above?



[ Reply to This | # ]
Automate an Internet content filter
Authored by: karljam on Oct 04, '10 10:34:15PM
The latest version of SelfControl, released after this hint, allows only multiples of 15 minutes - so my original post will generate this error. I've submitted a fix, but for now, you can replace this line...
set defaultTime to 1
with this:
set defaultTime to 15
...or just choose a length of time over 15 (minutes). It may have to be a multiple of 15 as well. If you are just testing it out, make sure you don't need to surf in the next 15 minutes!

[ Reply to This | # ]