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.

Increase the frequency that Gmail checks your POP mail account

Update! After reading the theory on this page you should go to this page to find a simpler, better solution.

Picture 16

Ok this hack might not be for everyone, but if you have Gmail set up to check your pop accounts they don’t let you set the polling frequency anywhere. This can be bad because it makes you go to the settings page to be able to hit the refresh button on each one of your accounts! After a little digging it turns out it uses a weird formula to determine the polling frequency. Let’s say it checks your account and finds an email. The next time it checks it will wait for _slightly less time_ before it checks again. If it finds email a second time it will continue to shorten the interval until it is checking every 5 minutes or so (maybe even less!) The purpose of this is so that google doesn’t waste resources checking an account that only gets one email a month.

The downside of this approach is that if you are eagerly waiting for that one email you might be waiting for a long time (i have seen wait times up to 58 minutes!)

The answer is very simple once you know how it works – get more email! I didn’t want to test to see if the spam filter counts spam received as real mail. I doubt that it does. So I did the next best thing – I automated sending myself email!

I have thought of two different ways of doing this both are mac only, but there must be a billion ways to skin this cat!

Continue reading