MacMost Q&A Forum • View All Forum QuestionsAsk a Question

How Do I Implement an AppleScript To Restart the My Headless Mac mini?

I want to restart my headless macMini via an appleScript, scheduled by multiple iCal Alerts. I’ve found that because  reopens apps at restart, a loop is created which forces another restart. I also have learned that iCal will reinitiate the alert because it was not completed before the reStart. Maybe running the script async on another thread/queue with a timer? I’ve successfully created an Automator that closes all apps and then deletes the iCal event before the restart. This works and solves my problem, but seems kludge. Is there an elegant way? I know about the power settings option, but need more scheduling flexibility.

script:
delay 10
tell application “Finder” to restart

—–
Ron L

Comments: One Response to “How Do I Implement an AppleScript To Restart the My Headless Mac mini?”

    7 years ago

    I assume you mean Calendar, right? Not iCal? Or are you using an older version of OS X?
    It is a shame that you can't use the Energy Saver option as that is very reliable and easy to do.
    I think your plan to have the Automator script close all apps and delete the event is a decent one. Or at least just delete the event. Not sure what the purpose of closing all the apps is, but I don't know what you are trying to accomplish here. Keep experimenting and maybe you'll be able to find something better.
    Otherwise, let me know what you are really trying to do? I get that you want to restart your Mac automatically at various times, but why? A lot of times it is hard to get good advice on HOW to do something unless you also include the WHY.

Comments Closed.