AppleScript Application to restart/shutdown after timer

Sometimes I have my Mac doing something that will take awhile, and I want to shutdown after. As an example, if I know the job requires around 30 minutes, I can use this app to set it to shutdown in 45 minutes, giving it some leeway.

I wrote this application because I don’t want to go into System Preferences to modify the schedule since it’s a one time thing.
It will ask when first run, for how long to set the timer in minutes. Then it creates a Status Bar menu item with the time left. The menu has a ‘Quit’ item to cancel the timer, and it shows whether it is scheduled to do a Shutdown or Restart.


Restart (72.3 KB)

Thanks for sharing, but I get an error from Apple.

You either have to open it holding down the control key,
Or open it in your script editor and re-save it so it gets signed

I went with opening in Script Debugger and saving as a compiled script as well as an Apple app. What a nifty piece of software, I can see myself using this in many situations. Again, thanks for sharing :+1:

It will only work as an application! Also if you re-save it, it might lose the edits in the info.plist file that make it a faceless app

I made an updated version that cleans up some of the timer code. It also now won’t respond to the keyboard “⌘Q”. You can only quit it by going to the status menu.

Restart (72.7 KB)

** EDIT ** fixed a bug, had originally left in some debug code

I made another version that will now wake the computer just before shutdown/restart so it doesn’t error.
To do so it has to first ask for and save an administrator account credentials to use with ‘do shell script’ to run as administrator to wake.
It will ask for username and ask for the password twice and then compare to make sure they are the same.


Restart (92.9 KB)