How to use Chrome URL as a macro trigger?

Oh, so this is not too CPU-intensive?

Yes, I believe the CPU hit on this is very minor; almost certainly less than repeating periodic or application triggers.

1 Like

thank you!

1 Like

Hi,

I was about to post exactly the same question I spent a few minutes to write. Did a very last search on the forum before hitting the “Create Topic" button and I found this gem :grinning:

Now, I can create website specific macros and this is awesome.

Thank you gglick!

1 Like

Brilliant solution, @gglick! :slight_smile:

DAYAM, Keyboard Maestro is so genius in the tools it provides!! Always more to discover. I only occasionally check this board and there are always more things I’m learning!

@peternlewis, it’s too bad that there’s not something that helps users discover some of these gems. Maybe someday a couple videos could be put together (with ideas or even production by forum members) to show many examples like the above in quick succession. There could be an “Essential” or “First Steps” video with some very basic things, and a “Things You Didn’t Know You Couldn’t Live Without” (intermediate one), and a more advanced one…

2 Likes

Like this forum perhaps? :wink:

The problem with trying to provide any specific examples for Keyboard Maestro is that everyone uses Keyboard Maestro very differently. I could look at my most frequently used macros, and most of them would be uninteresting to most Keyboard Maestro users. I’m sure that is true for most people.

Probably this topic is the closest to what you’re after:

1 Like

Hey Aaron,

That’s the trouble with forums. You’re SOL, unless you check them — and they’re generally too full of content to learn things in an organized manner.

Fortunately Discourse has the ability to send email, so I have my preferences set to send me an email for every post.

These get sorted nicely by thread into a Keyboard Maestro mailbox via a rule in Mail.app, and I scan (or carefully read) them at my leisure,

If something interests me I jump from the thread in Mail to the thread in Safari (with a Keyboard Maestro macro of course).

I save anything I find useful for reference.

This way I’m aware of every new thing that happens on the forum without spending an inordinate amount of time.

-Chris

1 Like

Are you aware that you can setup email notifications, for all posts in a Forum Category (sub-forum), or based on tags?

To do this, go to your Forum Profile by clicking on your avatar in the upper right corner, and then click on the Gear menu to set your Preferences:
image

I have this setup, and in my email app (Outlook) I have a Rule to move all incoming email for "Keyboard Maestro" to a folder for that purpose. Then I can review the notifications at my leisure without clutter in my email inbox.

Hello All. Is it possible to do this action just once,in say a 5 minute time frame, but without the Focus window title change? .

For Example - all things being equal with the If area with %ChromeURL%, under execute the following actions:

Speak Text: Keyboard Maestro is opening.
Open " ~Documents/KM" with Finder

I'm sure some count variable or calculation will need to be in there so that every time you change a window it won't just keep looping? Right?

Is there an effective way to have a loop, repeat or calculation that this would just be performed once in a 5 minute span? Or another variable condition?

Please advise.

Thanks much!

You mean something like this, using a periodic trigger?

Example Macro.kmmacros (2.7 KB)
image

Thanks gglick. This will continue to loop every 5 minutes. Is there a way to perform this once while still on that page even if it's longer than 5 minutes? I tried the cancel/break loop but it won't work and will continue. I'm thinking that the only way is to have a long periodic logged in time as you suggest. I thought I could get cute and find a way. I've been searching for a solution for a few hours. It either can't be done without scripting or it's something super simple. Anyway, thank you for your efforts.

KC

No problem. If you're asking what I think you're asking (to be honest, it's not very clear what exactly you're trying to accomplish) you can just add a "disable this macro" action; that way, the macro will no longer execute after it has run once successfully. If that won't solve your problem, please describe what it is you're trying to do (steps, conditions, ultimate goal, etc.) as if you were explaining it to someone who has no idea what your workflow is (since we don't, after all) and then we should be able to offer more comprehensive help.

Hello again gglick,

I wrote this post and erased it about 5 times because I concluded that the only way I could think of to accomplish this workflow is through a periodic trigger as you suggest (most likely the best way) or to disable it (which really would defeat the purpose of the macro in the first place). Also, I didn't want to get BBQd today. :smiley:

Trying to pursue another avenue wouldn't be a good use of your time - which I definitely respect your time!. It wouldn't be worth it especially when I may really really need your expertise in the future.

The workflow I was trying to describe could have been the following:

  1. I type a website (www.fonts.com) and this triggers KM.
  2. -- KM opens a ~Documents/Fonts folder
  3. I download, for example, 3 fonts and install them.
  4. I change focus back to the fonts.com window to download more (However, without the periodic trigger, this would keep opening the said Fonts folder by starting over to #1).

What I was wondering is if there was a way to stop this Macro unless I physically type the www.fonts.com again rather than just changing focus off of that window during that session.

That's all. Hopefully, I'm clear this time. But I'm clear that the periodic way, in this situation is best.

Thanks Much and again, I really do appreciate you reaching out.

Regards,
KC

1 Like

Thanks for the kind words, KC. I appreciate your respect, but rest assured that I only come here voluntarily, and if I really had no time to post here, I wouldn't, so don't be afraid to ask questions :slightly_smiling_face: (especially since I'm far from the only one here who's able and willing to help)

Anyway, yes, you were much clearer that time, and now that I better understand what your goal is, I think I have an easy solution: add a new window condition to the If Then Else action that checks for an open fonts folder window, and only proceed with the macro if there is no Finder window open with that name (in other words, if the folder is already open, the macro won't keep opening it):

24 AM

One other idea: if you don't want a macro like this firing every five minutes regardless of what you're doing on your Mac, you could always add it to a new macro group that is only available in Chrome and when the front window of Chrome is showing the site in question:

30 AM

This will constrain it to only fire automatically when viewing the right site, without relying on the focused window trigger.

1 Like

gglick

I first tried the Any window title of yesterday. For some reason it didn't work on my system. I tried it again today with no luck. I've posted the video below.

As you can see nothing happens until I launch a finder window. Most likely expected. However, the focus will keep returning back and forth as if I selected "The front window" instead of any window. It may just be a bug on my system or a bug in general. At least I was thinking the correct way.

Hopefully, the video shows the example.

Thanks,
KC

https://youtu.be/9qei--GPmi8

I see what you mean; this may well be a bug, though I'm not sure if it's in KM or the Finder (it wouldn't surprise me at all if it was the latter). It looks like KM, for whatever reason, is treating the condition as "true" whether a Finder window with that name exists or not:

55 AM

Fortunately, there is a workaround of sorts: it works properly if checking for the front window, which in practice should be okay since this folder should be frontmost during this workflow anyway:

53 AM

Look at gglick!

Boom. That workaround works brilliantly! Thank you for working through this issue with me. I'm sure I put 4 hours playing with different settings. Now it does not keep bring the focus Finder window focus in front of the browser, which is exactly what I wanted.

Thanks again for your time!

KC

1 Like

I am trying to do chrome url based trigger: if url contains "some-string", find a button and click it.

However when using this trigger, from time to time I have noticeable performance hit when using windows switch "cmd+tab". It is not always but it did happen.

Is there any workaround?

This should help, particularly if the target web page will always have some keyword in its title.
Put the Macro in a Macro Group with limitations for your situation.
Here's a real example that I use:

image

Adjust as needed.

1 Like

Thanks! Changed and seems better now.

1 Like