applescript to quit or force quit hanging programmes.
I have a Mac Mini that I use as a home server. I have the basic energy saver scheduler turned on, but sometimes a application is hanging and as such preventing a shut down.
I want to schedule a force quit of every application that is hanging. I would have this run from cron a few minutes before the shut down. Or even have cron shut down at that point.
I thought I start gently by Quitting all open applications with this.
tell application "System Events" to set the visible of every process to true
set white_list to {"Finder"}
try
tell application "Finder"
set process_list to the name of every process whose visible is true
end tell
repeat with i from 1 to (number of items in process_list)
set this_process to itemi of the process_list
if this_process is not in white_list then
tell applicationthis_process
quit
end tell
end if
end repeat
How can I add a bit that would kill any other applications so that when the energy saving panel comes to shutting down, it can.
MBP, MM, MBP - 10.6 + Windooz XP on a hard partition