Set Safari's home page via WiLMa and AppleScript

Feb 14, '07 07:30:03AM

Contributed by: pslambe

I am using WiLMa to switch locations on my PowerBook. I used to use Location X for this purpose, but it no longer works for me. Specifically, I can use WiLMa to change the Network settings like IP address and proxy when I go from home to work. Location X also allowed me to change the web home page setting in Safari, but WiLMa doesn't.

So I spent some time searching MacScripter, and came up with this Applescript.

I have placed two similar versions of the script in the /Library/Scripts folder (compiled as applications), and WiLMa will run them when I switch locations. One set's Google as the home page, and the other sets my ISP's home page as my home page.

Now I am very inexperienced at this sort of thing. The script works, except when I trigger a switch unintentionally and the web home page is already set and Safari is not running. When this happens, the script finishes without starting Safari. Just a slight hiccup. I would love someone else to pull it apart, improve it, and maybe convert it to a shell script.

Comments (2)


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