I have a need to expand a typed snippet on a specific website in a Google Chrome web browser.
I was able to achieve that on JIRA website, which always has " - Issue Tracker" added to the frontmost window title. However, this doesn't work for Phabricator website which has radically different frontmost window title on each page.
Is it possible? For example, is there any way to obtain the URL of the currently opened tab (e.g. %ChromeURL% variable) and use it as a Macro Group activation condition?
However, I can understand why you might prefer to do it the way you're suggesting. For one thing, setting up the snippet macros is a bit simpler, as you can use the trigger string auto-delete feature.
You can simplify this further to an If/Else rather than a Switch/Case if you want to enable/disable a group rather than individual macros. I just figured I'd cover as many options as possible; maybe you'd like some snippets only available on certain sites. Here, I've chosen to use matches for brevity, but you could equally use multiple if any conditions.
The last solution with a macro that conditionally deactivates/activates a macro group was the exact thing I had in mind, but due to limited Keyboard Maestro knowledge I didn't know where to start.
Thank you very much.
An interesting observation: a macro group deactivation is something different, than manually disabling it, because it still appears enabled (not greyed-out icon) in the Keyboard Maestro app, but doesn't work anymore.
Activating and deactivating macro groups based on the URL certainly works (thanks for the idea!), but it is rather awkward as the number of different websites in Chrome (just thinking about different Google apps alone!) proliferate. Since most websites are apps and not pages, it seems logical for KM users to have the equivalent of "Available in these applications:" for browser-based apps.
Is there a technical reason that prevents having Keyboard Maestro provide a filter in "Enable Macro Group" (akin to "Available when a focused window...") that is based on the URL? I realize this would be an enhancement to KM. Given how mature KM is, I'd assume it would already be supported it if were possible. If it is possible, this would enable all the power of macro groups to be accessible for browser-based apps.
Browsers don't pass the current URL back "up" to the OS, so it isn't easily available to KM -- you have to ask the browser for it (which is why the above works).
Luckily most web apps do have consistent page titling -- JIRA was mentioned in the OP, I've got a Group that's only active when our Freshdesk instance is the frontmost, etc -- that you can leverage with "Focused window title matches...".
As a user of KM I don't care how the URL matching will work for the specific browser, but I care about having it in the first place. About 80% of my work is in the browser, so I use apps there constantly. And sometimes it is very inconvenient to not be able to restrict a macro group to the specific page, because the author of the site didn't add a unique app name in title field.
Do we have any feasibility to have this feature in the future? Where can I vote for it?