• 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
About NSAppleScriptErrorNumber = -2709
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About NSAppleScriptErrorNumber = -2709


  • Subject: About NSAppleScriptErrorNumber = -2709
  • From: xiaobin <email@hidden>
  • Date: Tue, 9 Dec 2008 10:54:05 +0900

hi,

I am writing application A and application B using Object-C++ and Object-C.
A include restart OS code by using apple script to tell finder to restart os.

the code is following :

NSDictionary *error = nil;
NSAppleScript *script = [[[NSAppleScript alloc] initWithSource:@"tell
application \"Finder\"\nrestart\nend tell"] autorelease];
[script executeAndReturnError:&error];

I want that App B call App A to restart OS. But it is failed([script
executeAndReturnError:&error] == nil ).
( I found It is OK that calling restart OS code from App A directly)
I got the error number and message.

NSAppleScriptErrorNumber = -2709

the error message is "Can't get the event dictionary" .
It sounds like the apple event dictionary can not be found or something else.
But I don't know what it means concretely and how to fix the problem.
I have this question for several days. I can't find any information about this.
Anyone can help me?
_______________________________________________

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

  • Follow-Ups:
    • Re: About NSAppleScriptErrorNumber = -2709
      • From: Rob Keniger <email@hidden>
  • Prev by Date: Re: Understanding text cell editing behaviour
  • Next by Date: Re: About NSAppleScriptErrorNumber = -2709
  • Previous by thread: Re: Understanding text cell editing behaviour
  • Next by thread: Re: About NSAppleScriptErrorNumber = -2709
  • Index(es):
    • Date
    • Thread