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 #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
id | text | Yes | The product name, vendor:product ids or serial number to look for. | |
match | one of | is contains | is (default) or contains. | |
transport | one of | usb | usb, the only choice. It can be left out. |
Examples #
- If the USB device “Apple” is connected
- Show “An Apple USB device is attached”
- Else
- Show “None found”
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
idwithcontainsmatches any attached device; withisit matches nothing.