| View previous topic :: View next topic |
| Author |
Message |
Jon
Joined: 28 Apr 2004 Posts: 373
|
Posted: Thu Jul 01, 2004 12:27 am Post subject: Filling a menu in a loop |
|
|
Hi, I am trying to get the "clipboard manager" I made before to work with the menu that that is now built into autohotkey so that it will work on more operating systems and the size of text you set in display properties doesn't affect it.
One thing I have got stuck with is if you fill up a menu in a loop, is there any way to tell which button was clicked? Or getting the name of the button that was clicked?
e.g.
| Code: |
Loop, %word_array0%
{
StringTrimLeft, word_array, word_array%a_index%, 0
menu, MenuSelection, Add, %word_array%, Label
}
|
I was thinking of something like having a variable that would be equal to 1 if the first button was pressed etc.
Thanks, Acsell |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10465
|
Posted: Thu Jul 01, 2004 2:27 am Post subject: |
|
|
| The built-in variables A_ThisMenuItem and A_ThisMenu contain the names of the menu item most recently selected, and the menu from which it was selected (TRAY in many cases). Hopefully that will be enough to do what you need. |
|
| Back to top |
|
 |
Jon
Joined: 28 Apr 2004 Posts: 373
|
Posted: Thu Jul 01, 2004 5:06 pm Post subject: |
|
|
| That's great, thanks. I forgot about those variables. |
|
| Back to top |
|
 |
|