Re: Get iTune File Track by Alias
Re: Get iTune File Track by Alias
- Subject: Re: Get iTune File Track by Alias
- From: Nigel Smith <email@hidden>
- Date: Thu, 22 Apr 2004 16:28:22 +0100
On 20/4/04 16:42, "email@hidden"
<email@hidden> wrote:
>
But, for this to work, doesn't it assume that 'location of every file track of
>
playlist "Library"' will be alphabetically sorted?
No, because it uses the AppleScript function "contains". So if the thing you
are looking for is *anywhere* in the first half of the list it will repeat
the search on the first half, else it will repeat the search on the second
half.
But I see where you are coming from -- usually when you see a binary search
it is used on sorted lists, and you just test for order against the middle
item.
I guess this only makes sense because "contains" is a lot faster than
iterating through the list, and is still faster even with repeated calls.
Obviously if your search is biased towards the earlier terms in the list
then iterating may be quicker.
Try it and see for yourself!
Nigel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.