Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FU FU : Running OS X on AppleTV - method to query system profiler
#1
In follow up to: http://forums.macresource.com/read/1/490091/490377

System Profiler has a command line equivalent! system_profiler.

man system_profiler will give you all the gory details but here is the summary -

get list of hardware that system profiler can report -
system_profiler -listDataTypes

get just USB devices -
system_profiler SPUSBDataType

search for particular device (in this case, "Canon") -
system_profiler SPUSBDataType | grep Canon

AppleScript that reports whether or the not specified device is connected -

try
do shell script "system_profiler SPUSBDataType | grep Canon"
display dialog "you have it!"
on error
display dialog "you don't!"
end try

---

I'd still like to figure out how to get launchd to run a script as root. its my last task.
Reply


Messages In This Thread
FU FU : Running OS X on AppleTV - method to query system profiler - by mattkime - 05-09-2008, 12:57 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)