I have an script that makes some operations after pressing a hotkey and obtains an array (named Array) with several numerical values. (For example, Array=[2.5,3.3,5.7]
I want the script to create a hotkey for ^1 that sends 2.5 to the screen, ^2 sends 3.3 to the screen, and ^3 sends 5.7 to the screen. Remember, when pressing a particular hotkey (^q in my case), some calculations are performed and the values in the array change. The array can change in values and in size (but they are always numerical).
I have tried something like this (and many variations:
Code: Select all
^q:: ; the hotkey that performs the calculations...blah blah blah It creates an array with, for example,
; the values [2.4,5.6,8.4]
...
loop % Array.Length() {
Hotterkey:=A_Index
Hotkey, ^%Hotterkey%, etiqueta
}
MsgBox, Testing ; Thiis stops the script so I can test the new hotkeys at this moment. Would like to remove it eventually.
return
etiqueta:
SendInput, % Array[Hotterkey]
return
I have tried to use looploop {
Hotkey, !%x%, etiqueta
x++
} until x>Array.Length() , for For index, value in array
Hotkey, !%index%, etiqueta, while... tried to use A_Index outside the loop instead of hotterkey, tried to assign the value of A_Index to variables but they don't seem to be transferred to the label etiqueta. Of course, A_Index does not work in the label etiqueta.
Can you help me? I think I must be close, but can't find the solution.