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: Stan Cleveland <email@hidden>
- Date: Tue, 27 Sep 2011 11:38:04 -0700
On Sep 27, 2011, at 11:13 AM, 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.
Thank you for your advice.
Hi Jim,
I beleive this works in Lion. Use the following command to get the data you need: set hardwareData to do shell script "system_profiler SPUSBDataType" Look for and parse this chunk of data: Built-in iSight: Product ID: 0x8502 Vendor ID: 0x05ac (Apple Inc.) Version: 1.60 Serial Number: 8J81X41xxxxxxxxx Speed: Up to 480 Mb/sec Manufacturer: Apple Inc. Location ID: 0xfd400000 / 3 Current Available (mA): 500 Current Required (mA): 500
Or even better, get the data as XML and parse that with System Events, XML Tools.osax, or XMLLib.osax: set hardwareData to do shell script "system_profiler -xml SPUSBDataType"
Stan C. -- "It's déjà vú all over again." -- Yogi Berra |
_______________________________________________
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