13 Replies Latest reply: Feb 27, 2012 11:41 PM by ChangeAgent
ChangeAgent Level 1 Level 1 (140 points)

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 item i of the process_list

                    if this_process is not in white_list then

                              tell application this_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