Re: Telling if a Mac is equipped with a built-in iSight
Re: Telling if a Mac is equipped with a built-in iSight
- Subject: Re: Telling if a Mac is equipped with a built-in iSight
- From: Christopher Stone <email@hidden>
- Date: Tue, 27 Sep 2011 18:22:09 -0500
On Sep 27, 2011, at 13:13, Jim Thorton wrote: Umm... I wonder if AppleScript is robust enough to tell us if a computer is equipped with a built-in iSight camera? I have one app that utilizes a built-in iSight camera. So it has to see at first if the computer is equipped with one And it uses ioreg (Shell). If the computer is running Snow Leopard, ioreg will have a line like the following.
Built-in iSight@fd110000
Well, I was naive. I just happened to notice that ioreg doesn't report this line under Lion. So I need a different approach in telling if the computer is equipped with a built-in iSight.
______________________________________________________________________
Hey Jim,
Hmm. Curious.
My MacBook Pro running Lion returns such a datum using ioreg:
chris$ ioreg | egrep -i "isight" | | | +-o Built-in iSight@fd110000 <class IOUSBDevice, id 0x10000027f, registered, matched, active, busy 0 (89 ms), retain 10> | | | +-o Built-in iSight@0 <class IOUSBInterface, id 0x100000283, registered, matched, active, busy 0 (8 ms), retain 6>
Here's a quick way to parse out the iSight record using the system profiler as others have suggested:
set cmd to "system_profiler SPUSBDataType | sed -n '/Built-in iSight/,/Current Required/p'" & ¬ "| sed -E 's/^[ ]+//'" set iSightReco to do shell script cmd
-- Best Regards, Chris
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden