• 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: ASObjC: Get Most Recent File or Folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ASObjC: Get Most Recent File or Folder


  • Subject: Re: ASObjC: Get Most Recent File or Folder
  • From: Dave <email@hidden>
  • Date: Sat, 04 Jun 2016 11:23:32 +0100

> On 4 Jun 2016, at 03:38, Shane Stanley <email@hidden> wrote:
>
> On 4 Jun 2016, at 1:23 AM, Dave <email@hidden> wrote:
>>
>> In my opinion it would be better to add another handler that calls the array version and extracts the last Object from the returned array:
>
> That's what you'd typically do in Objective-C, but there's an extra wrinkle here performance-wise, because the result needs to be converted back to an AS object. So if you have a folder with a lot of files, converting that array to a list of AS strings and then extracting the last item is going to be slower than converting just the last object in the array.

Ahhhh, ok in that case, grab the last item as now and then put it into an Array that contains just the one item and return that array would be better IMO. Then have the second method extract the one item and return it.

Having methods that return variable objects is not good news in Objective-C.

Cheers
Dave


 _______________________________________________
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


  • Follow-Ups:
    • Re: ASObjC: Get Most Recent File or Folder
      • From: Shane Stanley <email@hidden>
References: 
 >ASObjC: Get Most Recent File or Folder (From: Christopher Stone <email@hidden>)
 >Re: ASObjC: Get Most Recent File or Folder (From: Jim Underwood <email@hidden>)
 >Re: ASObjC: Get Most Recent File or Folder (From: Christopher Stone <email@hidden>)
 >Re: ASObjC: Get Most Recent File or Folder (From: Dave <email@hidden>)
 >Re: ASObjC: Get Most Recent File or Folder (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: [FYI] more sdef-based library stupidity
  • Next by Date: Re: [FYI] more sdef-based library stupidity
  • Previous by thread: Re: ASObjC: Get Most Recent File or Folder
  • Next by thread: Re: ASObjC: Get Most Recent File or Folder
  • Index(es):
    • Date
    • Thread