Text replacement/type keystroke <stringlength> times

Hi folks!

I am an old time Typinator user (love it) but I wonder if I can use KM to do what I need. Regular text expansion seems easy enough, it's some of the fancy stuff that's giving me a hard time.

Namely, I need to disable "Simulate matching deletes" in a rule to correct double initial capitalizations. I might need it for some words like IDs or CDs or the like, so I need to test the condition before deleting anything. Therefore, I think I need to delete the original text manually in a loop.

The problem is that once I count the length of the input string, for some reason I lose the input string, even though I have saved it to a variable. If I use this macro and type ADs, for example, all of a sudden it outputs "3". What am I doing wrong?

The issue of it not doing the loop is another thing altogether, I suppose.

Thanks in advance.

Is it possible the macro is being triggered again, while you’re processing your macro? Because if it is, it could step on your variables.

I’m working through something like that right now, so that’s where my mind went. Don’t know if this helps or not.

This is caused by use of the "Filter Variable" Action, which REPLACES the value of the Variable with the Filter, in this case the Count of Characters:

Delete this Action, and use this one instead:
"Set Variable to Calculation"

You can compare the Typed String (KM Variable EnteredText) against a list using the RegEx alternate value operator, the Vertical Bar (|):


If you have more, just add a | and then then the string to exclude.

1 Like

Ahh yup, that’s definitely the key. Works perfectly too! (And thanks for the bonus pointer with the “matches” rule.

1 Like

No, not this time. However, I sure noticed it when trying to add exceptions to the list as @JMichaelTX explained above. (Also when trying to enter his username just now! :joy:)

1 Like