If URL is x, show alert y

i am a big fan of this forum and it’s my first post here!

I was wondering if there’s a way for keyboardmaestro to “watch” the url’s in safari/ chrome etc. and if a certain websites loads, then an action is triggered ?

Let’s say for example (a real life scenario here) that I would like to be reminded to get insurance on all my eBay shipment orders to my clients, but just the ones that contain electronics - so I thought if I received a text alert, like the one that KM has built in, would be very helpful.


There is no trigger for that. However it is likely the title of the window will change each time the URL changes, so potentially you could trigger on the window changing title and then check the URL. I’m not really sure how you would detect that it was an ebay purchase of electronics. You could probably avoid repeating the notification if the last notification was relatively recent (five minutes) on the assumption you’ll not have forgotten yet.

Could you please explain how this translate into a new web page (URL) being shown in your browser?

Perhaps you could provide us with your manual workflow, step by step, and indicated where you want the alert.

Thanks for your replies.

Here is when I want to the alert to show up:

You can get an alert with this:

[test] Safari Window Title Change.kmmacros (4.1 KB)

To avoid false positives refine the Title Condition ("UPS") to your needs, e.g. "Home: UPS" will work with the URL you have provided. (But not necesserily with other sub-pages on the UPS site.)

To get the window titles you can use an AppleScript like this:

tell application "Safari"
end tell

(Most of the times it should also correspond to what you see in the tab title.)

WOW. this is it. thanks a lot Tom!

Slightly off-topic - are any of you guys working in automatics/robotics professionally or is KM just a hobby? I have to admit that there is something really satisfying when you find a way to automate tasks like this :smile:

Happy that it works :slight_smile:

If you think a post has solved your problem you can check the “Problem solved” checkbox at the bottom of the post that solved your problem.

Since this was your first post in this forum, here a hint for future posts:

I could only write the macro because you gave some detailed and real-world information in post #4. Providing such information already in post #1 can greatly help to get an answer more quickly :wink: