PDA

View Full Version : change safari homepage using a script




morrisman1
Jul 22, 2009, 04:28 PM
hi all,

basically i want to prank my mate, i want to write a script which changes his homepage to a particular page, and then set this script to run on startup.

is there a way to do this? He uses safari on 10.5.7

thanks very much, this is for jokes, not malicious reasons (I will put him back to normal after a week)



miiles
Jul 22, 2009, 04:31 PM
hi all,

basically i want to prank my mate, i want to write a script which changes his homepage to a particular page, and then set this script to run on startup.

is there a way to do this? He uses safari on 10.5.7

thanks very much, this is for jokes, not malicious reasons (I will put him back to normal after a week)

Any reason why you couldn't just change his home page in the preferences?

EDIT: Actually, I have a feeling he would figure that out after a week. :o

morrisman1
Jul 22, 2009, 04:39 PM
yea, the idea is so that it will change automatically on startup. Where does safari keep the .plist with the homepage url?

lee1210
Jul 22, 2009, 04:51 PM
Honestly, it would be a better prank to change it to one of four sites every second or third time he started his browser. Consistent behavior is not nearly as maddening as seemingly random behavior.

-Lee

mslide
Jul 22, 2009, 05:42 PM
Where does safari keep the .plist with the homepage url?

~/Library/Preferences/com.apple.Safari.plist

Key = HomePage

morrisman1
Jul 23, 2009, 06:53 AM
~/Library/Preferences/com.apple.Safari.plist

Key = HomePage

nothing in there seems to relate to the homepage. I set it to ebay, then searched for ebay in that .plist and it wasnt there

mslide
Jul 23, 2009, 08:11 AM
nothing in there seems to relate to the homepage. I set it to ebay, then searched for ebay in that .plist and it wasnt there

Odd. That's where where mine is. I was changing it to different things to verify right before I posted that before.

morrisman1
Jul 23, 2009, 08:17 AM
screenshot of your .plist an option? might help a bit.

I opened com.apple.safari.plist out of /macintosh hd/users/my account/library/preferences

thats the right directory isnt it?

mslide
Jul 23, 2009, 08:36 AM
screenshot of your .plist an option? might help a bit.

Here you go...

morrisman1
Jul 24, 2009, 06:05 AM
what program do you open the .plist with? im just using txt edit

mslide
Jul 24, 2009, 08:11 AM
what program do you open the .plist with? im just using txt edit

'Property List Editor'. It's the default editor for me. If not, it's in /Developer/Applications/Utilities/. Note, I'm not sure if you need to have XCode installed of if that utility comes standard with macs.