How to detect page loading status using applescript and chrome

This is far from rocket science but I haven’t seen it posted so I’m going to put it here for posterity. This is how you can detect if a page is loaded in chrome with applescript. This is a subroutine, so you can put it at the end of your program and call it with this line

checkForLoading()

Ok, here’s the subroutine.

on checkForLoading()
# checks chrome to see if the frontmost tab is loaded
tell application "Google Chrome" to set chromeLoading to loading of active tab of window 1
repeat while chromeLoading = true
delay 1
tell application "Google Chrome" to set chromeLoading to loading of active tab of window 1
end repeat
end checkForLoading

If I recall correctly, wordpress messes up quotes. If this doesn’t compile then replace the quotes and try again.

One Response to How to detect page loading status using applescript and chrome

Leave a Reply

Your email address will not be published. Required fields are marked *


+ three = 9

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>