I have a script which loads many web pages and closes ones that don’t contain a piece of text. It used a fixed delay (5 sec) after opening the url before testing the condition. Most times the page opens quicker than 5 sec but a small percentage (10-20%) take longer. Looking for an applescript method of signalling when the page finishes loading.
Spent about 2 days searching for an answer and found some Safari techniques which do not apply to Opera. Now seeking the advice of the forum members.
set varbr to "Opera"
tell application "System Events"
tell process varbr
open location hwurl
delay 5
end tell
tell application "System Events"
tell process varbr
click menu item "Find." of menu "Edit" of menu bar item "Edit" of menu bar 1 of application process varbr of application "System Events"
tell application "System Events"
tell process varbr
keystroke "No ads for"
set var2 to value of static text of window 1 of application process varbr of application "System Events" as text
if var2 = "1 of 1" then
keystroke "w" using command down