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

Re: Weird choose from list behaviour


  • Subject: Re: Weird choose from list behaviour
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 13 Nov 2012 07:41:17 -0600

On Nov 13, 2012, at 6:00 AM, Brian Christmas wrote:

on run
my dataEntry()
end run

on dataEntry()
set theAnswer to ""
set TheMainMenu to {"Main Mail Recipient", "Hourly Report CC Recipients", "Daily Report CC Recipients", "Preparation Problem CC Recipients", "Emergency Contact", "Emergency Contact CC Recipients"}
set theAnswer to choose from list TheMainMenu with prompt "Select an eMail group in which you wish to add or delete a recipient." & return with title "Mail Manager eMail lists"
say theAnswer
if theAnswer as text = "false" then # This gets ignored once a list item is selected, but it says 'false'
quit me
else

set theFileName to "  " & theAnswer as text
set theWholeList to my ReadFile3(theFileName)
if theAnswer as text = "Main Mail Recipient" then
my Entry1(theFileName, theWholeList, theAnswer)
end if
end if
end dataEntry

Try this instead …

on run
my dataEntry()
end run

on dataEntry()
set theAnswer to choose from list {"A", "B", "C"}
-- returns 'false' if cancelled, otherwise a list
if class of theAnswer is list then
set theAnswer to item 1 of theAnswer
say theAnswer
else
say "cancel"
-- quit me --> sends 'quit' to Smile or ASEditor !!!
error number -128
end if
end dataEntry

'choose from list' always returns a list or 'false' which is peculiar, but once you catch on to this it works correctly.


 _______________________________________________
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

References: 
 >Weird choose from list behaviour (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: Weird choose from list behaviour
  • Next by Date: Re: Weird choose from list behaviour
  • Previous by thread: Re: Weird choose from list behaviour
  • Next by thread: Re: Weird choose from list behaviour
  • Index(es):
    • Date
    • Thread