Way to Force Safari to load URL

RGould8 at aol.com RGould8 at aol.com
Fri Mar 11 13:48:46 EST 2005


revGoURL is great for launching the default browser to a specific URL.   In 
my case, however, I need to force Safari to launch to a specific URL, even if 
the user's default browser is set to Firefox, Opera, etc.   Anyone know a way 
to do that via unix?

There is an Applescript call, but I've found that if the Safari default 
homepage is set to a large-website, Applescript launches Safari, tries to load the 
default homepage, then gives up on loading the desired URL:


tell application "Safari"
     set targetURL to "https://activate.verizon.net/launch/start/?ver=1.0&
cdtype=vzone&type=consumer&template=no&customertype=newdsluser"
     try
          set thisDocument to document 1
     on error
          set thisDocument to ""
     end try
     if (thisDocument is "") then
          set thisDocument to make new document at end of documents with 
properties {URL:targetURL}
     else
          do JavaScript "document.location='" & targetURL & "';" in 
thisDocument
     end if
end tell


If you run this Applescript, you'll see what I mean - - - set your default 
homepage in Safari to www.google.com, and it'll work fine.   Then set your 
default homepage in Safari to www.verizon.com, and this Applescript fails.

If there's a unix-way to accomplish this, perhaps that will get around these 
Applescript issues.



More information about the use-livecode mailing list