NSAppleScript and partially launched NSApp
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.