Friendly wrote:
This is what I have so far. The problem with this is that it sends "Line" instead of 'L':
Correct. The variable
A_ThisMenuItem contains the full text of the menu item choosen.
So if you want to get only the letter
L from the menu
Line you must extract the first letter from the var or create several subroutines, as
keybored suggest in his post, to do the work for you. So said, if you only want to paste the first letter of the menu item clicked you can try this:
Code:
Menu, dsc, Add, First Item, mymenu
Menu, dsc, Add, Line, mymenu
Menu, dsc, Add, Example, mymenu
Menu, dsc, Add, Another, mymenu
Menu, dsc, Add, The Last, mymenu
Return
XButton1::
Menu, dsc, Show
Return
mymenu:
sleep 100
Send, % SubStr(A_ThisMenuItem,1,1) "{Enter}"
Return