Re: Cocoa/Obj-C Restart Computer
Re: Cocoa/Obj-C Restart Computer
- Subject: Re: Cocoa/Obj-C Restart Computer
- From: Ken Ferry <email@hidden>
- Date: Fri, 30 Jul 2004 18:00:33 -0400
On Fri, 30 Jul 2004 15:41:55 -0600, Matt Jaffa <email@hidden> wrote:
>
Hi,
>
>
I was wondering if there was any command in Cocoa/Obj-C to restart the
>
computer, so that my app can do that when they push a button.
>
>
Or any other way of doing this would be fine.
(typed in mail..)
NSDictionary *error;
NSAppleScript *restartScpt = [[NSAppleScript alloc]
initWithSource:@"tell application \"Finder\" to restart"];
[restartScpt executeAndReturnError:&error];
There are probably other ways, but that ought to do it. Be careful testing it.
-Ken
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.