There are several ways to do somthing similar to what you are describing. Here are some examples (in order of increasing complexity).
Code: Select all
; Using GoSub
; https://autohotkey.com/docs/commands/Gosub.htm
MsgBox, Starting...
gosub, SendLabel
MsgBox, Done.
ExitApp
SendLabel:
Send, {F1}{F3}
return
Code: Select all
; Using a function
; https://autohotkey.com/docs/Functions.htm#intro
MsgBox, Starting...
SendLabel("{F1}", "{F3}")
MsgBox, Done.
ExitApp
SendLabel(Key1, Key2)
{
Send, % Key1 Key2
return
}
Code: Select all
; Using a func object
; https://autohotkey.com/docs/objects/Functor.htm
MsgBox, Starting...
MyFunc := Func("SendLabel").Bind("{F1}", "{F3}") ; Store a functin object and bind two parameters ("{F1}" and "{F3}")
MyFunc.Call() ; Call the bound func object
MsgBox, Done.
ExitApp
SendLabel(Key1, Key2)
{
Send, % Key1 Key2
return
}