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: KOENIG Yvan <email@hidden>
- Date: Wed, 25 Jan 2012 21:08:51 +0100
Le 25 janv. 2012 à 20:41, Luther Fuller a écrit :
> 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?
>
> I haven't the slightest idea how to do that, but it was so interesting that I did a little experimenting.
> Here's something that may help ...
>
> display dialog "Enter ..." default answer "street_address" & return & "city, state zip" default button 1
> set response to text returned of the result
> display dialog response buttons {"OK"} default button 1
>
> The 'default button 1' at the end of line 1 does not work as I expected.
> (Could be a bug?) But it does let you enter the data correctly!
Hello Luther.
Which is the anormal behavior which you report ?
The button on the right in your first dialog isn't button 1, it's button 2.
The buttons are numbered starting from the one on the left.
In your sample code, button 1 is the Cancel one.
Yvan KOENIG (VALLAURIS, France) mercredi 25 janvier 2012 21:08:45
_______________________________________________
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