Greg,
if I understand your problem then you can do it without scripting. I put some code in the BeforeNavigate2 event of my browser controls to call forms or PRGs. This code checks the URL if a VFP form or PRG is to be launched and if so it prevents the default behavior of the browser control (cancel = .T.). The URL has to start with scx:// or prg:// instead of the usual protocol acronyms (http:// or whatever) and will be followed by the path of the form or program to be executed.
The BeforeNavigate2 code snippet might look like this:
LPARAMETERS pdisp, url, flags, targetframename, postdata, headers, cancel
LOCAL lcProtocol,lcURL
lcURL = LEFT(url,6)
IF (lcURL = "scx://") OR (lcURL = "prg://")
cancel = .T.
lcProtocol = SUBSTR(url,7)
IF RIGHT(lcProtocol,1) = "/"
lcProtocol = LEFT(lcProtocol,LEN(lcProtocol)-1)
ENDIF
ENDIF
DO CASE
CASE lcURL = "prg://"
DO &lcProtocol
RETURN
CASE lcURL = "scx://"
DO FORM &lcProtocol
RETURN
ENDCASE
I've acquired quite a taste for a well-made mistake... [Fiona Apple]