Thank all of you for your help. I’ve found a way that will work for the time being. With the help from “Mach specific Subroutines / Functions grouped by purpose” from MachCustomizeWiki I used the following:
“Sub SetTriggerMacro (MacroNo as Integer)
Defines the number of a macro to be executed when an OEMTrigger is set (slightly unexpectedly on the Config>Set System Hotkeys dialog) to generate OEM code 301. This provides script execution without the requirement for a screen button as intermediary.
For example if SetTriggerMacro 456 has been executed then a signal on any OEMTrigger configured to 301 will run the code in the file M456.M1S when activated.”
I wrote a script with VB Script Editor and saved it as Msetup.m1s. When I first start Mach3 I run the script from VB Script Editor. The script reads “ SetTriggerMacro 35”. M35 is my test routine. As mentioned before I’ve set up an OMETrigger #1 with code 301. When I hit the switch associated with OEM Triggger # 1 the M35 code executes. It all needs some tweaking but I’m on the right tract.
One problem I see with this is that I can only run one script with code 301. If I wanted to run another from a different Trigger I’d have to run a different “SetTriggerMacro” before hitting the new switch because they are all called from code 301. I wonder if there is such a thing as 301-2, 301-3 etc. Or maybe there is “SetTriggerMacro#1,M---”, “SetTriggerMacro#2,M---”, Something to think about.
Tony