- TimeMachine_Backup_Then_Sleep.scpt >> TimeMachine_Backup_Then_Sleep.app
- TimeMachine_Backup_Then_ShutDown.scpt >> TimeMachine_Backup_Then_ShutDown.app
When and only when I want to I do a TimeMachine Backup I run one of these programs at the end of the day and I head for bed. It's so nice!
I use QuickSilver, so it's a couple of keystrokes and it's running. I then dim my screen until it's black.
I like to leave the keyboard partially lit so I know if the laptop is indeed on or not.
The scripts source:
- do shell script "/bin/bash -c '/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper > /dev/null 2>&1 &'"
repeat
delay 5
if not IsProcRunning("backupd") then
ignoring application responses
tell application "Finder" to sleep
end ignoring
exit repeat
end if
end repeat
on IsProcRunning(theProc)
try
do shell script "ps auxc | grep \"" & theProc & "\""
return true
on error
return false
end try
end IsProcRunning - do shell script "/bin/bash -c '/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper > /dev/null 2>&1 &'"
repeat
delay 5
if not IsProcRunning("backupd") then
ignoring application responses
tell application "Finder" to shut down
end ignoring
exit repeat
end if
end repeat
on IsProcRunning(theProc)
try
do shell script "ps auxc | grep \"" & theProc & "\""
return true
on error
return false
end try
end IsProcRunning
An open "Thank You!" to all you Apple-Scripters out there who have posted code to contribute to my learning. I return the favor by posting my source code for open use.
And that's a wrap!