I’m looking for a solution to detect a (connected) iSight on several configurations.
The following script works on Tiger (PPC and Intel) and Panther (without iSight).
try
tell (do shell script "ioreg -l | grep iSight") to (it contains "Product Name" and it contains "iSight")
if result then
display dialog "iSight found" buttons {"OK"} default button 1
else
error
end if
on error
display dialog "No iSight found" buttons {"OK"} default button 1 with icon stop
end try
Unfortunately I can’t test it on Panther with connected iSight.
Can somebody test it for me, please.
Thanks (any better solutions are welcome)
Thanks Eelco, its funny, my question do refer to isightcapture and your mentioned thread
I’m going to write a GUI for isightcapture with AppleScript Studio (my very first ASS project ;))
with including capability to upload pictures via FTP to a server (e.g like a webcam).
I just want the app to refuse launching if no iSight is available
I’ve also continuing on developing this further in ASS. I was wondering whether you were moving along… Currently my app is working fine, it just needs lots of tweaking, especially in the UI. I was looking for a way to be independent of isightcapture but no luck so far. Any developments on your side?
Actually I have a working (beta) using all the scripting tricks mentioned in http://bbs.applescript.net/viewtopic.php?id=19538
but I don’t use it currently as my machine hardly leaves the house at the moment.
The UI issue has been resolved; it was more of a learning issue in AppleScript Studio
My app now detects changes in WAN IP, SSID and detects motion.
If you (or others) are interested in the code, send me a pm so I can email you my ASS project.
@Stefan:
Your code for detecting iSight didn’t work on all macs I tested. The following adaptation so far does but I haven’t tested it on macs with plug-in iSight:
try
set testCam to do shell script "ioreg -l | grep iSight"
if testCam contains "Product Name" then
--iSight present
else
--no iSight
end if
on error
--no iSight
end try