X

Make a workaround to avoid time-outs at shutdown in OS X

If OS X continually halts shutdown because an application has not quit in time, you can get around it with a custom Automator workflow.

Topher Kessler MacFixIt Editor
Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.
Topher Kessler
3 min read

When you shut down OS X, the system will first attempt to quit all open applications smoothly and then proceed with the shutdown; however, if a program takes too long to quit, then it may halt the shutdown process and issue a warning that the program has prevented the system from shutting down. While this usually just requires you to quit the program manually and save your data, at times it can be frustrating to deal with, especially if some programs simply take a while to quit.

MacFixIt reader Frida recently wrote in with such a problem:

Several applications, particularly Creative Suite components take longer to quit than the shutdown time-out requires. By the time the message displays that "Your computer didn't shut down because xxx didn't quit," that application has quit. I have to click shutdown again, and once again another Adobe app doesn't quit in time. I see this behavior on 3 systems, two running 10.4.11 and another running 10.6.9. Is there a way to lengthen the time-out so I can actually walk away from my computer?

This problem may happen more with older systems that are used for computationally demanding and high-resource-using tasks, or those that need to wait for external conditions such as peripheral devices to be ready, or a network communication to be managed.

Unfortunately there is no easy way to adjust the time-out period that OS X uses before canceling any log-off or shutdown event, so if you find yourself in this situation, then you can use Apple's Automator utility to create a service to use instead of the default Shutdown command in the Apple menu, which will first quit all applications and then wait a short period so your applications will quit, before shutting the system down. To do this, open Automator and then follow these steps:

Automator workflow to shut down system after a delay
These two options offer you some flexibility in how long the workflow will wait before shutting down, and whether or not it will ask to save any unsaved changes to applications (click for larger view). Screenshot by Topher Kessler/CNET
  1. Create a new Service workflow and set the service to receive "No Input" in "Any Application" (done using the menus at the top of the workflow).
  2. Drag the Quit All Applications action and then the Pause action to the workflow so they are sequential. Set the Pause action to the number of seconds or minutes you would like to ensure that all programs quit before the workflow continues.
  3. Now drag the Run AppleScript action to be the final one in the workflow, and replace the "(* Your script goes here *)" text with the following script that will instruct the system to shut down:

    tell application "System Events"
         shut down
    end tell


    (NOTE: While you can instead use a shell script to run the command "shutdown -h now," this approach is not the cleanest way to exit programs and may result in problems with programs saving documents and settings when the system shuts off.)

When finished, save the workflow with a name such as "Delayed Shutdown" and it will be available in the Services submenu of the Apple menu. You can also go to the Keyboard system preferences and locate the new service in the Services section of the Keyboard Shortcuts tab, where you can assign the service a custom hot key so you can invoke the shutdown from a key press instead of having to use the Apple menu.



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.