System Profiler Info

New at apple scirpt.
I looked at the dictionary, but…
Is there a way to set a variable with the info from the system profiler application.
System OS X v4.10

Hi and welcome,

yes, it’s possible, but it’s recommendable to use the shell to gather the data

set D to do shell script "system_profiler"

To filter some data, use

set D to do shell script "system_profiler -listDataTypes"

to list all possible datatypes, e.g. you get all network data with


set D to do shell script "system_profiler SPNetworkDataType"

Thank you.

That worked great. But, what doed the “do shell script” do.
:slight_smile:

do shell script is a bridge to the UNIX shell

In Terminal you type

system_profiler -listDataTypes

In AppleScript you do the same with

do shell script "system_profiler -listDataTypes"

the result of the operation will be returned to AppleScript

Thanks,
that makes sence.