Use the Same Hot Key Trigger for Different Websites

Hi there,

I am trying to use the same Hot Key Trigger for multiple macro depending on the website I am on.

Let's say that I want to use ^c, for a different action, depending if I am on Google Calendar, or Gmail.

Currently, when I type ^c, Keyboard Maestro display a window that ask me which one of the macro I want to launch.

I can create a "() If Then Else" to act differently depending on a text condition "%ChromeURL%", however, it is not really convenient, as I will have to add all my actions for a specific Hot Key Trigger in a single macro.

Isn't there a way to limit a macro group to a specific website?

Thanks!

Hi and welcome.

Yes, you can specify to which website does a macro apply.

To do this: go up one level, to the Macro Group, and specify the name of the window, as in these examples:

Windows contains Google Docs


Window contains Google Docs

So, the macros in group Browser - Google Docs will only be active when you are in a browser window that contains Google Docs as part of the title.

Adjust for your browser titles

1 Like

Thanks a lot for your reply !

However, the issue is that I want one group to be available on a Saas that I use (facturation.pro), and unfortunately, there are no common words in the titles of the pages on this tool :

It's a shame that we can't use an URL filter in the macros groups ...

A solution that is not perfect, but works well, is to create a macro dedicated to the Hot Key Trigger, and then to add "Execute macro" in it.

Then each macro has a "If" that depends on the URL of the page, and they don't have any Hot Key Trigger.

This way allow me to have each macro in separate folder, and to organize them the way I want.

1 Like

yes, that would help simplify macros.
Adding that as feature request → @peternlewis

Its not really possible.

The window title is available via accessibility, which is slow, but not painfully slow, and can be detected via a change API in the system, hence the macro groups can be activated/deactivated as the window title changes.

But the URL is only available via AppleScript which is painfully slow (for this purpose) and has no change API, so it cannot be used an an activation/deactivation state change for macro groups.

2 Likes