revGoURL in same window

Chipp Walters chipp at chipp.com
Wed Jul 14 03:05:52 EDT 2004


I forget where I got this, but I remember modifying it some.
It should do what you want. (appologies to whomever wrote it in the 
first place).

on altGoURL tURL
   put the tempName into tLaunchPath
   set itemDel to "/"
   put "temp_launch.html" into last item of tLaunchPath
   set itemDel to ","
   put createHTML(tURL) into tCode
   #
   if "Mac" is in platform() then
     set the fileType to "????TEXT"
     put tCode into url ("file:" & tLaunchPath)
     delete char 1 of tLaunchPath
     replace "/" with ":" in tLaunchPath
     put "tell application" && quote & "Finder" & quote & cr &\\
         "open file" && quote & tLaunchPath & quote & cr &\\
         "end tell" into s
     do s as AppleScript
   end if
   #
   if "Win" is in platform() then
     put tCode into url ("file:" & tLaunchPath)
     set the hideConsoleWindows to true
     put empty into tTitle
     if "NT" is in systemVersion() then
       set the shellCommand to "cmd.exe"
       put quote & quote into tTitle
     end if
     get shell("start" && tTitle && quote & tURL & quote)
   end if

end altGoURL

function createHTML tURL
   put \\
       "<html>" & return &\\
       "<head>" & return &\\
       "<meta http-equiv=" & quote & "Refresh" & quote && "content=" &\\
       quote & "0 URL=" & tURL & quote & ">" & return &\\
       "<title>Launcher</title>" & return &\\
       "</head>" & return &\\
       "<body>" & return &\\
       "<center>" & return &\\
       "<BR><BR><BR>" & return &\\
       "Loading URL. One moment please..." & return &\\
       "</center>" & return &\\
       "</body>" & return &\\
       "</html>" into tCode
   return tCode
end createHTML


RGould8 at aol.com wrote:

> If I do a:
> 
> revGoURL "http://www.apple.com"
> 
> and then a
> 
> revGoURL "http://www.ibm.com"
> 
> they open up in separate browser windows.   Is there a way in Rev to "target" 
> the first window so that only one browser window is used?
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 



More information about the use-livecode mailing list