In the screenshot below, it appears the letter g is underlined for the menu item we want to select, but it is not. How do we make the script select this?
How to select menu dropdown item that does not have a letter underlined Topic is solved
Re: How to select menu dropdown item that does not have a letter underlined
Code: Select all
WinMenuSelectItem, A, , Edit, Process, Foreground from error
Please excuse my spelling I am dyslexic.
Re: How to select menu dropdown item that does not have a letter underlined
Try WinMenuSelectItem. It looks like the following may work once you replace WinTitle with the actual title of your window:
However, it doesn't work with all menus, but try it and see.
Edit: @Capn Odin was too fast.
Code: Select all
WinMenuSelectItem, WinTitle,, Edit, Process, Foreground from error
Edit: @Capn Odin was too fast.

Re: How to select menu dropdown item that does not have a letter underlined
The first guy's code does not work. I'm about to test Boiler's.
Re: How to select menu dropdown item that does not have a letter underlined
His requires the window to be active. If it was active and it didn't work, then mine won't work either.
Re: How to select menu dropdown item that does not have a letter underlined
Correct, neither code is working.
Is it because SAP has a different kind of dropdown menu??
The window is active because the user manually highlights a line on the report immediately prior to hitting the hotkey.
Is it because SAP has a different kind of dropdown menu??
The window is active because the user manually highlights a line on the report immediately prior to hitting the hotkey.
Re: How to select menu dropdown item that does not have a letter underlined
Per the WinMenuSelectItem documentation:
This command will not work with applications that use non-standard menu bars. Examples include Microsoft Outlook and Outlook Express, which use disguised toolbars for their menu bars. In these cases, consider using ControlSend or PostMessage, which should be able to interact with some of these non-standard menu bars.
Re: How to select menu dropdown item that does not have a letter underlined
This is what I have as a first draft, and the only part that is not working is the Send, g line because the g is not really underlined as you can see in the screenshot above. I'm trying to read the Control and SendMessage documents but I'm struggling.
Code: Select all
#Numpad1::
Send, {F8}
Send, !e
Send, p
Send, g
return
Re: How to select menu dropdown item that does not have a letter underlined
You could also try using arrow keys like Left and Down to navigate where you otherwise can't, then you can probably select the item using Enter. See if you can do that manually, then just reproduce it in your script.
Re: How to select menu dropdown item that does not have a letter underlined
Like this?
Code: Select all
#Numpad1::
Send, {F8}
Send, !e
Send, Down
Send, Right
Send, Down
Send, Enter
return
Re: How to select menu dropdown item that does not have a letter underlined
You need { } around those:
You may also need some Sleep statements in between if it's not ready to accept each key that fast.
Code: Select all
#Numpad1::
Send, {F8}
Send, !e
Send, {Down}
Send, {Right}
Send, {Down}
Send, {Enter}
return
Re: How to select menu dropdown item that does not have a letter underlined
Test failed, but now i will add in the time delays and try again.
Also i'll read up on why the Alt+e does not require brackets lol
Also i'll read up on why the Alt+e does not require brackets lol
Re: How to select menu dropdown item that does not have a letter underlined Topic is solved
You should make sure that those exact keypresses work when you press them on your actual keyboard. If they do work just as you've shown, then it may be the Sleep. Try longer Sleep durations like 300 at first, then you can reduce them.
If none of that works, you can try using Click to click on the menu locations.
If none of that works, you can try using Click to click on the menu locations.
Re: How to select menu dropdown item that does not have a letter underlined
Hi paquirl, try this:
#Numpad1::sendinput !ep{Down}{Enter}return
If that doesn't work maybe using a sendmessage.
SendMessage, 0x111, %vkey%, 0, , %vTarget%
Replace %vkey% with the wParam its the control ID.
The 0x111 says its a Wm_command.
The %vTarget% is the windows Title.
These two links will get you scripts to get the control ID.
;AHK v1.1 x64/x32 compatible update by jeeswg of the script, by Micha, at:
;Get Info from Context Menu - Scripts and Functions - AutoHotkey Community
https://autohotkey.com/board/topic/19754-get-info-from-context-menu/
;by lexikos 07 Jun 2015, 22:52 Alt Menu Search
http://ahkscript.org/boards/viewtopic.php?f=6&t=8085
good luck, hunter99
#Numpad1::sendinput !ep{Down}{Enter}return
If that doesn't work maybe using a sendmessage.
SendMessage, 0x111, %vkey%, 0, , %vTarget%
Replace %vkey% with the wParam its the control ID.
The 0x111 says its a Wm_command.
The %vTarget% is the windows Title.
These two links will get you scripts to get the control ID.
;AHK v1.1 x64/x32 compatible update by jeeswg of the script, by Micha, at:
;Get Info from Context Menu - Scripts and Functions - AutoHotkey Community
https://autohotkey.com/board/topic/19754-get-info-from-context-menu/
;by lexikos 07 Jun 2015, 22:52 Alt Menu Search
http://ahkscript.org/boards/viewtopic.php?f=6&t=8085
good luck, hunter99
Re: How to select menu dropdown item that does not have a letter underlined
I increased the first sleep command to 750 because of the delay moving to next screen prior to the ALT+E. This script now works!
Who is online
Users browsing this forum: ashamefuldog, Bing [Bot], Freshman, martin536, TAC109 and 47 guests