How to activate a menu item of an element of the bar menu

Hi.
I just would activate a menu item of an application attached to the Apple bar menu.
example:

DropCopy_menu
I would activate the line 'Recent Incoming Fies' of the Dropcopy's menu

I found on the forum some examples of AppleScript which I tried to draw inspiration from ...
But alas, I'am not a 'scripter' ...
I'm trying something as:

But, of course ( :disappointed: ) that doesn't work.
Can anyone help me ?
thank you in advance.

Hi.
I just read several posts on the subject
(especially: OS X Accessibility Inspector (UIElementInspector) Tool for UI Scripting)
But as we say in French: "J'y perds mon latin" ... :flushed:

How to find information about menu bar # and menu bar item #
in the case of an application residing in the menu bar.
It is really not clear to me.
Thanks in advance

I fear without the above mentioned tools (or by listing the elements via AppleScript) this will be hard, if not impossible.

When it comes to the number of the menu bar item, you could try to find it with trial and error. (Be careful if the menu contains some kind of potentially destructive commands.)

Thanks Tom.
That's I am trying but Applescript is not my cup of tea :wink:

I'm not saying you should, but you could use the click at found image action to click on the menubar item.

Thanks Vincent.
I tryed that solution this afternoon and it seems to be ok.
But I should prefer the Applescript approach because it seems me more generic...

As I posted in that thread:

Since I posted this topic nearly 3 years ago, I've learned a lot.
So, I no longer recommend this tool, as it does not work with all macOS's.
Instead, I suggest you try one of these tools:

  1. UIElementInspector provided as part of the free Xcode download (as @Tom suggests)
  2. Use the AppleScript tool by Chris @ccstone
    Front Window Analysis Tool for System Events
  3. For more complex UI scripting, you will benefit from UIBrowser , which works will all macOS including Mojave.

Probably UIBrowser would be the best tool for this job.

Thanks JMichaelITX

I tested UIElementInspecter and the Applescript tool from Chris, ... without success.
I'm going to test the trial version (30 days) of UIBrowser

In the meantime, I used the action 'Click at found image' as suggested by Vincent_Ardern
and it works ...

Thank you Filou this helped me for the step of my macro.

But the rest: simulate keystroke : down arrow , does not work for me

Hey, I worked around with this other function to get to click ont the menu item I need.

image

Thanks a lot for your help.

I'm happy for you... :wink: