revBrowser Inconsistencies
Posted: Tue Jun 08, 2010 12:52 am
Can anyone offer a reason or set of reasons why the following mouseUp script works on the Macintosh but not on a PC. On the Mac the rect shows the browser and answers with the Last Trade price from Yahoo. On a PC the rect looks good but the message about not being able to connect to Yahoo is shown. Additionally tString in debug mode is different in the different environments.
Thanks in advance for any light you can shed on this.
Regards,
Larry
Code: Select all
on mouseUp
local tBrowserId
put "http://finance.yahoo.com/q?s=AAPL" into tURL
put revBrowserOpen(the windowId of this stack, tURL) into tBrowserId
revBrowserSet tBrowserId, "rect", "10,50,500,500"
if tBrowserId is not an integer then
answer "Failed to open browser"
exit mouseup
end if
wait 10 seconds
put revBrowserGet(tBrowserId, "htmltext") into tString
put offset("Last Trade:",tString) into tStart
If tStart > 0 then
put char tStart to tStart + 250 of tString into tResult
put offset("<span",tResult) into tStart
put char tStart+7 to -1 of tResult into tResult
put offset("</span>",tResult) into tStart
put char 1 to tStart-1 of tResult into tResult
replace ">" with space in tResult
put last word of tResult into tResult
answer tResult
else
answer warning "Error connecting to Yahoo Quote."
end if
revBrowserClose tBrowserID
end mouseUp
Regards,
Larry