• 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: Choose from list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Choose from list


  • Subject: Re: Choose from list
  • From: Carlos Ysunza <email@hidden>
  • Date: Mon, 17 Oct 2005 13:36:23 -0500

Paul  this is a very nice solution...
But I would like to ask you, about your last comment
>I use a version incorporating a "Serge" script object to go faster when the
> list is large (100 items or more).

I don't have idea what you talking about when you say "Serge" but sounds
like I'm missing something important, because I have some scripts that deals
with large lists of objects and of course will be very important to make my
process much faster.
Could you tell us something about it...

Thanks
Carlos Ysunza B.
Director
Ysunza/Santiago
Visual Communication € Automation
Tel. (52)55 5256-0336
email@hidden

http://www.ysunzasantiago.com
http://www.thesecretmexico.com
http://www.applescript.com.mx


> From: Paul Berkowitz <email@hidden>
> Reply-To: <email@hidden>
> Date: Sun, 16 Oct 2005 08:29:16 -0700
> To: AppleScript-Users <email@hidden>
> Subject: Re: Choose from list
>
> On 10/16/05 7:44 AM, "Robert Poland" <email@hidden> wrote:
>
>> I have this line in a script;
>>
>> set theChoice to (choose from list theList default items
>> theDefaultList with prompt "Select Calendar")
>>
>> I know how to get the text returned, but I would like to get the
>> number of the item chosen.
>>
>> Page 337 of Matt's book doesn't even address this situation.
>>
>> Where else can I go to find this answer?
>
> Here's the right place. It's a good question. AppleScript does not provide a
> built-in answer. There are probably some osaxen (Satimage?) that do it - in
> Classic days Akua Sweets had one. I use a handler:
>
>     set theChoice to (choose from list theList default items
> theDefaultList with prompt "Select Calendar") as Unicode text
>     if theChoice  = "false" then error number -128 -- cancel
>     set listIndex to my CollectUniqueItemIndex(theList, theChoice)
>
>
> to CollectUniqueItemIndex(theList, theItem) -- the Item can be string,
> number, constant, app object or list
>
>     local aListMember
>
>     set theIndex to 0
>     repeat with i from 1 to (count theList)
>         set aListMember to item i of theList
>         if aListMember = theItem then
>             set theIndex to i
>             exit repeat
>         end if
>     end repeat
>
>     return theIndex
>
> end CollectUniqueItemIndex
>
>
>
> I use a version incorporating a "Serge" script object to go faster when the
> list is large (100 items or more).
>
>
>
> --
> Paul Berkowitz
>
>
>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Choose from list (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: date of question
  • Next by Date: Optimize your script with Shark
  • Previous by thread: Re: Choose from list
  • Next by thread: Re: Choose from list
  • Index(es):
    • Date
    • Thread