View Power On Self-Test results via AppleScript

Apr 25, '06 07:30:00AM

Contributed by: mattcomi

After my lower memory slot failed, it took me quite some time to realize it. While the Mac does a Power On Self-Test of certain hardware, it gave me no notification that this slot had failed. It is possible to get to a report in System Profiler, but only if you launch the application and check it.

There is a command-line version of the System Profiler application called system_profiler. This utility takes optional data types as parameters, such as the the SPDiagnosticsDataType. I put this utility in a super-short Apple Script:

set post to do shell script¬
"/usr/sbin/system_profiler SPDiagnosticsDataType"

if post does not contain "Result: Passed" then
  display dialog post buttons {"OK"} with title "Error"¬
  with icon stop
end if
I then set this Apple Script as a Login Item and if everything goes well, I'll never see it. However, if the phrase 'Result: Passed' does not appear in the Power On Self-Test, a dialog will appear indicating what went wrong.

I've packaged the Apple Script into an app that can be downloaded from here

Please note that you will only see a dialog if the Power On Self-Test fails, so don't be surprised if nothing happens.

[kirkmc adds: The Power On Self-Test is described here. It is supposed to beep from one to five times, according to the type of anomaly it discovers. However, the poster pointed out that since he had RAM in both slots, the test did not beep for him. In most cases, therefore, the test should work as intended, but if you do have RAM in more than one slot, and it does not work, this script can help you find a (rare) problem. Note that you can also just run the command in Terminal should you be worried: system_profiler SPDiagnosticsDataType]

Comments (24)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2006041909392091