Re: [ASOC] returning by reference, and converting script objects to descriptors?
Re: [ASOC] returning by reference, and converting script objects to descriptors?
- Subject: Re: [ASOC] returning by reference, and converting script objects to descriptors?
- From: Shane Stanley <email@hidden>
- Date: Sat, 16 Jan 2016 22:18:23 +1100
On 16 Jan 2016, at 20:30, has <email@hidden> wrote:
Does ASOC support return-by-argument, e.g. for getting NSError**?
set {theResult, theError} to (theFileManager's copyItemAtURL:theSourceURL toURL:theDestURL |error|:(reference))
Also, am I right that ASOC doesn't support block-based APIs at all, e.g. NSTask.terminationHandler?
No, there's no support for blocks. In this case you have to do something yucky like:
repeat while theTask's |isRunning|() as boolean delay 1.0E-5 end repeat
Running NSTask in ASObjC is about on-par with do shell script time-wise.
Is there a way to convert a script object to an NSAppleEventDescriptor of typeScript? (Other than packing it into an AppleEvent and sending it to a custom-installed AE handler, which is a chore.)
Use NSArray's -arrayWithObject: to make a single-item array, then get its firstObject()? (I need a way to do stuff like call OSADisplay to get the source-code representation of any AS value.)
Good luck with that.
(You really ought to take time to have a look at ASObjC explorer, you know...) |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden