• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Apple System Profiler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple System Profiler


  • Subject: Re: Apple System Profiler
  • From: "Geoff Graham" <email@hidden>
  • Date: Fri, 8 Dec 2000 16:11:06 -0600

>At 1:23 PM -0800 12/8/00, Bill Tandy <email@hidden> and others wrote:



>What MacOS version are you using to get your script to pull individual
>pieces of information? With MacOS 8.6, I have just the opposite problem.
>I can make ASP make a text report but I can't get it to give me individual
>pieces of information. I am going to have to write scripts to parse the
>text report unless your script will work on MacOS 8.6 (or we'll have to
>upgrade to a higher MacOS).
>-Bill Tandy
>Austin, TX
>
>On 12/8/2000 1:52 PM Mike Tuller email@hidden wrote:
>
> >Inside the dictionary for Apple System Profiler there is
>>something for report text. It says that it will create a tab-delimited text
>>file of the information within ASP. How do you call on it to write the data
> >to a file?
>>
> >I have a script that will pull out individual pieces of information, but I
>>would prefer just to pull it all out in one shot with one command rather
>>than multiple commands.

The trouble seems to be that ASP is as flaky as mom's apple pie. What should work but doesn't is:
tell application "Apple System Profiler"
activate
make at beginning new report with properties {report contents:{all}}
set x to report text of the result
end tell
what i get is:
"
Software overview
Mac OS overview
Finder: 8.6
System: 8.6 US
Active enabler: None
At Ease: Not installed
QuickTime: 4.1.2
File sharing: is off
Note: No startup disk was selected.
"
So what I did was:
--script
set temppath to path to preferences
set temppath to "" & (temppath as string) & "asptemp.asp"
set repguts to {}
tell application "Apple System Profiler"
activate
set x to make new report at beginning with properties {report contents:system profile}
set end of repguts to (report text of x)
close x saving no
set x to make new report at beginning with properties {report contents:{devices and volumes}}
save x in file temppath -- bug workaround!
set tempref to open for access file temppath -- can't get report text
set temp to read tempref -- of devices and volumes
close access tempref -- so get it yourself
set end of repguts to temp
set x to make new report at beginning with properties {report contents:{extensions, control panels}}
set end of repguts to (report text of x)
close x saving no
set x to make new report at beginning with properties {report contents:{applications}}
set end of repguts to (report text of x)
close x saving no
quit
end tell
-- end script

one can write a parser for the text to put into FMPro fields, and let me tell you, it's hard work. (but fun)
i thought Richard23 had one that would pull single items out of ASP, but something was wrong with it at the time, and I couldn't read it, but it would be better than what's above if it worked.
geoff


  • Follow-Ups:
    • Re: Apple System Profiler
      • From: Mike Tuller <email@hidden>
  • Prev by Date: copying files
  • Next by Date: Re: Apple System Profiler
  • Previous by thread: Re: Apple System Profiler
  • Next by thread: Re: Apple System Profiler
  • Index(es):
    • Date
    • Thread