Hi Irene
I write your code in "How convert Log error to Log message" thread. It works properly only for first menuitem which I want to know exists or not.
For the second menuitem the submenu is opened and the function "MenuItemexists" works for submenu. To avoid this I decided to close popupmenu and open it again. Now it works properly.
For notepad it will be equivalent that I want to know if exist menuitems "Open IME" and "Reconversion" in popupmenu, but for "Reconversion" the "Insert Unicode control character" would be opened and the function "MenuItemexists" will work for this and will not find it.
But in Notepad your code works fine:)
Best Regards