Mac Get List of Connected Keyboards¶
This will return a list like
Usage in a KM macro¶
KEYBOARDS=$(ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*')
if [[ $KEYBOARDS == *"Das Keyboard"* ]]; then
exit 0
else
exit 1
fi
Exit code of 1 can be used to cancel a macro.