This does indeed not work for Firm/Hard Keys but does work with a Soft Button. I suspect the reason is because of the ways Firm/Hard keys for an activity are wired together.
However, I've found a way to make this work with zero issues but it does require a little bit of extra work. You have to put your actions into a Macro Category and instead of saying this.execute actions, you have to grab the CF.widget and then schedule or execute the widget.
Macro Category named "MikeG_Macros" with ProntoScript name "MIKEG_MACROS". Inside this category, add a Macro named "PS_FIRM3" with ProntoScript name "PS_FIRM3" For the PS_FIRM3 macro actions, add a sound such as 'error mono'.
In an Activity, Add the following script. System.setDebugMask(9); function doSomethingAndExecute () { // at the time doSomethingAndExecute is called, Javascript // 'this' will be the button widget you just pressed (firm1, firm2, firm3, etc) System.print("abc easy as 123 tag:" + this.tag); // Load the widget from reusable macros based on the current button's tag. // These can be executed or scheduled. var w = CF.widget(this.tag, "MIKEG_MACROS", "PS_MACROS"); if (w) w.scheduleActions(); }
As a convenience, you might want to define your normal Firm/Hard key actions to Link to a Component Macro as well. The same one you defined above.
Send me an email from an address where you can receive a zip and I will send the file I just tested. The solution is not necessarily pretty but something for you to ponder/expand on if you really want the desired behavior and the ability to assign onPress to be able to clear/set your globals as well as execute one-shot IR actions.