Join the Stack Overflow Community
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

my code looks like this

tell application "Firefox"
 open location "http://rubyquicktips.tumblr.com/"
end tell

but if I have Firefox open, the link will open in a new tab. But I want the link to open in a new Firefox window. How can I accomplish that?

share|improve this question
up vote 2 down vote accepted

try this...

tell application "Firefox"
    OpenURL "http://rubyquicktips.tumblr.com/"
end tell

or try this...

tell application "Firefox" to activate
tell application "System Events" to keystroke "n" using command down
tell application "Firefox"
    OpenURL "http://rubyquicktips.tumblr.com/"
end tell
share|improve this answer
    
OpenURL doesn't work with Leopard...but your second tip is brilliant! – tabaluga Sep 6 '10 at 15:44

this works, but opens your welcome site in first tab...

tell application "Firefox" to activate
tell application "System Events" to keystroke "n" using command down
delay 3
tell application "Firefox"
    open location "http://rubyquicktips.tumblr.com/"
end tell
share|improve this answer
    
This works for me in OS X 10.8 – Nathaniel Waisbrot Jan 19 '13 at 14:32

I'm not entirely familiar with AppleScript, but I was looking to open a brand new default window. Here's a method that works:

tell application "System Events"
    tell process "Firefox"
        click menu item "New Window" of menu "File" of menu bar 1
    end tell
end tell

Optionally, to focus on the new window, add these lines afterward:

tell application "Firefox"
    activate
end tell

This will open a default new window. There may be a better way.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.