Notes from Sand Hill


Logo

XTension Tech Notes

Sandhill Crane


ID: TN.QuickCam
Subject: Using the QuickCam with XTension
Date:4/2/97
Applicability:All versions of XTension after 1.0
Contributor:Michael


If you have a Mac with two serial ports, you can easily connect the 
Connectix QuickCam to one of them and control it from XTension.  
If you have a local network, the camera can be on a Mac which is
remote to the Mac running XTension.  With XTension, you can control
any number of cameras.

Any number of uses can be imagined, however you could start with:
  simple burglar pics
  watch your plants grow
  who came to your door ?
  babysitter monitor
  party pictures
  website images

The following example is simple.  It requires a QuickCam on one Mac,
XTension running on another Mac, and that we have AppleTalk between them.

In the simplest case, we want to take a picture whenever the motion
sensor in the living room indicates movement.  Obviously you might want 
to add some conditional logic which would prevent the snapshot when
it was reasonable for someone to be in the area.

We will assume that QuickPict is already running, as it would create a
delay having to start it up, and we do want to be as prompt as possible.  
Also, for this example, we need to have  Clip2Gif running in order to save
the snapshot to disk as a GIF or JPEG file.

Clip2Gif is a freeware app, and is available at: Yves Piguet's site

The following script should be modified for your own location, but it is a
good example from a working system:

------------------------------
--the LoginID portion of this script may not be necessary,
--  it is supposed to circumvent the problem of 'signing on'

set RemoteMachine to "LR Mac"
set RemoteZone to "My Zone"
set RemoteFinder to a reference to application "Finder" of machine
	RemoteMachine of zone RemoteZone
set RemoteDisk to "thatDisk"
set LoginID to login as "Michael" password ""

tell application "QuickPICT" of machine RemoteMachine
	copy
end tell

set xFileTime to (time of (current date))
set xFileName to (RemoteDisk & ":Desktop Folder:LRmotion" & xFileTime)

tell application "clip2gif" of machine remoteMachine
	activate
	save clipboard as GIF in a reference to file xFileName
end tell

write log "Snapshot taken in living room as : LRmotion" & xFileTime

------------------------------

Of course you need to change some names, and the script editor will
let you know which ones!  But this script will also write an entry to 
the log regarding the event and the name of the file saved.

This is a simple example, and surely there is a way to do this generically,
so that this could be a 'subroutine' which could be called from any of the
sensors which were associated with cameras.  Unless you have dozens,
it is probably just as  simple to copy this script and change the machine
and sensor names accordingly.

It is even possible that you can get some of the other QuickPict script
verbs to work for you.  And of course, there are other camera types and
other capture programs which can be scripted in this same way.

Consider here that there is a delay between the sensor trigger, and the
actual picture capture time.  You should perform an operational test for 
each sensor more than once.  You may want to delay a period of time, or
you may want to take a sequence of frames rather than a single clip.


Additional help is available on our website: www.shed.com
Or directly to Michael and Paul Ferguson at: 407-349-5960
Or mail to Sand Hill Engineering Inc. Box 517 Geneva FL 32732
All icons, graphics and text copyright ¨1997 Sand Hill Engineering Inc.