change safari homepage using a script

Discussion in 'Mac Programming' started by morrisman1, Jul 22, 2009.

  1. macrumors 6502

    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)
  2. macrumors regular

    Aug 28, 2008
    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. :eek:
  3. thread starter macrumors 6502

    yea, the idea is so that it will change automatically on startup. Where does safari keep the .plist with the homepage url?
  4. macrumors 68040


    Jan 10, 2005
    Dallas, TX
    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.

  5. macrumors 6502a

    Sep 17, 2007

    Key = HomePage
  6. thread starter macrumors 6502

    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
  7. macrumors 6502a

    Sep 17, 2007
    Odd. That's where where mine is. I was changing it to different things to verify right before I posted that before.
  8. thread starter macrumors 6502

    screenshot of your .plist an option? might help a bit.

    I opened out of /macintosh hd/users/my account/library/preferences

    thats the right directory isnt it?
  9. macrumors 6502a

    Sep 17, 2007
    Here you go...

    Attached Files:

  10. thread starter macrumors 6502

    what program do you open the .plist with? im just using txt edit
  11. macrumors 6502a

    Sep 17, 2007
    '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.

Share This Page