webpage_opening

  how to open a webpage
webpage open




  Advanced WebPage opening
Just wanted to show this to you people if someone
else needs to do
something like this :)

I've been working on this problem for awhile and 
come up with a solution that's a blend of Director
, embPERL and Javascript.. but I'm still having 
one problem.

Example, this is a command I run from Director 
(this one is for IE):

baRunProgram(baReadRegString
( "Software\Microsoft\Windows\CurrentVersion\AppPaths\iexplore.exe", "",
"", "hkey_local_machine" ) && "javascript:window.open
('http://siggi.icelandcomplete.is:81/redir.phtml/www.icelandcomplete.is','','fullscreen,scrollbars')",
"Maximised", TRUE)

This is linked to a script on a "temp" webserver on my computer.. I open
this from inside my multimedia with a command that switches res (to a
higher one) and then opens the browser like that (except ofcoz the url
changes). I then make that program wait for the termination of the browser
before it changes the resolution back and returns to the multimedia.

Here is the script I have in the projector I compile as "browser.exe". I
then run that from my "main" projector with the target URL as the command
line parameter.
If anyone has questions or ideas, just post them here or email me at
siggi@icelandcomplete.is

Btw.. I don't think this works with netscape (yet!)  anyone know if
netscape has a fullscreen mode?

This will open the default browser in fullscreen targeted at an url (and I
added the extra bar at top etc. with a perl script) and wait for you to
close it (with the close button on my extra bar)


on moviestart me
-- Get the command parameters passed to the program
set CommandArgsToParse = baCommandArgs()
set WebToOpen = item 1 of CommandArgsToParse

-- Find the default browser
set uu = baFindApp( "htm" )
if uu contains "iexplore.exe" then
-- Internet Explorer
set defaultBrowserinn = baReadRegString
( "Software\Microsoft\Windows\CurrentVersion\App Paths\iexplore.exe", "",
"", "hkey_local_machine" )
end if

if uu contains "netscape.exe" then
-- Netscape Navigator
set defaultBrowserinn = baReadRegString
( "Software\Microsoft\Windows\CurrentVersion\App Paths\netscape.exe", "",
"", "hkey_local_machine" )
end if

-- Make the string to pass to the browser
set test11 = "javascript:window.open
('http://siggi.icelandcomplete.is:81/redir.phtml/" & WebToOpen &
"','','fullscreen,scrollbars')"
-- Now run the default browser
baRunProgram(defaultBrowserinn && test11, "Maximised", FALSE)
-- Save the handler for the first window (the one that spawns the
fullscreen one)
set oldBWin = baNextActiveWindow(0)
baWaitTillActive(oldBWin)
-- Wait for the other window to open and get "active"
repeat while oldBWin = baActiveWindow()
nothing
end repeat
-- Save the handler to the new window
set newBWin = baNextActiveWindow(0)
-- Close the old window (the one that "spawned" the fullscreen one)
baCloseWindow(oldBWin)
-- Set the new window handler
set newBWin = baActiveWindow()
-- And wait for that to close
baWaitForWindow( newBWin , "closed" , 0 )

-- And quit when that's done..
quit


Home shock + cgi Bits 'n pieces Director Lingo ShockLets Contact