Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'OK, let's try this one more time...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
OK, let's try this one more time...
Authored by: ExecutiveEditor on Nov 28, '03 01:07:52PM
Check SMART Status.scpt.

Click the link above to open the script in Script Editor, save, and enter the following line into your crontab:

osascript "/path/to/file"

where /path/to/file is, obviously, the POSIX path to the Applescript.

[Corrected the script to ask Finder to display the dialog if there is an error--osascript can't display dialogs directly. Rob, if you want, delete the previous two comments and move this up. Sorry about that.]

[ Reply to This | # ]
OK, let's try this one more time...
Authored by: mcroft on Nov 29, '03 02:50:29AM
This version should discover your drives.

set disklist to do shell script "diskutil list | grep /dev/"

set EachDisk to words in disklist

repeat with CurrentDisk in EachDisk
	if CurrentDisk as text is not equal to "dev" then
			set status to do shell script "diskutil info " & CurrentDisk & " | grep SMART"
			if not (status is "   SMART Status:       Verified" or status is "   SMART Status:       Not Supported") then
				tell application "Finder"
					display dialog "A hardware problem has been detected on your hard drive:" & return & return & status
				end tell
			end if
		on error errStr
			tell application "Finder"
				display dialog errStr
			end tell
		end try
	end if
end repeat

[ Reply to This | # ]