change safari homepage using a script

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

  1. macrumors 6502

    #1
    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

    Joined:
    Aug 28, 2008
    Location:
    California
    #2
    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

    #3
    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

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #4
    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
     
  5. macrumors 6502a

    Joined:
    Sep 17, 2007
    #5
    ~/Library/Preferences/com.apple.Safari.plist

    Key = HomePage
     
  6. thread starter macrumors 6502

    #6
    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

    Joined:
    Sep 17, 2007
    #7
    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

    #8
    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?
     
  9. macrumors 6502a

    Joined:
    Sep 17, 2007
    #9
    Here you go...
     

    Attached Files:

  10. thread starter macrumors 6502

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

    Joined:
    Sep 17, 2007
    #11
    '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