Way to Force Safari to load URL

Ken Ray kray at sonsothunder.com
Fri Mar 11 16:00:19 EST 2005


On 3/11/05 12:48 PM, "RGould8 at aol.com" <RGould8 at aol.com> wrote:

> 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?

Here you go:

on mouseUp
  LaunchSafari "http://www.ibm.com/"
end mouseUp

on LaunchSafari pDestPage
  put "<html><head></head><body onload=" & quote & \
      "javascript:document.location='" into tScript
  put tScript & pDestPage & "'" & quote & ";></body><html>" into tScript
  set the fileType to "TEXTsfri"
  put specialFolderPath("temp") & "/launcher.html" into tLauncherFile
  put tScript into url("file:" & tLauncherFile )
  get shell("open" && tLauncherFile)
  -- need to delay the delete so there's time for Safari to open the file
  send "delete file" && quote & tLauncherFile & quote to me in 5 seconds
end LaunchSafari

HTH,


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list