Taking a vidio/photo

I’m trying to make a basic password gate. (Admit it, we all did at one time or another!) and I would like to have it take your picture if you get the pass word wrong. How do I do this? I tried simulating the “Take photo” command in Photo Booth but that dosen’t work.

Model: iMac
AppleScript: 2.1.1
Browser: Safari 417.9.3
Operating System: Mac OS X (10.4)

I’ve now got the termial thing wacaw for taking iSight pictures. Apparently. Hasn’t worked yet.