Re: Formatting Text When Responding to a Dialog Box
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