Detecting whether a menu item has been selected

I'm working with an app (hate to call it that since it's obviously not macOS native) named Mylio and it has a "Console" activated by menu Help>Console or Cmd-option-C. When the console is opened (something like you might see in a browser developer mode), the menu has a check but the name doesn't change. Can KM detect the state, i.e., determine whether the console is opened or not?

Menu after Console is opened.

My use case is that Mylio has provided a long command to determine needed information (what Album is a selected photo in). I can use KM to open the console and paste and run the command, but after I've done it once then the KM script doesn't work because then it closes the Console and the paste goes into the ether.

I've asked Mylio this question too.

OT: You may ask why one would use such a program. Mylio does a very good job of keeping photos on multiple iOS and macOS devices.

You have a problem if you have more than one menu item with Console, and some apps are better behaved than others.
However, try this (modify for Mylio) and to start with just display a text window depending on state.

image

Yes. Use the IF/THEN Action with a Condition of Menu condition.

1 Like

I think this is what you're suggesting. Unfortunately it doesn't work


As shown without Console enabled, nothing happens.
If I toggle is enabled is changed to is not enabled it works, but then if I use it again with Console opened (enabled state) the console just closes.
In other words it's always going to the else condition.
I hope I hear something from the developer. They are responsive to inquiries, but aren't keeping up with obviously needed (IMHO) changes that I've requested.

Maybe if I knew what the checkmark was I could use that in the menu item name

I don't have any problems with multiple Console menu items—I must not have been clear.

PS. The script I've shown wouldn't actually work because I'd have to add a way to get in the text entry area. Tabbing doesn't work, so would have to be a click in a window that can be changed. It's not really a window. The "Console" takes up some space at the top of the main window and the size can be changed by dragging.

See my other response, but I don't think KM can detect the state of the menu.

Does this work for you?

KC

2 Likes

Thanks for the suggestion. Nothing happens. Based on this I tried exists but is not marked too. Nothing happened.

I guess I should just add a shortcut for pasting the command and move on..

Interesting... I have a few macros that work fine and they depend on this exact same method. Well, good luck on your other solution.

KC

I looked briefly at the product video on the Myilio web site, and it looks like a standard Mac app to me. In particular the Help menu is very standard. So the KM menu Actions should work.

So, it may be that you are missing some small detail about using KM. If you'd like to upload your macro we could take a look at it and offer better help.

Thanks. When I said it wasn't standard, it's non-native app stuffed into a macOS interface (Much of it looks like the iOS app with a few menu items grafted on). The interface has much non-standard behavior and lots of things don't work right. All that said, the Select menu item macro works, the conditional one doesn't. So I'll upload it and my error can be discovered. Thank you. I just noticed that the grayed out message to the right of If all of the conditions are true: always shows (currently true) no matter what the status is, although I see it was false in the screen shot I posted. Which Album is this photo in?.kmmacros (5.4 KB)