Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Open new Safari window with an AppleScript application' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Open new Safari window with an AppleScript application
Authored by: larkost on Dec 10, '03 11:50:07AM
Rather than using UI scripting, why not just rely on the AppleEvents that Safari already supports? Here is a quick example that will do what you want:

tell application "Safari"
	make new document with properties {URL:"http://www.macosxhints.com"}
end tell


[ Reply to This | # ]
Open new Safari window with an AppleScript application
Authored by: Laqua on Dec 27, '04 03:15:41PM

For some reason this does not work for me. It opens a new window, but leaves the url to whatever the default page is in prefs.

---
Thanks
Laqua



[ Reply to This | # ]
Open new Safari window with an AppleScript application
Authored by: Laqua on Dec 27, '04 03:26:01PM

I did find a solution though, here is what I wound up using.

tell application "Safari"
make new document
set URL of front document to "http://www.bright.net"}
end tell

The reason I did this is because Applescript always seems to put the newly created window in front of all others.

---
Thanks
Laqua



[ Reply to This | # ]
Open new Safari window with an AppleScript application
Authored by: mjmtaiwan on Mar 15, '05 08:40:36PM

This does not work.

[code]
tell application "Safari"
make new document
set URL of front document to {"http://www.bright.net"}
end tell
[/code]

It gives the error: NSUnknownKeyScriptError

---
Old Time Radio from the 30s, 40s and 50s



[ Reply to This | # ]