• 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
Re: OSAScriptController's stopScript action
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >OSAScriptController's stopScript action (From: sqwarqDev <email@hidden>)
 >Re: OSAScriptController's stopScript action (From: Jonathan Mitchell <email@hidden>)

  • Prev by Date: Re: How to make a TableColumn unsortable
  • Next by Date: Re: Replace -lockFocus with Block-Based Drawing Method (was NSCustomImageRep…)
  • Previous by thread: Re: OSAScriptController's stopScript action
  • Next by thread: Re: OSAScriptController's stopScript action
  • Index(es):
    • Date
    • Thread