Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I created an AppleScript to restart my Mac:

tell application "System Events"
restart
end tell

I put this script into Calendar.app 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

2 Answers 2

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/com.apple.loginwindow.*.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

@Macko

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/com.apple.loginwindow.*.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 at 18:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.