trigger by text string instead of hotkey, also need help with input Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Msprg_non-logged

trigger by text string instead of hotkey, also need help with input

21 Feb 2018, 11:03

Hi,
i am newbie here, so i hope that you help me :)

okay, so i am trying to make script wich basics principe is:
wait until user will input hotword anywhere (not hotkey),
whe it happens replace text of that hotword by another and continue in program,
next in program is input to capture everything what is typed into var until (enter) is pressed,
then reuse that what user typed as parameter to run another app,
end, waiting for another hotword.

It is not hard but i can not get it work anyway, so here is my code so far:

::cmd-::Run in cmd:
Input, var, {enter}
run cmd /K %var%
return

Problems:

If the hotword string is replaced, program does not continue.
If i remove text to replace program continues, but it seem that on Input does not terminate input (enter) as term key does nothing, no matter what i type. :headwall:

Thank you for your suggestions.
TQu

Re: trigger by text string instead of hotkey, also need help with input

21 Feb 2018, 20:50

Code: Select all

::cmd-:: ; Run in cmd: 		<-- ";"
	Input, var,, {enter} ; 		<-- "comma"
	run cmd /K %var%
return
User avatar
RunarSF
Posts: 27
Joined: 01 Jul 2017, 11:48
Location: Norway
Contact:

Re: trigger by text string instead of hotkey, also need help with input  Topic is solved

21 Feb 2018, 22:48

Your problem was that you had assigned the string "Run in cmd:" to when you typed "cmd- ", the rest of the script won't run because you don't have a trigger for it. You also misplaced the end key for the Input, which would make it take input until you closed the script. Hope this helps! :)

Code: Select all

#SingleInstance, Force
:*:cmd-::
	SendInput, Run in cmd:
	Input, var,, {enter}
	run cmd.exe /k %var%
return
There are two kinds of people in the world: those who can extrapolate from incomplete data.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Rohwedder and 388 guests