About a year ago, when talking about Keyboard Maestro and Catalina, @peternlewis said
Keyboard Maestro doesn’t ask for permissions for Location Services, Calendar, Reminders, Photos, Camera, Microphone or Full Disk Access, not unless you run some sort of script or action that accesses them (there are no native actions to access them currently, though there may be in the future).
I just tried to run a macro that calls the imagesnap
command. The macro consists of just one step, an Execute Shell Script with the following command:
imagesnap -d "FaceTime HD Camera (Built-in)" -q -w 1 $HOME/Desktop/$(date +"%F-%H-%M-%S").jpg
imagesnap
uses the Camera, but Keyboard Maestro doesn't ask me for permission. The macro fails with this error:
2020-09-17 21:29:12 Execute a Shell Script failed with script error: text-script: line 1:
46442 Abort trap: 6 imagesnap -d "FaceTime HD Camera (Built-in)" -q -w 1 $HOME/Desktop/$(date +"%F--%H-%M-%S").jpg.
Macro “Imagesnap” cancelled (while executing Execute Shell Script).
(I've added linebreaks to make it easier to read.)
The problem is not with my environment; I have ENV_PATH set to include /usr/local/bin
, where imagesnap
resides. The only thing I can think of is that this command works from the Terminal because Terminal has permission to use the camera, and it fails in Keyboard Maestro because KM doesn't.
I've run
tccutil reset Camera com.stairways.keyboardmaestro.engine
tccutil reset Camera com.stairways.keyboardmaestro.editor
with the hope that resetting the Camera permissions might get KM to ask. No dice.
Is there better answer, and is there anything I can do to get this macro working?