Click menu by name

Get help with using AutoHotkey and its commands and hotkeys
virgilsisoe
Posts: 1
Joined: 13 Jan 2021, 13:07

Click menu by name

13 Jan 2021, 13:27

Hi to everyone, first post! :wave:
I have absolutely no experience or knowledge about AHK so before deciding if is worth investing time into learning it, I would like to know if is possible doing what I have in mind.

I come from macOS using applescript and (to a certain degree) I am able to click GUI menu items by their name without a specific pixel position in the screen space.

An example would be:

Code: Select all

click menu item "Scripting" of menu 1 of menu bar item "Workspace" of menu bar 1.
This would basically click those menu items without the mouse "technically" moving.
Image
Attachments
Screenshot 2021-01-13 131423.png
Screenshot 2021-01-13 131423.png (15.62 KiB) Viewed 57 times
iPhilip
Posts: 469
Joined: 02 Oct 2013, 12:21

Re: Click menu by name

13 Jan 2021, 18:35

Hi @virgilsisoe,

Have you looked into the WinMenuSelectItem command?

Code: Select all

WinMenuSelectItem, A, , Workspace, Scripting  ; You might also try 8& in place of "Scripting"
I hope it helps.
Windows 10 Pro (64 bit) - AutoHotkey v1.1+ (Unicode 32-bit)
TAC109
Posts: 619
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Click menu by name

13 Jan 2021, 22:44

Also, according to your screenshot, Send +{F4} should also select the item underlined.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, Bing [Bot], fefe128, Frosti, Google [Bot], InGearX, Morberis, smashmike, TAC109 and 51 guests