I've set up a macro for Scrivener that looks to me like it should work, but it doesn't. There is a "Hoist Binder" menu item hidden in the View menu:
View > Outline > Hoist Binder
When I execute it using the hot key I've defined, nothing happens.
I think I know what is causing this. The View menu has two submenus "Outline" and the one I want is the second one. My guess is it's hiccuping somewhere because it can't find Hoist Binder under the first submenu.
Is there any way to steer KM to the second "Outline" item in "View"?
It's hard to say without seeing your macro. What action are you using to select the menu item? The Select or Show a Menu should do what you need, but if this is what you're using and the macro still 'fails', then my first guess is that maybe the Hoist Binder menu item is greyed out when you're trying to trigger it.
That's exactly what I have. I don't think it's grayed out. Sometimes it would be, but I've tried it in context where I checked it before and it wasn't grayed out.
The first Outline is a menu item though, the second Outline is a submenu. I don't think Keyboard Maestro is confusing the two if your action is set up the way I demonstrated above. And since you said that "nothing happens", that would suggest that the menu item is either inaccessible or there's nothing for it to do. If KM was somehow trying to select the Outline menu item instead of the Outline submenu, wouldn't it change the view to Outline mode when you triggered the macro?
You could try adding a keyboard shortcut for Hoist Binder via the macOS Keyboard Shortcuts to test if that is more consistently successful than your macro. Does your macro do more than just select the Hoist Binder menu item? If so, the failure could be somewhere else.
Probably worth looking at similar threads regarding Scrivener and Keyboard Maestro since in the past the two didn't play as well together as one might expect because Scrivener was slow to populate its menus.
Thanks for the reminder that I can create keyboard shortcuts just using macOS. It did that and have been able to get what I want using the shortcut shift-F7. I can unhoist it using ctrl-shift-F7.
Unfortunately, when I try to repeat the hoist, it doesn't work, seemingly until I open up the menu by hand. Then it starts working again.
Still I'm a lot farther than I used to be. Maybe I can just live with the way it's working now.
Thanks @NaOH for the links to the two other threads. Maybe I'll take the time to use the information there to figure out how to set up shift-F7 to toggle between hoisted and unhoisted instead of having to use two separate keys.
You can do this easily using macOS Keyboard Shortcuts just by using the same hotkey for both menu items. Neither menu item shows when the other is displayed, so there will never be a conflict.
That sounds like the same issue I referenced, whereby Scrivener is slow to populate its menus. This is often circumvented by adding a pause in a macro, something like
I had a similar issue with Drafts. Weirdly, though, as I recall, the menu items simply never updated until the menu was clicked open. Very frustrating, and I don't even remember what my solution was. I think maybe I had KM open the menu briefly and close it again to force the items to load and carry on. Although, I think the Drafts problem is probably different because, if memory serves, the problem only occurred on launch.
I have been using Scrivener for many years. In my experience it is the worst app when it comes to using the select menu action. My workarounds involved using the if then else action → menu item enabled.