Hi gyro,
this isn't going to be easy...
The only way I know to get the current url from the browser to be returned to Rev is as per Ken Ray's post here:
http://lists.runrev.com/pipermail/use-r ... 20513.html
Code: Select all
Set objApps = CreateObject("Shell.Application")
For Each objApp in objApps.Windows
If (objApp.Name = "Windows Internet Explorer") or _
(objApp.Name = "Microsoft Internet Explorer") Then
If objApp.LocationURL <> "" Then
WScript.Echo objApp.LocationURL
End If
End If
Next
I'm not aware of how vbscript or such could retrieve the url from any other browser.
To open a browser in a new tab is possible, but you'd have to test for the browsers...
On the Windows platform you can interrogate the registry key
Code: Select all
HKEY_CLASSES_ROOT\http\shell\open\command\
and return the default browser path.
If that is IE then you can run the following vbscript
Code: Select all
On Error resume next
result = "OK"
destinationURL = "http://www.runrev.com"
Set objShell = CreateObject("Shell.Application")
If Err <> 0 Then
result = "Error creating shell application"
End If
If result = "OK" Then
Set objShellWindows = objShell.Windows
If Err <> 0 Then
result = "Error getting windows collection"
End If
End If
If result = "OK" Then
Set objIE = objShellWindows.Item
If Err <> 0 Then
result = "Error getting windows item"
End If
End If
If result = "OK" Then
objIE.Navigate2 destinationURL
End If
If Err <> 0 Then
Set objIE = CreateObject("InternetExplorer.Application")
If Err <> 0 Then
result = "Error creating IE Application object"
Else
objIE.Visible = True
objIE.Navigate2 destinationURL
End If
End If
Set objIE = Nothing
Set objShellWindows = Nothing
Set objShell = Nothing
which should open the destinationURL in a new tab if IE7 is already open. If IE7 is not open then it will cause an error which is then handled by the second part of the code to create an IE instance and navigate to it.
I don't know what happens in any version other than IE7.
If the default browser is Firefox, then you can
Code: Select all
put "http://www.runrev.com" into tURL
put "start '' '<path to firefox.exe from registry>' '-new-tab' '" & tURL & "'" into tFirefox
replace "'" with quote in tFirefox
set the hideConsoleWindows to true
get shell (tFirefox)
Firefox has the -new-tab switch to open a destination in a new tab. (The extra pair of quotes between "start" and the path is to be a blank title for the (hidden) console window, otherwise it won't start).
Opera seems to have this behaviour by default, so if it's open it will go to a new tab on launching your url, or open itself with the url in the first tab if it's not already opened.
Code: Select all
put "http://www.runrev.com" into tURL
put "start '' '<Path to Opera from registry>' '" & tURL & "'" into tOpera
replace "'" with quote in tOpera
set the hideConsoleWindows to true
get shell (tOpera)
I don't know about any other browsers.
HTH