Type out your parameters
-
I can say:
- Alexa, ask TRIGGERcmd to run Type This with parameter I am the coolest
And my computer will type "I am the coolest" wherever my cursor happens to be.
Create c:\tools\typeit.vbs with these contents:
Dim Wsh Set Wsh = Wscript.CreateObject("Wscript.Shell") Set args = Wscript.Arguments For Each arg In args Wsh.SendKeys arg Wsh.SendKeys " " Next
Then create a command in TRIGGERcmd like this with parameters turned on:
wscript c:\tools\typeit.vbs
TRIGGERcmd runs your commands super fast, so if you're testing this on the computer where the agent is running and using the Parameters button on the website, you can add a 5 second pause at the beginning of the script with this command. That should give you enough time to click another window before it types your parameters in that window.
WScript.sleep 5000
-
@russ BIG HELP!
-
Hi Russ,
I'm trying to improve the dictation that I've been using via this parameter. Things that I run into often is my Google Home will only listen to me for a sentence or two and I struggle with punctuation.
How can I code for Google to listen longer and to enter in punctuation? Commas work! But not periods, hyphens, colons, etc. I've played with sendkeys to navigate software in the past with success. Another feature I'm trying to accomplish is a new paragraph.
Thanks in advance.
-
@EL-Dirtbag, I'm actually surprised you can use this to type more than a short sentence. I think Google Assistant has a timeout of only a few seconds. That said, you could have your script type two enter keys at the end (or beginning), so each time you invoke the script via TRIGGERcmd, it would create a new paragraph.
-
Any solution for him to select the YouTube search bar automatically and do the search right after it?
-
@Chabetico, you can actually search Youtube with a command like this:
start https://www.youtube.com/results?search_query=triggercmd
Do you want to be able to search youtube for the parameter you send to the command via TRIGGERcmd? If so, you could make a d:\tools\SearchYoutube.bat with these contents:
start https://www.youtube.com/results?search_query=%1
Then make your command like this, and remember to enable parameters.
-
@Russ
Hi, how can I pass arguments to triggercmd, that are actually a string and get interpreted as multiple commands?I have a script, that triggers a backup script and the parameter is the server name.
For example the server name is "sapp30".
So I want to ask "Alexa, make a backup of sapp30"What triggercmd is receiving from alexa is
"Trigger sent from Alexa params = sap p 30" -
@it_ibsolution.de
Wenn du die Frage im Autohotkey-Forum noch mal stellst, sollte das recht einfach zu lösen sein.voice: "Alexa, make a backup of S A P thirty"
command: "Autohotkey.exe myScript.ahk sap p 30" -
@aaaaa12345
Autohotkey sagt mir leider nichts.
Alle über Triggercmd aufgerufenen Scripte sind Powershell.
Normalerweise könnte ich die Parameter im script einfach wieder zusammensetzen.
Je nach Name des Servers werden aber eine unterschiedliche Anzahl von Parametern "erkannt". -
@it_ibsolution.de
Du kannst dein script ja so auslegen, das es eine statische Anzahl an Parametern gibt, wobei diese, bei "Nichtverwendung" gegebenenfalls mit einem Platzhalter/dummy bestückt werden.
Bei der anschließenden Auswertung im Script wären diese dann als "ungenutzt" markierten Parameter schlicht zu ignorieren. Oder ...
du flagst jeden Parameter explizit wie (AFAIK) unter Linux üblich mit einem Bezeichner:
"--drive C:" "--command defrag" "-time 20220916180000"
...und wertest dementsprechend aus.AutoHotkey ist eine (open source) Scriptsprache, welche über die von Powershell bereitgestellten systemnahen Funktionen auch events auf application/desktop level steuern kann. Mehr dazu gibt es in den einschlägigen Fachzeitschriften wie der c´t, oder unter autohotkey.com
Natürlich lässt sich auch PowerShell damit kombinieren.HTH