Newbie question: opening menu and selecting item in Gmail compose

HI, I am trying to interact with a Gmail compose window menu to add labels to outgoing messages (to my knowledge there is no keyboard shortcut for that). I am able to open the menu by searching for an image (see screenshot), but I can't select a menu item: searching for an image of the "Label" menu item will not work.

Any help would be greatly appreciated.
Thanks in advance!

Try search the forum for “gmail”. There may be something already created that can do what you want.

thanks, I did but could not find anything related…

So, you can’t just use the URL That seems a lot easier than trying to manipulate an HTML popup menu.

Here’s where I got that from, and some AppleScript that will open the compose in a new window:

But if you really do want to manipulate that menu, that’s cool. But it’s an HTML menu, so you can’t use one of KM’s standard actions. I’m guessing there’s a way to do it through one or more of the HTML/Browser actions, but I don’t know what it is. Someone else will have to give you the answer, though. I’ll be interested to see what they recommend.

There is actually a keyboard shortcut to compose, so I will not need the compose link.
I just wanted to have a shortcut to add a label while composing. I noticed that if you run the macro again after the html menu is open, the image search for a menu item will work, so I am trying to nest this second macro within the first. Thanks!

Yeah, you can probably get that to work. I wasn’t even thinking about searching for images. Which is kind of funny, because that used to be my go-to means to do anything like this. :slight_smile:

So if you’re having problems getting the find image to work, let me know, 'cause that’s actually something I know about. :smile:

I was only thinking that one of the “Chrome” actions available could probably do what you need, but I’m never sure how you find the HTML element that the actions want as a parameter.

Hope you get it working!

Hi Giovanni did you find the answer for this because im having the exactly same problem :frowning:

Yes, if you nest the two macros it works and I am happy to share, however in gmail i need to make sure to account for all the possible window positions etc, so my macro is still buggy…

Hi all,

I wanted to check if anybody has a better solution to handle option selection in HTML menus? My solution based on image search is not optimal, as it does not work well across devices (desktop vs. laptop etc.).

HTML menus are increasingly common and a general solution might be applicable to other websites as well.


Hey Giovanni,

The best way is to use JavaScript in Safari or Google Chrome to activate the menu for you.

Something like:

document.getElementsByClassName('J-J5-Ji J-JN-M-I-Jm')[0].click()

But getting the correct syntax can be quite tricky. (The above doesn’t work for me.)


1 Like

thank you so much. I will look into that!