Re: OSAScriptController's stopScript action
Re: OSAScriptController's stopScript action
- Subject: Re: OSAScriptController's stopScript action
- From: sqwarqDev <email@hidden>
- Date: Wed, 17 Dec 2014 20:46:28 +0700
> On 17 Dec 2014, at 19:07, Jonathan Mitchell <email@hidden> wrote:
>
> Can you show us how you launch the script.
>
The script is just in a bog standard NSTextView, with a bit of tinkering to the text attributes, and then it's simply a call to OSAScript:
NSString *source = [textView string];
NSAttributedString *displayVal;
NSDictionary *myError;
OSAScript *_userScript = [[OSAScript alloc] initWithSource:(NSMutableString *)source];
[_userScript executeAndReturnDisplayValue:&displayVal error:&myError];
Or, in some other projects where I need to solve the same problem, I might declare an AppleEventDescripor variable, and swap that last line above for either one of
- (NSAppleEventDescriptor *)executeAndReturnError:(NSDictionary **)errorInfo;
or
- (NSAppleEventDescriptor *)executeAppleEvent:
Best
Phil
_______________________________________________
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