Browse the docs

USB device connected

Passes when a USB device with a given name, vendor and product id or serial number is plugged in.

Device id is connected

Keyboard Maestro: USB Device (Exists, Does Not Exist)

Details #

Looks through the USB devices that are attached right now. Each device answers to up to three names: its product name, its vendor:product ids as four hex digits each (for example 05ac:024f), and its serial number. The condition passes when id matches any of those.

match is is (default) for the whole name, ignoring case, or contains for a part of it. The trace shows the id and how many devices were attached. Reading the USB bus is harmless, so it happens for real in a dry run too.

Every condition accepts "negate": true, which flips the verdict. The trace records what was compared before the flip, so a negated condition that blocks a macro still shows the real values.

Conditions in an Only if list combine with all: every one must pass, and an empty list always passes. An if step or a repeat loop takes a match of all (default) or any.

Parameters #

ParameterTypeRequiredValuesWhat it does
idtextYesThe product name, vendor:product ids or serial number to look for.
matchone ofis containsis (default) or contains.
transportone ofusbusb, the only choice. It can be left out.

Examples #

Is any Apple USB device plugged in
Do
  1. If the USB device “Apple” is connected
  2. Show “An Apple USB device is attached”
  3. Else
  4. Show “None found”
Open in Switchboard to try it

Gotchas #

  • Bluetooth devices aren't USB devices and aren't found here. A hub or a dock shows up as its own device.

  • Product names are whatever the device reports, so check System Information for the exact spelling, or use contains.

  • An empty id with contains matches any attached device; with is it matches nothing.

See also #