• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Error message: NOT super-user‏
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error message: NOT super-user‏


  • Subject: Re: Error message: NOT super-user‏
  • From: John Stiles <email@hidden>
  • Date: Sat, 8 Sep 2007 14:57:40 -0700

Mike's technique will work, or you can avoid using a separate file at all and just pass the script as a string to NSAppleScript.

On Sep 8, 2007, at 2:50 PM, Mike Abdullah wrote:


On 8 Sep 2007, at 22:44, Ricardo Diaz wrote:


Ok, I tried this:

NSAppleScript *shutdown = [[NSAppleScript alloc] initWithContentsOfURL:[NSURL URLWithString:@"shutdown.scpt" error:nil];
[shutDown executeAndReturnError:nil];


Here's shutdown.scpt:

tell application "System Events" to shut down

but it doesn't work. Am I doing something wrong?

Yes, this:

[NSURL URLWithString:@"shutdown.scpt"

You need to properly generate the path to the script. Ask NSBundle for the path to it and then create a URL.


_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
40mikeabdullah.net


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
40blizzard.com


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Error message: NOT super-user‏ (From: Ricardo Diaz <email@hidden>)
 >Re: Error message: NOT super-user‏ (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: Error message: NOT super-user‏
  • Next by Date: Re: Error message: NOT super-user
  • Previous by thread: Re: Error message: NOT super-user‏
  • Next by thread: custom view won't update
  • Index(es):
    • Date
    • Thread