UBS Device Trigger Firing Twice

Dear Keyboard Maestros,

I'm currently trying to achieve the following:
Macro 1: If USB device connects, open App X
Macro 2: If USB device detaches, close App X

Unfortunately, once I physically connect the USB device, KM recognises it twice, leading to Macro 1 being fired, Macro 2 being fired (and Macro 1 is, for some reason, not fired again) so that I end up with App X opening briefly and closing again.

The USB device is thereafter recognised correctly by KM (tested with another "if USB device detached" trigger).

Do you have any ideas on how to ignore the first/second firing of the macro in the above scenario so that the app only opens (and doesn't close again) once the USB device is connected?

Thanks!
Dwarfy

What does the Engine.log say when you connect the device? (Help ➤ Open Logs Folder).

Thanks for your reply, Peter. Here's the log file:

2019-04-09 15:58:43 Execute macro “Launch Duet when iPad connects” from trigger USB Device “iPad” is Attached
2019-04-09 15:58:43 Invalid Plug In Action with Name Choose Folder(s)
2019-04-09 15:58:43 Invalid Plug In Action with Name Choose Folder(s)
2019-04-09 15:58:43 Invalid Plug In Action with Name Choose Folder(s)
2019-04-09 15:58:43 Invalid Plug In Action with Name Choose Folder(s)
2019-04-09 15:58:43 Execute macro “Launch Duet when iPad connects” from trigger USB Device “iPad” is Attached
2019-04-09 15:58:44 Invalid Plug In Action with Name Choose Folder(s)
2019-04-09 15:58:44 Invalid Plug In Action with Name Choose Folder(s)
2019-04-09 15:58:44 Invalid Plug In Action with Name Choose Folder(s)
2019-04-09 15:58:44 Invalid Plug In Action with Name Choose Folder(s)
2019-04-09 15:58:50 Execute macro “Quit Duet when iPad disconnects” from trigger USB Device “iPad” is Detached
2019-04-09 15:58:51 Running application query took a while (3766 us)

"2019-04-09 15:58:44 Invalid Plug In Action with Name Choose Folder(s)" is probably an issue, right? What could that be?

Thank you very much
Dwarfy

It is unlikely to be related. It just means somewhere in your macros you have a macro that uses a plugin action "Choose Folder(s)" which you probably don't have installed. Just search your macros for "Choose Folder" and see where the action is and delete it - presumably you aren't using it or your would have noticed.

As to your other problem, check your “Launch Duet when iPad connects” macro. Make sure you have only one, and check that you only have one trigger on it.

Failing all of that, there are ways to enable debugging on the USB Device trigger system. It may simply be that when you connect the iPad via USB it is actually connecting two virtual devices, so you may need to try to be more explicit with the name of the device.