Can a specific browser URL trigger a palette or other action?

I see where a change in browser window title in general can be used as a trigger. Is it possible instead to set up a trigger based on a specific browser URL. In particular I would like a palette that is activated when I go to a specific website.

URLs themselves can't be triggers, but you can use the "window title changes" trigger in conjunction with an If Then Else action that checks the URL and shows the palette:

image

3 Likes

That works great - thank you

I would like the palette to close when I change to a different website - I thought this would do that but it does not seem to work - any thoughts?

No problem. As for your next question, I don't think you actually need to do anything for the "otherwise" part. In my testing, just showing the palette on the website as per my earlier screenshot closes it when you switch tabs or otherwise navigate away.

I tried without the Else and the palette does not disappear when navigating away.

Interestingly if I change the Macro below and make the "Global Macro Palette" actions active instead of the "Richard Custom Macros" then it works fine for the palette to disappear when navigating away. Any idea why the global macro palette behaves differently in this regard?

I'm afraid I don't know enough about KM's inner workings to try and answer that, but perhaps @peternlewis will choose to weigh in at some point. In the meantime, I can suggest an alternative method, one that I use myself for this sort of use case: create a new macro group, restrict it to the browser(s) you want to use it with, and configure it to only be available and show a palette when the focused window title contains a word in the title unique to that site:

57%20PM

This may not work for you if you absolutely require a URL condition, but if there is a word unique to the site you want (maybe "Decos" in this case?) this should successfully show a palette only at the specified site(s) and hide it otherwise. This method also has the advantage of not requiring any additional triggers for the macros you put in the group, and it's a bit less resource intensive since it doesn't execute on every title change.

If you're sure you still want a URL based "trigger", then one last thing I can suggest is to remove the "Hide Macro Group" action and quitting/relaunching the KM engine, to reset the macro group's activation status. It isn't clear from the "Hide Macro Group" name, but hiding a palette with this action also deactivates the corresponding macro group, which, in my experience, can sometimes cause macros to not behave as expected (in fact, when I was testing the macro I showed you myself, I couldn't get it to show the palette at all until I relaunched the KM engine). It may or may not solve your issue, but it can't hurt to try.

@gglick - That works perfectly. Many thanks!

1 Like