Keyboard Shortcut to Right Click in Mac OS X

I think, it does get transferred if you use the migration assistant when setting up a new Mac.

But, indeed, they should make it sync via iCloud, as they already do with the text replacements in System Preferences > Keyboard > Text.


This is a nice example for what I meant in the other thread when I said

The RegEx used here…

^(?:Enable|Disable) (?:\d+ )?(?:Macro|Action)

… is pretty simple:

^
Normally: An anchor that marks the beginning of the string. Here: In the context of this specific action it also tells KM that the following is a RegEx (KM Wiki). That is, it is obligatory in the special case of an RegEx in KM Menu actions[1] (It is not obligatory in any “standard” RegEx use-cases.)

|
A simple alternation (“or”).

()
The parentheses define a group. The ?: is optional and has no grammatical meaning; it says that the group is not a capturing group, just a “normal” group for logic grouping, which we need for the alternations here.
For understanding the RegEx just fade out the ?:.

\d
Matches any character that is a digit. It is a shorthand for the character class [0-9] .

+
A quantifier that means ‘one or more of the preceding item’.

?
Another quantifier, which means ‘zero or one of the preceding item’; in other words: it makes the preceding item optional.


So, the expression for the Menu Item reads like this:

  1. String starts with either “Enable” or “Disable”; followed by one space.

  2. Then comes a sequence of any number of digits followed by one space. This sequence is optional (the ? after the group), because it appears only in the plural form (“Disable 2 Actions” vs “Disable Action”).

  3. Finally, either the string “Macro” or “Action”.

The optionally following plural s is irrelevant, because we do not match until the end of the string ($); so we can ignore it.

That’s all. Magic gone.


Footnotes:

1: Except when your only metacharacter is the |, and there are no spaces in the string, it seems.


PS:

I checked the KM menus for competingly named menu items in the View and Action menu. It seems the only one is “Hide Disabled Maco Groups” in View.

So, you could get away with an even simpler expression:

^(?:Enable|Disable)

Or even

^Disable|Enable

With the latter the order is important: ^Enable|Disable would trigger the “Hide Disabled Maco Groups”.

All the expressions also work for macro groups, BTW.


PS 2:

I just noticed that the View|Actions for the menu title doesn’t work. It seemed to work, because the “Enable/Disable Action” redundantly also appears in the View menu, if an action is “properly” selected, i.e., you have clicked the action and your cursor is not inside a text area of the action.

I’ll edit my previous post accordingly.

2 Likes