Thanks for the update. I have gone through this process and made a few changes just wanted to add some more detail that may help others.
In the case of RapidHotkey library section, unless you need to activate a hotkey by repeatedly clicking a certain key, this part really isn’t necessary and removing it will make the process less complicated. My Goal was the hold Home key and press a # or Letter.
For example, in my script file, I used:
Home & 1::Run "c:\Program Files\mosquitto\mosquitto_pub.exe" -h 10.0.1.19 -t keyboard/loudesk/status -m 1 -P password -u user,,hide
It’s also possible to combine them for a full list of hotkeys using just one script file.
Example:
Home & 1::Run "c:\Program Files\mosquitto\mosquitto_pub.exe" -h 10.0.1.19 -t keyboard/loudesk/status -m 1 -P password -u user,,hide
Home & 2::Run "c:\Program Files\mosquitto\mosquitto_pub.exe" -h 10.0.1.19 -t keyboard/loudesk/status -m 2 -P password -u user,,hide
Home & 3::Run "c:\Program Files\mosquitto\mosquitto_pub.exe" -h 10.0.1.19 -t keyboard/loudesk/status -m 3 -P password -u user,,hide
In my automations, I also plan to set the status of the MQTT to Waiting upon completion, this way my automation triggers can be ‘if X changes from Waiting to 1’ etc, Otherwise if I use Home+1 to set a lighting scene at 8am, and then the next command I use is also Home+1, I don’ think it will trigger a “to” since it was already the same value. (This might not be needed, but I like the idea of in the least, if I’m trying to debug something, I can tell the difference between an old command, and watching one happen.)
Lastly, I copied the script file into a Dropbox folder, and then made a shortcut to it, and put it in the Start Menu \ Startup folder, so it auto runs. Just thought this might help someone else. The dropbox idea allows me to keep organized track of this function as it grows, but also so that if I choose to set up the same function on other PC’s in the house, I can make changes to the script on one of them, and have ithe others update upon next windows reboot.
Credit to both original OP and ikeays, This is incredible.