1 Reply Latest reply: Jul 14, 2012 6:40 PM by TeenTitan
chuckadile Level 1 Level 1

I am scheduling a task to run some maintenance scripts and then reboot. I would like to have a warning popup on the client giving them the option to cancel before restarting their computer.  If they didn't respond within a specified amount of time, the scripts would run and the computer would reboot.  Any suggestions?

Mac Pro, Mac OS X (10.7.3)
  • TeenTitan Level 4 Level 4

    Have you tried applescript? There a command line tool to trigure an applescript. You could use a command like.



        with timeout of 2 seconds

            tell application "Finder"

                set answer to display dialog "This computer is about to be rebooted" buttons {"Reboot", "Cancel Reboot"}

            end tell

        end timeout

    on error

        set answer to {button returned:"Cancel Reboot"}

    end try


    and then pipe the results into an if then command.