Page 1 of 1

Use Alexa or Google Nest to control your computer with AHK

Posted: 19 Mar 2021, 14:51
by tadamm
I found this cool skill called trigger cmd which then lets me run a AHK script to do pretty much anything i want on my computer.

1.You just download the exe to computer and the skill on the Alexa app.

2.Set up what you want to say to your Alexa to run a script

3. Code AHK to do what ever you want.



Download = https://www.triggercmd.com/en/


How To = https://www.youtube.com/watch?v=D6kXPRd8ZGQ

Re: Use Alexa or Google Nest to control your computer with AHK

Posted: 16 Apr 2021, 09:31
by that1ahkpro
Bro cool asf thank you so muchhh

the software is paid tho. is there a free alternative?

Re: Use Alexa or Google Nest to control your computer with AHK

Posted: 17 Apr 2021, 13:43
by BoBo

Re: Use Alexa or Google Nest to control your computer with AHK

Posted: 02 Aug 2022, 11:33
by BoBo
A little script snippet that acts as an interface for sending stuff (to be exactly the parameters of a :arrow: triggerCMD command (line)) to your PC for further processing.

The default delay after a "keypress" is 1 second. To set another delay use this parameter format <string>:<number> ie "AHK Rocks:1.2" where <number> is representing the delay in seconds. If your string is of this format c(<digit>) ie c(65) the script will convert this string into its ASCII-character equivalent.

So a space separated triggerCMD command could look like this:

autohotkey.exe sendKey.ahk {F2}:1.5 {F3}:5 {F3}:5 {F4} (will press/send the keys F2/F3/F3/F4 with its specified delays)

autohotkey.exe sendKey.ahk trigger:0 c(67):0 M:0 c(68):0 (will send the string 'triggerCMD' with the least possible delay)


sendKey.ahk

Code: Select all

#SingleInstance, Force
SetBatchLines, -1

Loop % A_Args.Count()												;loop for the number of parameters
   {  param := StrSplit(A_Args[A_Index],":")						;check if parameter contains a colon ('delay-flag'), if yes create an array
      p := InStr(A_Args[A_Index],":")  ? param.1 : A_Args[A_Index]	;get the 1st/string element of the array
      p := InStr(p,"c(")               ? Chr(SubStr(p,3,-1)) : p	;..but if that string is matching the ASCII-conversion format, convert it
      d := InStr(A_Args[A_Index],":")  ? param.2 : 1				;get the 2nd/delay element of the array
      Send  % p														;send the string/a keypress
      Sleep % d*1000												;wait for the specified time
   }