tabaluga tabaluga - 14 days ago 6
AppleScript Question

How do I instruct Applescript to open a new Firefox window with a link?

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?

Answer

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