• 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: display dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: display dialog


  • Subject: Re: display dialog
  • From: Adam Wuellner <email@hidden>
  • Date: Thu, 17 Mar 2005 11:26:00 -0600

On Thu, 17 Mar 2005 02:30:07 -0800, Scott Haneda <email@hidden> wrote:
> I am using this, and I am not sure how correct it is, but it does work for
> me:
>
> property theCopy : ""
>
> repeat while theCopy is ""
>     display dialog "SMS?:" buttons {"Cancel", "OK"} with icon note ¬
>         default button 2 default answer theCopy
>     set the theCopy to text returned of the result
> end repeat
>

Once that runs once and a user inputs something, theCopy will keep the
input, and the dialog will not even be displayed on subsequent runs.
Is that your intent?

I'd suggest not using a property, or re-initializing it to "" before
testing it in the repeat statement if you need it as a property for
other purposes.

> First, you can see my repeat loop is an attempt to force entry of text, is
> there a better way?

There's nothing wrong with your prime-the-pump sentinel-controlled
while loop, AFAICT.  I might combine the two statements inside the
loop, but having that freebie 'result' property is nice in that you
can break up what would be one really long line of code into two,
without creating temporary variables...  I guess I'd leave it as you
have it in this case.
 _______________________________________________
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: 
 >display dialog (From: Scott Haneda <email@hidden>)

  • Prev by Date: Re: Save image from raw data class variable
  • Next by Date: Re: Pass a variable to an include file
  • Previous by thread: Re: display dialog
  • Next by thread: Save image from raw data class variable
  • Index(es):
    • Date
    • Thread