• 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
NSAppleScript and partially launched NSApp
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAppleScript and partially launched NSApp


  • Subject: NSAppleScript and partially launched NSApp
  • From: Warren Burton <email@hidden>
  • Date: Wed, 7 Jul 2004 16:51:32 +0100

Im trying to get the following to work inside an instance of a
partially loaded app.

NSAppleScript *script = [[[NSAppleScript alloc] initWithSource:str]
autorelease];
[script executeAndReturnError:&errdict];
NSLog([errdict description]);

where the source is 'do shell script "blah" password "xxxx" with
administrator privileges'

but the code just returns
err -2709, which is 'cant get event dictionary'

I know my code is OK as it runs fine inside a fully launched app.
and Ive tried using the following to load the relevant suite
//force this applescript suite to be loaded
id ssr = [NSScriptSuiteRegistry sharedScriptSuiteRegistry];
[ssr loadSuitesFromBundle:[NSBundle
bundleWithPath:@"/System/Library/ScriptingAdditions/
StandardAdditions.osax"]];

so i guess theres some application variable that needs to be loaded.

any ideas would be much appreciated
_______________________________________________
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.


  • Prev by Date: Re: Detecting user activity
  • Next by Date: Re: Debugging a specific object
  • Previous by thread: NSOpenPanel shouldShowFilename delegate, or how to display a list of applications
  • Next by thread: sendEvent and scrollWheel
  • Index(es):
    • Date
    • Thread