Hi,
Your scripting style is horrible. You really need to fix that to make it easier for other people to read your scripts and help you.
I don't think you need a field. When you open a new browser window, you need to specify a URL. You don't need to put this URL into a field first. Nonetheless, your script should work. Do you see any errors or unexpected behaviour? What does sBrowserID contain? What is the result after executing the revBrowserSet command? Try this:
Code: Select all
put "file:///z:\4livecode\test.html" into myUrl
put the windowID of this stack into myWindowID
put revBrowserOpen(myWindowID,myUrl) into gBrowserID
if gBrowserID is an integer then
revBrowserSet gBrowserID,"rect",the rect of img "Name of Image"
put the result into rslt
if rslt is not empty then
beep
answer error rslt
end if
else
beep
answer error gBrowserID
end if
Always put quotes around object names, unless these object names are in variables. Instead of an image, you could use any placeholder, e.g. a transparent or even invisible button, or you could define a variable or constant in the script and assign a rect to it.
Kind regards,
Mark