How to monitor a specific web page and notify

I must start this question by stating clearly that I know nothing about Web pages, JavaScript or HTML or any of that stuff so please bear with me

I have a macro that refreshes the safari page every 15 seconds to be able to detect when a new solution is added to the top current solution on the linked page (it does this via applescript, I copied it from a post on this forum)

EA FC 25 Squad Building Challenges - ALL - Top Form | FUTBIN

But I have to check the screen to see if a new line has been added every time I refresh. If I could get a notification, sound, etc. on the screen when the top line on the page changes, that would be great. Is that possible? And where should I start?

I know there are a lot of great people on this forum, I'm sure I'll get some valuable ideas.

Safari all tabs reflesh.kmmacros (2.9 KB)

Do you need the app to be running silently in the background or can it be up in the foreground, which would have the side effect of making it difficult (not impossible) to use your computer.

It would be possible to have a solution that waits 15 seconds, but doesn't do anything if your IDLE() time is under 15 seconds. That way you can use your computer for a while and the macro won't run if you are using your computer. But as soon as you walk away it will reactivate.

You may want to explain in more detail what you want your macro to do with the data on that page. I have no idea how to interpret what is on that page. What is that page? Is it a sports betting page?

It must be on the foreground

When a new link is added to the top line, only a warning message on the screen is enough for me, then I will work manually

This page is about the missions in the football game I played from the PlayStation. The important point is that I can't notice it quickly as soon as a new mission link is added.

And it's definitely not about betting.

This is an easy problem. I've done it before using Find Image. You capture the image using an action in KM, and just keep checking the image to see when it changes. It's extremely quick and accurate. Does the page auto-refresh, or do you need the macro to do that?

I have experience doing this. The Find Image is so fast, it can literally check 100 times per second, but clearly you don't need that speed for this situation.

I'm drafting a macro for you right now to solve this.

I use the macro I added in the first message to refresh the page.
And yes, I don't need to scan that fast, refreshing the page once every 15 seconds and checking it every time is fine.

Okay, I have a working macro:

I need to explain it.

  • It notifies you of a "change" just by playing a Tink sound. You can change that.
  • It monitors a specific area of the screen which you can change in the first action. You will have to calculate the coordinates of the area you want to monitor. If the web page contains ads that move the content of the data you are monitoring, that could be an issue.
  • It saves the "last image" in a clipboard called ClipSave.
  • It currently is set to monitor every 1 second but you can change that.
  • The really tricky part is the constant "144" in this macro. This depends upon your screen settings. Every screen requires a specific number. My screen requires 144, but yours may require 100 or some other value. I don't know what your screen settings are so I can't predict this value. This will take a really long time to explain, but try 144 and 100, and if neither of them work I will help you find the correct value for your screen.

There are many alternative solutions to this problem that involve other approaches, but this approach works for me. And I like it because it's fairly simple and involves only native KM actions.

EDIT: MINOR OOPS - you need to move the fuzz factor bar in the IF action down from 75% to perhaps 10%. Sorry, that was done when I was conducting a test. Actually, 75% will work fine for many images, but 10% will be much more reliable.

Thank you very much for your help. I will make the minor adjustments you described. But there is only the image of the macro, will you share it as a macro as well?

And should I place it inside the other macro I use to refresh the page, or should I use both to run at the same time?

Okay, I'll upload it.

I didn't read your other macro. It seems awfully complicated for something that you can do with a single keystroke in a single KM action.

Here it is:

Monitor Screen for Changes Macro (v11.0.3)

Monitor Screen for Changes.kmmacros (5.6 KB)

I tested the macro in various scenarios and it fully meets my needs,

Also, the dpi setting 144 worked for me.

Thank you again for your help, you are one of the great people on this forum my friend.

1 Like

Great! You may be using the same resolution settings as I am.

Aw, shucks. I think a lot of people dislike me here, though. So your compliment has an effect.