Emulating old ms office menu keys?

Dear All,
I haven’t learned KM yet, but would be happy to, if it can do what I need. I didn’t want to dig in until I have a sense if it can. So I hope I can ask here.

My problem is that I carpel tunnel requires me to mostly get by with just keyboard. I am a writer. I long ago memorized the keyboard shortcuts to use the old (now ancient) menus in Microsoft Word. E.g. alt-T, W -> word count. The newer office on windows keeps these working, somewhat. But not so on the Mac, sadly. And I go back and forth on different machines, and need to.

I am obviously aware that I can create new shortcuts in OSX, but I cannot create successive ones (e.g. alt-T followed by W or alt-W).

Can I use KM to create this? I guess it would be like a macro that triggers when it sees ALT-T (e.g.) and then waits to see what comes next, and, if W (e.g.) then it triggers wordcount.

Can this be done?

thanks in advance!

I think you'll find that Keyboard Maestro (KM) can automate almost anything on your Mac. It is very powerful and very flexible. Feel free to ask any KM question here.

Yes, can be done. It is not hard, but is somewhat of an advanced use of KM.
It makes use of:

  • Text Expansion (typed string) triggers
  • RegEx to make trigger dynamic
  • RegEx to extract option from Trigger actually used
  • Switch/Case Action to handle multiple options

Here's an example macro that should meet your needs.
Please let us know if it works for you, and/or if you have any questions.

##Macro Library   @Word Old Win Shortcuts @Example


####DOWNLOAD:
<a class="attachment" href="/uploads/default/original/2X/0/081ec1ed09a4cae42e4f20ed0ff2ee411a3cd9d9.kmmacros">@Word Old Win Shortcuts @Example.kmmacros</a> (7.9 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**

---

###Use Case

* Select MS Word Menu Items using old Word Windows menu shortcuts, like "ALT-T, w"

---

###ReleaseNotes

Author.@JMichaelTX

**NOTICE: This macro/script is just an _Example_**

* It is provided only for _educational purposes_, and may not be suitable for any specific purpose.
* It has had very limited testing.
* You need to test further before using in a production environment.
* It does not have extensive error checking/handling.
* It may not be complete.  It is provided as an example to show you one approach to solving a problem.

**HOW TO USE**

1. Type the TRIGGER while in a Word Document
  * Example:  ` tw`  (first char is OPT-SPACE).
2. The Trigger prefix is: `⌥ t`  (OPT-SPACE, then "t")
  * If you would prefer to just type "ALT-T", that would be "OPT-T" on the Mac
  * This will produce the character "†"
  * So, change the Trigger to:  `†[ \w]`
3. The next character typed determines the Action (Word Menu) to be executed:
  * "w" -- Word Count
  * "a" -- AutoCorrect Setup
  * any other char -- Show Word Tools Menu
    * Then you can start typing the menu item names

**MACRO SETUP**

* **Carefully review the Release Notes and the Macro Actions**
  * Make sure you understand what the Macro will do.  
  * You are responsible for running the Macro, not me.  😉
.
* Change the TRIGGER if desired.
  * Current Trigger:  `OPT-SPACEt[any letter, number, or SPACE]`
  * Example:  ` tw`
  * The last character typed determines the Action to be taken.
  * See the SWITCH Action below
.
* Move this macro to a Macro Group that is only Active when you need this Macro.
* ENABLE this Macro.
.
* **REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:**
  * ALL Actions that are shown in the magenta color

**USE AT YOUR OWN RISK**

* While I have given this limited testing, and to the best of my knowledge it will do no harm, I cannot guarantee it.
* If you have any doubts or questions:
  * **Ask first**
  * Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.

---


<img src="/uploads/default/original/2X/d/d2a3d71bc2297b88494a0058e6fc4e5619e55578.jpg" width="516" height="2000">
2 Likes

This is so generous and so helpful – thanks! And it is beautiful too – love the idea to still show the menu if second key unrecognized. thanks!

1 Like

Your starter programming here turned out super helpful and valuable. I’ve filled it out quite a bit. One worrisome thing I just noticed is this: If I have text selected in word when I engage the macro, that text is deleted and replaced with the alt character, e.g. ø. Although running the macro removes the alt character, it doesn’t bring the deleted text back.

Is there some way to engage these two key macros without getting any typing at all? Is that an artifact of the fact that we are using ALT instead of CTRL, for example?

thanks,
zczc

That is the general nature of using text expansion. The text you type (in this case the macro trigger) will naturally replace any text you have selected. That happens BEFORE the macro is even triggered, so it knows nothing about the the text you deleted/replaced by typing.

I think your choices of a workaround are:

  1. Make sure no text is selected before triggering the macro
  • Use a hotkey for a trigger. The macro would then prompt for the name of the menu item you want.

Thanks again. You’ve done more than could be expected, but I don’t suppose you can point me to an example of someone using a hotkey trigger and prompt?

thanks,
zczc

It is as simple as adding a hotkey trigger to the macro, and then using the Prompt:

Here's my macro above modified to ADD a hotkey trigger (it still has the typed string trigger):

Thanks, this is cool. I first tried rigging something myself on seeing how you used hotkeys, and it had the unintended effect of this: if ALT-T is pressed it immediately drops the Tools menu.

That could actually be pretty helpful in itself. I could just set those up for the menus I want to drop (tools, file, etc.)

One thing wrong with this approach is that there seems no way to see what keys will activate what choice within a menu. E.g. “w” is word count, but so is “u”, and I see no way to get to Customize Keyboard.

Also, it requires hitting return — I’d prefer to avoid.

The Prompt for User Input idea also requires that return, so I’d rather avoid. I guess I’m looking for: trigger on hotkey THEN WAIT FOR ANOTHER HOTKEY.

Do you know if there is a way to get that?

thanks!

The only way I know of is to use a Show palette for one action. You would have to create a dedicated Group, with one Macro for each menu item you want to choose.

It's up to you, of course, but all that seems like a lot of work just to avoid pressing the RETURN key. It would also be harder to maintain and add new items.

Why don't you try the Prompt method for a while? I think it's likely that pressing the RETURN will soon become muscle memory. :wink: