• 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: "Robert W. Young" <email@hidden>
  • Date: Wed, 25 Jan 2012 17:36:22 -0500
  • Importance: Normal

> On Jan 25, 2012, at 12:12 PM, 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?


Thanks to Barry Wainwright who responded to me directly the solution is extremely simple and works perfectly.  Modifying the above script by simply using 'return' as the default answer allows the entry of multiple lines of text, and when displayed later it appears exactly as it was entered.

tell application "Finder"
   set theText to text returned of (display dialog "What address do you want to display?" default answer return)
   display dialog theText
end tell

What a simple fix for something that was driving me crazy.  Thanks Barry!

Regards,
Bob


 _______________________________________________
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

  • Prev by Date: Re: Formatting Text When Responding to a Dialog Box
  • Next by Date: Re: Formatting Text When Responding to a Dialog Box
  • Previous by thread: RE: Formatting Text When Responding to a Dialog Box
  • Next by thread: Safari Reload
  • Index(es):
    • Date
    • Thread