Extra Window Opens in Browser

Discussion in 'Mac Programming' started by thriftinkid, Feb 5, 2009.

  1. macrumors regular

    Joined:
    Mar 24, 2008
    #1
    Here is probably a dumb question. The script I have below works. It just opens my URL in a new window of Safari instead of loading it into the default window when Safari Opens. How do I resolve this?
    Code:
    set theURL to "http://www.mywebsite.com"
    tell application "safari"
    open location theURL
    end tell
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Try this:
    Code:
    set theURL to "http://www.mywebsite.com"
    tell application "Safari"
        set URL of document 0 to theURL
    end tell
     

Share This Page