recently I started to use autohotkey and it is fantastic. Now I have a new idea and as a beginner would like your input on how to write it correctly:
My idea is as follows:
Code: Select all
;Test
#1::
InputBox, variable1, Reference, Please enter a reference range,,,,,,,,%variable1% ;e.g., "900-000"
InputBox, variable2, Counter, Please enter a counter start,,,,,,,, ;e.g., "3"
;MsgBox, %variable1%%variable2% ; e.g., "900-0003"
return
#2::
SendInput {Backspace} %variable1%%variable2% ; e.g., "900-0003"
variable2++
return
1. How do I pass the variables between the two macros? I cannot transfer the documentation for global variables (https://autohotkey.com/docs/Functions.htm#Global) to my example.
2. As shown above, I would like to populate the Inputbox with the current string stored for variable1 - do I need to error-proof this somehow if variable1 may be empty or is it just empty then?
2b. Would it be possible to store the selected string as variable1, if any string is selected when #1 is pressed?
I am grateful for your suggestions.