I think that it's not necessary to know / use Scrivener to answer my question. Basically my macro does not trigger a menu item.
I want to be able to set Scrivener to Hide Page View.
The logic:
If the menu shows View ➤ Text Editing ➤ Hide Page VIew, then it means that it is currently in Show Page View and the macro should trigger Hide Page view
If the menu shows View ➤ Text Editing ➤ Show Page View, it means that Scrivener is in Hide Page View and all is fine ie do nothing.
I have to do this for many menu items. If I get it to work with Hide Page View, I can easily write the other macros.
What I tried : when a menu item exists, is enabled, etc Nothing works.
Unfortunately the problem persists. This time, I reviewed the macro 20 times letter by letter. I also checked that there are no extra blank spaces at the end of menu items
As I mentioned previously, it is more than a question of one macro. I am configuring a special Scrivener project and there are many similar commands.
As @Sleepy observed you had misspelled the menu-path you were testing, but that wasn't the only problem.
It seems Scrivener is dynamically creating some element in the View > Text Editing menu, so in order to do what you want you have to open it before testing for the final target.
When using menu-paths always test to see if they work by using a notification or other method before moving forward.
Feel free to complain to the Scrivener developer as well.
Works perfectly. Thank you very much Chris for the macro and all the testing. It is greatly appreciated.
I am sorry that you seem to feel that I was not testing enough before posting. I did spend 2 days trying to troubleshoot the macro.
As for the typo in the initial post, yes it is inexcusable. I apologize again to both @Sleepy and to you.
Thank you very much. In the wiki, the following comment is useful If you leave the menu item blank, Keyboard Maestro will show you the menu and leave it displayed so that you can then select the desired menu item manually.
I'm not sure how long it would have taken me to find cc's solution. That was great work.
Your apology was accepted, but I don't think it was necessary. If you forgive us when we are overly-testy we will forgive you when you are underly-testing.