Applescript Launching Program Help

Discussion in 'Mac Programming' started by Campbell.Martin, Oct 9, 2010.

  1. Campbell.Martin macrumors newbie

    Oct 9, 2010
    so im trying to write a script that will open a new window in safari, seems simple enough but if the app is closed then it opens 2 windows at the launch.
    is there a way to get round this?

    by the way this is what i have now which causes the double window problem, im pretty new to applescripts so any help will be great

    set inactive to false
    tell application "Safari"
    if inactive then activate
    if not inactive then make new document
    end tell
  2. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Ask Safari for all its open documents.
    Only open a window if the list is empty.
  3. Campbell.Martin thread starter macrumors newbie

    Oct 9, 2010
    how would i do that exactly?
    sorry, but im new to applescripts.

Share This Page