Re: ASObjC: Get Most Recent File or Folder
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