Detect if Front Window Text Changes

Here's a macro that monitors for changes to the frontmost window and lets you invoke an action "if it changes" and the term "if it changes" essentially means "if the number of unique words on the window differs from the last check by more than N words," where you can change the number N. For most purposes a number around 3 should suffice, but it depends upon your situation. You can use a larger number for N if you are getting some false positives.

IMPORTANT NOTE: an updated version (11.1) is found below. Please use that version.

Detect if Front Window Changes Macro (v11.0.1)

Note that any macro that runs every 5 seconds is going to impact the performance (and especially battery life) of your Mac if it is left enabled for extended periods.

You are correct. I don't own laptops so I don't think much about "power".

Here's a slightly newer version that may be required for some people. I will edit my first post and ask them to download this one instead.

Detect if Front Window Changes Macro (v11.1)

Detect if Front Window Changes.kmmacros (12 KB)