• 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: Simple Display Dialog confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple Display Dialog confusion


  • Subject: Re: Simple Display Dialog confusion
  • From: Robert Poland <email@hidden>
  • Date: Thu, 17 Jul 2008 13:10:11 -0600


On Jul 17, 2008, at 12:11 PM, Gary Thompson wrote:

Hello,

Can someone tell me how to get the 'button returned' from the display dialog?

set prompt to "Enter Date to import (MM/DD/YYYY)"
set mydate to current date
set today to (month of mydate as integer) & "/" & day of mydate & "/" & year of mydate
set today to text returned of (display dialog prompt default answer today as string buttons {"Cancel", "OK"} default button 2)

This does not seem to work:
if button returned is "Cancel" then
-- exit
else
--do stuff
end if

Thanks, Gary

Gary,

The block "if button returned is "Cancel" then" isn't needed.

If you click the "Cancel" button the script quits.

Why don't you just replace the whole if block with "--do stuff"


Bob 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

References: 
 >Simple Display Dialog confusion (From: Gary Thompson <email@hidden>)

  • Prev by Date: RE: Simple Display Dialog confusion
  • Next by Date: Re: Finding the focused UI element
  • Previous by thread: RE: Simple Display Dialog confusion
  • Next by thread: RE: Simple Display Dialog confusion
  • Index(es):
    • Date
    • Thread