brijazz
November 5, 2020, 12:50am
1
I have a few typed string triggers set up for use in Safari (for example, typing 'yt ' takes me to YouTube). However, I don't want these triggers to work if I'm in a text field, so that I can type something like "gigabyt es" without triggering the macro.
This would be easy to wrap inside an IF... but I don't know how to tell KM to detect if I'm inside a text field. Thoughts?
ccstone
November 20, 2020, 3:02pm
2
Hey @brijazz ,
You can't.
Unfortunately the macOS doesn't have a public API for Peter to reliably detect such things.
Typed triggers are best used for text-expansion macros and made unique enough that they won't get activated during normal typing.
For instance:
'yt; '
or ';yt '
(less the quotes)
So ⌘ L then
y t ; Space
That's pretty near as fast as your other trigger and solves the problem.
Alternatively you could use a conflict palette for your macros.
Make it a one action palette and give the different sites unique 1 letter/number prefixes to make type-selecting the desired macro simple.
Open Website in Front Browser @ccstone Macros.kmmacros (6.9 KB)
Or you could use a Conflict Palette instead.
Or you could use a Prompt With List action and really go-to-town.
You have many options.
-Chris
brijazz
November 20, 2020, 5:26pm
3
Thanks, @ccstone . I usually go with an ! in front of my typed strings but was just trying to shave off a keystroke (I know, I know...).
ccstone
November 21, 2020, 3:40am
4
brijazz:
(I know, I know...)
Believe me I get this. I'm very particular about efficiency.
-Chris