Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created an AppleScript to restart my Mac:

tell application "System Events"
end tell

I put this script into and set it to start at 7.00. When I put script into calendar and click done button it will restart my OS over and over again. It's like the Mac is restoring the system to the pre-shutdown state, including re-launching any applications that were open at the time.

How can I stop it?

share|improve this question

Try starting up in single user mode by holding command-S on startup, running mount -uw / (fsck -fy is probably not needed), and removing these files:

rm /Users/username/Library/Preferences/ByHost/*.plist
rm -r /Users/yourusername/Library/Saved\ Application\ State
share|improve this answer
Hi ,I don t know how exacly I can remove these files? Could you be more specific like? Should I type it in terminal or .... ? thx for any replie – Macko Oct 15 '13 at 15:20


Like @Lri said

Step 1) Start up in single user mode

Hold down Command-S when your computer is starting up. You will be presented with a command line.

Step 2) Type in these 2 lines

rm /Users/username/Library/Preferences/ByHost/*.plist

press enter

rm -r /Users/yourusername/Library/Saved\ Application\ State

Hopefully, this should stop your computer from restarting.

Fixing your code is an entirely different issue

At one point, I had my mac laptop re-starting on a schedule (a few operating systems back, on OSX Snow Leopard), but there should be an easier way.

This article is written for Snow Leopard, but the preferences are still in the same location on Mavericks.

Feel free to comment with other questions!

share|improve this answer
I'm not sure if this is still an issue, just realized it was posted 10 months ago. Oh well! – joshnroy Jul 25 '14 at 18:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .