Hello again,
how can I trigger an hotstring via an AutoHotkey GUI button, e. g. hotstring MyHotstring mhs#:
:*Raw:mhs#::This is my hotstring!
In more detail, that button should send mhs# which is then replaced by This is my hotstring!. Which Send-command must I use?
Many thanks and greetings
hotkeyguy
AutoHotkey GUI button: Trigger hotstring via the button Topic is solved
Re: AutoHotkey GUI button: Trigger hotstring via the button
Hi hotkeyguy, i don't know if i understand him well but... try this
A hotkey label can be used as the target of a Gosub or Goto
For example: Gosub ^!s.
Code: Select all
#NoEnv
#SingleInstance force
#Persistent
Gui, Font, S12 CBlue Bold, Verdana
Gui, Add, Text, x32 y10 w500 h40 +BackgroundTrans, Type "mhs#" o push button SEND
Gui, font,S8 Cred, Verdana
Gui, Add, Edit, x12 y40 w500 h20 vMyEdit
Gui, Add, Button , xp+130 yp+30 gClear , Clear EDIT
Gui, Add, Button , xp+120 yp Default gOK , SEND
Gui, Show
Clear:
GuiControl,, MyEdit,
GuiControl, Focus, MyEdit
Return
OK:
GuiControl, Focus, MyEdit
GoSub % ":*Raw:mhs#"
Return
:*Raw:mhs#::
Send This is my hotstring!
Return
For example: Gosub ^!s.
Donec Perficiam
Re: AutoHotkey GUI button: Trigger hotstring via the button Topic is solved
Hello jmeneses,
thanks for your hints. Haven't been aware that a hotkey/hotstring can be used as a label for the Gosub command.
I looked for a simpler solution and found the SendLevel command. I used just SendLevel 1 like the SendLevel example.
Greetings
hotkeyguy
thanks for your hints. Haven't been aware that a hotkey/hotstring can be used as a label for the Gosub command.
I looked for a simpler solution and found the SendLevel command. I used just SendLevel 1 like the SendLevel example.
Greetings
hotkeyguy
Re: AutoHotkey GUI button: Trigger hotstring via the button
Good hotkeyguy, better solution than mine
Donec Perficiam
Who is online
Users browsing this forum: Lamron750 and 234 guests