• 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: Formatting Text When Responding to a Dialog Box
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatting Text When Responding to a Dialog Box


  • Subject: Re: Formatting Text When Responding to a Dialog Box
  • From: Stan Cleveland <email@hidden>
  • Date: Wed, 25 Jan 2012 11:49:58 -0800

On Jan 25, 2012, at 10:12 AM, Robert W. Young wrote:

> When I run the following script:
>
> tell application "Finder"
> set theText to text returned of (display dialog "What address do you want to display?" default answer "")
> display dialog theText
> end tell
>
> I would like to see the text displayed as:
> 1234 Oak Street
> Some City, Some State 12345
>
> Using the 'Return' when inputting the text closes the dialog window rather than starting a new line.  Doing it in 2 segments "What is the street address?" and "What are the city, state and zip?" is not practical for what I am doing.  Is it possible to do what I want, and if so how?

Hi Bob,

I'd use one of the following:
	set the clipboard to return
	set theText to text returned of (display dialog "Enter an address:" default answer "")
	display dialog theText
When the dialog appears, the clipboard will contain a return character. So type the first line, paste, then type the second line. You can add additional returns (by pasting) as needed.

Or:
	set theText to text returned of (display dialog "Enter an address :" default answer return)
	display dialog theText
In this case, the dialog's text field will contain a return character. So hit up arrow, type the first line, hit down arrow, then type the second line. You can add additional returns (as the default answer) as needed.

HTH,
Stan C.


 _______________________________________________
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: 
 >Formatting Text When Responding to a Dialog Box (From: "Robert W. Young" <email@hidden>)

  • Prev by Date: Re: Formatting Text When Responding to a Dialog Box
  • Next by Date: Re: Slow Applescript Mailing list
  • Previous by thread: Re: Formatting Text When Responding to a Dialog Box
  • Next by thread: RE: Formatting Text When Responding to a Dialog Box
  • Index(es):
    • Date
    • Thread