Mac GeekeryGet your geek on. |
|
blog advertising is good for you
recent popular content
User login
|
The Mac has two different ways of doing a shutdown or restart: the Mac way and the Unix way. That is to say that one can go to the Apple Menu and pick restart or shut down and the system will gently close out all the programs and nicely tell everything it’s about to restart and then go on with itself. The other way is to issue This is not to say Sometimes that’s useful, but sometimes you’re in the odd situation of wanting a clean restart or shutdown but are in the system via SSH and don’t have the GUI up. Never fear, it’s quite possible. Just issue the following command as the same user that’s logged in to the computer:
You can use the command “shut down” if you want to power off the machine cleanly.
About Adam Knight
Author Biography Adam Knight is one of the founders of Mac Geekery and is a geek at heart. Programmer by day, hacker by night, his daily life revolves around the Macintosh platform, which he has been a user and programmer for since the early days of System 7 when his LCII replaced his Apple //c. In-between tech jobs, he’s managed to learn the basics of any web hacker: PHP, MySQL, Perl, Apache, Linux, *BSD, and the intricacies of ./configure —prefix=~/bombshelter/. Today, codepoet is concentrating on blogging again, writing some software for the Mac by himself (including Notae) and for his company (such as Switchblade) and has a few other toys coming out soon. Bug him over AIM or email [link fixed]. |
Doesn’t this require that “Enable access for assistive devices” be checked in the Universal Access System Preferences Pane, since that enable the ability to GUI script with Applescript and gives you access to the “system events” application?
I haven’t tested this, but I would expect it to be so.
Sean
————————————————————————————————-
Sean P. Kane
————————————————————————————————-
Congress appropriates. Microsoft lobbies. Citizens steal.
this isn’t gui scripting, so it doesn’t require the Assistive option.
Cool, that’s good to know. I didn’t think you could access any “System Events” via Applescript without the Assistive option turned on.
Thanks,
Sean
————————————————————————————————-
Sean P. Kane
————————————————————————————————-
Congress appropriates. Microsoft lobbies. Citizens steal.
what program do you enter that code in?