Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAppleScript and partially launched NSApp



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.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.