Re: Basic: scripting OS X System Profiler
Re: Basic: scripting OS X System Profiler
- Subject: Re: Basic: scripting OS X System Profiler
- From: Andrew Oliver <email@hidden>
- Date: Wed, 10 Mar 2004 10:52:19 -0800
The dictionary, while not always 100% correct, is the basic mechanism for
finding out what commands any given application supports.
In the case of System Profiler, you're right - there's little beyond the
bare minimum.
Once you do get the hardware profile, it isn't hard to parse the file
looking for the specific entry you're looking for. However, there are often
more direct ways of getting specific information (which may be why the
engineers didn't build more robust AppleScript support).
For example, to find the AppleMesh.kext version, you can:
set AppleMeshkext to ((path to library folder from system domain) as string)
& "Extensions:AppleMesh.kext"
set fileInfo to info for file AppleMeshkext
set fileVersion to short version of fileInfo
(watch for line breaks)
Andrew
:)
On 3/10/04 10:12 AM, "Chap Harrison" <email@hidden> wrote:
>
I am still confused about figuring out what can be scripted in a given
>
application .
>
>
I want to script the System Profiler in OS X 10.3. So I opened its
>
dictionary in Script Editor. Aside from the Standard Suite and the
>
Text Suite, which didn't have anything specific to System Profiler,
>
there was System Profiler suite. Within its two classes were a couple
>
of properties named 'profile' and 'system profiler'.
>
>
That's it. I did a script to "get system profile" and it gave me the
>
hardware overview.
>
>
So I'm thinking - is that it? Are there any other nouns? What if I
>
want to obtain the "Get Info String" for the AppleMesh kernel
>
extension? Network details? What if I want all the information that the
>
System Profiler could possibly give me?
>
>
Maybe there's nothing useful the SysProf can give me via AppleEvents.
>
If that's the case, fine - I'll know to rely on the dictionary as the
>
authoritative source for what you can or cannot tell an application....
>
>
Thanks -- Chap
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.