• 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: detect return, expanded
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: detect return, expanded


  • Subject: Re: detect return, expanded
  • From: Robert Poland <email@hidden>
  • Date: Sat, 05 Nov 2011 11:30:11 -0600

On Nov 5, 2011, at 11:05 AM, KOENIG Yvan wrote:


Début du message réexpédié :

De : Robert Poland <email@hidden>
Objet : Rép : detect return, expanded
Date : 5 novembre 2011 17:23:52 HNEC
À : KOENIG Yvan <email@hidden>
Cc : liste AppleScript US <email@hidden>

On Nov 5, 2011, at 10:13 AM, KOENIG Yvan wrote:


Début du message réexpédié :

set theColorList to {"0-none", "1-orange", "2-red", "3-yellow", "4-blue", "5-purple", "6-green", "7-gray"}
set theDefaultChoice to "0-none"

repeat while not return
set theChoice to choose from list theColorList default items theDefaultChoice with title "Color"
delay 0.5
end repeat



Hello

As far as I know, if you make a choice and press return,  the code will exit the loop because return was depressed.

Maybe this code may help :

set theColorList to {"0-none", "1-orange", "2-red", "3-yellow", "4-blue", "5-purple", "6-green", "7-gray"}
set theDefaultChoice to "0-none"

set theChoice to choose from list theColorList default items theDefaultChoice with title "Color"
if theChoice is not false then set theDefaultChoice to theChoice
set theChoice to choose from list theColorList default items theDefaultChoice with title "Color" with prompt "Are you sure of your choice ?"


Yvan KOENIG (VALLAURIS, France) samedi 5 novembre 2011 18:05:36

Thanks Yvan,

Another Gotcha I found, if the Option key is down the Return key is ignored.


Robert Poland - Fort Collins, CO

 _______________________________________________
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: detect return, expanded
      • From: KOENIG Yvan <email@hidden>
References: 
 >Re: detect return, expanded (From: Robert Poland <email@hidden>)
 >Fwd: detect return, expanded (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Fwd: detect return, expanded
  • Next by Date: Re: detect return, expanded
  • Previous by thread: Fwd: detect return, expanded
  • Next by thread: Re: detect return, expanded
  • Index(es):
    • Date
    • Thread