1 #!/bin/bash
2 ######################################################################
3 # Copyright (C) 2004. Kurt Schwehr
4 # Released under the GPL
5 #
6 # Small script to periodically grab frames from an iSight
7 # http://www.mulle-kybernetik.com/software/MulleSight/
8 #
9 # NOTE: this version is completely lacking in any error checking!
10 #
11 ######################################################################
12
13 # ChangeLog:
14 # 09/01/2005 Version 0.2: Added say if MulleSite stops
15
16 # First make sure MulleSight is running
17 open /Applications/MulleSight-1.0.9/MulleSight.app
18
19 sleep 2
20
21 declare -i fileNum=$3
22
23 result=0
24 echo "Starting..."
25 while [ "0" == $result ]; do
26 echo $fileNum
27 fileName=`printf "%05d.png" $fileNum`
28 osascript /Applications/MulleSight-1.0.9/MulleSightAsWebcam.applescript
29 if [ ! -f /tmp/picture.tiff ]; then
30 say "Help. Mulle Site not working"
31 fi
32 echo convert /tmp/picture.tiff $fileName
33 convert /tmp/picture.tiff $fileName
34 /bin/rm -f /tmp/picture.tiff
35 fileNum=$[fileNum+1]
36 sleep 1
37 done
syntax highlighted by Code2HTML, v. 0.9.1