I have a KM micro that runs a shell script that simply executes videosnap, which is a CLI tool to record webcam video on Mac.
The command works fine when run directly in Terminal, which asks for the Camera and Microphone permission before executing for the first time.
But when it's run through Keyboard Maestro, it fails with the log "Execute a Shell Script failed with script error: text-script: line 1: 95799 Abort trap: 6"
After searching around, I think the issue is that keyboard maestro doesn't ask for the Camera permission even though it's a requirement for the script to run. I checked the list of apps allowed in the Camera section of the "Security & Privacy" system setting, KM doesn't show up there and there's no way to add it manually. There doesn't seem to be a way to add it unless KM asks for it somehow.
This change was already released so it is in 9.2. So if the system is not adding Keyboard Maestro (or whatever else it needs to add to the preferences to allow the action), then I don't have any further solution to the problem I'm afraid. That would be a permission issue that Apple would need to resolve, or you would need to find a way to add Keyboard Maestro (or Keyboard Maestro Engine, or the script).
Although I just did double check and I only added the entitlement for the Keyboard Maestro Engine, so I have added it to Keyboard Maestro itself for the next version (which should be 9.x), maybe that will make a difference.
@kbmfan for me it works when I integrate the command in an AppleScript. The advantage is that no terminal window appears on the desktop when the KM macro is executed:
@kbmfan thank you for the tip with Videosnap.
I also installed ImageSnap to take snapshots when accessing my Mac's and autofill logins (1Password). Works great