This is a start. Save it as an application with "Keep Open" checked and I think it will work.
Be aware there are probably other ways to get this to happen, including the XServe monitoring tools or crontab or what-have-you...
property lowSpaceDefault : 20 --percent property emailAddress : missing value property checkInterval : 5 * 60 --5 minutes property checkTime : (current date) + checkInterval global watchList, lowSpace
--Check all the disks in the list every checkInterval minutes on idle if (current date) > checkTime then set checkTime to (current date) + checkInterval repeat with thisDisk in watchList tell application "Finder" set currentDiskFreePercentage to (free space of disk thisDisk) / (capacity of disk thisDisk) * 100 set currentDiskFreePercentage to round currentDiskFreePercentage if currentDiskFreePercentage < lowSpace then do shell script "echo 'The drive is down to " & currentDiskFreePercentage & "% free space!' | mail -s 'WARNING: Low Space on drive " & thisDisk & "' '" & emailAddress & "'" end if end tell end repeat end if end idle
on run if emailAddress = missing value then set emailAddress to text returned of (display dialog "Enter the email address to inform if space runs low:" default answer "") end if set lowSpace to text returned of (display dialog "Display the percentage of space left at which you wish to receive an email:" default answer lowSpaceDefault) tell application "Finder" set diskList to name of every disk set watchList to choose from list diskList with prompt "Select the disk(s) you wish to watch:" default items {} with multiple selections allowed end tell idle end run
On Jan 28, 2009, at 1:57 PM, John Wiedenheft wrote: I work in an 10.5 environment where the hard disks fill up very fast (video post-production). I'd like to find a way that each editing computer (MacPro) can email the needed people that such and such hard disk is only 20% empty. Is there a way to do this through AppleScript? I'd like to apply this to three computers, one running OS 10.5 Server and the other two running OS 10.5. The MacPros running 10.5 have three HDs each that I'd like to keep track of.
-- (MCA Plus was Morgan-Cain & Associates / morgan-cain.com)
|