Select menu item...How do I specify a Window?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
whitebalance
Posts: 1
Joined: 11 Jan 2021, 19:40

Select menu item...How do I specify a Window?

11 Jan 2021, 19:50

Hello,

I've tried every combination I can think of under this menu selection script help:

https://www.autohotkey.com/docs/commands/WinMenuSelectItem.htm

This is the window I'm trying to select menu items from:
image.png
image.png (366.86 KiB) Viewed 1422 times

This is the "Active Window Info":
image (1).png
image (1).png (369.59 KiB) Viewed 1422 times
Here is the script header:

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance,Force ;Only launch 1 instance of this script
#Persistent ;Will keep it running...
;  Alt key is !  the Windows key is # , the Shift key is + , and Control key is ^
return ;stop going forward (I tried it with and without this line)
Here are my attempts:

I also tried all of these with another menu item: "Mark, Mark In" Because I noticed the "new" would turn blue after I typed it.

Code: Select all

^p::
WinMenuSelectItem, DaVinci Resolve by Blackmagic Design - 17.0.0, , File, New Project
return  
^p::
WinMenuSelectItem, ahk_class Qt5QWindowIcon, , File, New Project
return

^p::
WinMenuSelectItem, WinActivate %davinci%, , Mark, Mark In
return

^p::
WinMenuSelectItem, ahk_exe Resolve.exe, , File, New Project
return

^p::
WinMenuSelectItem, DaVinci Resolve by Blackmagic Design - 17.0.0, , 1&, 2&
return

^p::
WinMenuSelectItem, WinTitle DaVinci Resolve by Blackmagic Design - 17.0.0, , 1&, 2&
return
[Mod edit: [code][/code] tags added.]

I did like another 40 variations.  Nothing seems to get Control P to select a menu item in DaVinci Resolve's Primary Window.  The window is also called:  Generic PnP Monitor 1.

I tried using this to find the Window ID:

Each window or control has a unique ID, also known as a HWND (short for handle to window). This ID can be used to identify the window or control even if its title changes. The ID of a window is typically retrieved via WinExist() or WinGet. The ID of a control is typically retrieved via ControlGet Hwnd, MouseGetPos, or DllCall(). Also, ahk_id will operate on controls even if they are hidden; that is, the setting of DetectHiddenWindows does not matter for controls. 
Don't know what to put between () to get the line to work

I'm assuming window class won't work, because I have a two monitor set up with two identical monitors.

What Am I missing?  
JackbobEvolved
Posts: 4
Joined: 06 Jan 2021, 17:44

Re: Select menu item...How do I specify a Window?

25 Jan 2021, 21:03

I’m also trying to figure out how to access the menus in Resolve via AHK. When I checked WinSpy in 16.2.8 it didn’t show anything for the menus.
thomastthai
Posts: 18
Joined: 12 Mar 2020, 01:51

Re: Select menu item...How do I specify a Window?

12 Feb 2021, 18:47

I don't think Resolve uses standard "Windows" interface.
dobbelina
Posts: 39
Joined: 03 Sep 2019, 02:45
Contact:

Re: Select menu item...How do I specify a Window?

12 Feb 2021, 19:12

Can't you reach it with the Alt key?

Code: Select all

^p::
WinActivate, DaVinci Resolve by Blackmagic Design - 17.0.0
WinWaitActive, DaVinci Resolve by Blackmagic Design - 17.0.0
Send !f
return  
User avatar
boiler
Posts: 16951
Joined: 21 Dec 2014, 02:44

Re: Select menu item...How do I specify a Window?

12 Feb 2021, 19:21

dobbelina wrote: Can't you reach it with the Alt key?
No, its menus are not activated or selectable via the Alt key. Some specific menu items, but not all, have keyboard shortcuts associated with them.
thomastthai
Posts: 18
Joined: 12 Mar 2020, 01:51

Re: Select menu item...How do I specify a Window?

12 Feb 2021, 19:42

One solution would be to use the library GraphicSearch to look for the "image" of the menus. Then use mouse commands to move the pointer and click as appropriate.

https://chunjee.github.io/graphicsearch.ahk/#/
User avatar
boiler
Posts: 16951
Joined: 21 Dec 2014, 02:44

Re: Select menu item...How do I specify a Window?

12 Feb 2021, 20:13

You could also use the built-in AHK command ImageSearch to implement that approach.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: alawsareps, mebelantikjaya, mikeyww, RussF and 307 guests