• 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: [ASOC] returning by reference, and converting script objects to descriptors?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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...)

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

References: 
 >[ASOC] returning by reference, and converting script objects to descriptors? (From: has <email@hidden>)

  • Prev by Date: [ASOC] returning by reference, and converting script objects to descriptors?
  • Next by Date: Re: [ASOC] returning by reference, and converting script objects to descriptors?
  • Previous by thread: [ASOC] returning by reference, and converting script objects to descriptors?
  • Next by thread: Re: [ASOC] returning by reference, and converting script objects to descriptors?
  • Index(es):
    • Date
    • Thread