Re: DialogDirector - default item
Re: DialogDirector - default item
- Subject: Re: DialogDirector - default item
- From: JollyRoger <email@hidden>
- Date: Fri, 22 Feb 2002 16:25:54 -0600
On 2/22/2002 9:55 AM, "Romulus Barabas" <email@hidden> wrote:
>
> From: JollyRoger
>
> To: AppleScript Users
>
> CC: Romulus Barabas
>
> Subject: Re: DialogDirector - default item
>
> Date: Fri, 22 Feb 2002 07:49:05 -0600
>
>
>
> On 2/21/2002 8:52 PM, "Romulus Barabas" wrote:
>
>
>
>> dd install
>
>> set d to dd make dialog {size:[200, 210], style:movable dialog, contents:[,
>
>> {class:push button, name:"Done", bounds:[60, 182, 115, 200]}, ,
>
>> {class:push button, name:"Check", bounds:[130, 182, 185, 200]}, ,
>
>> {class:text field, bounds:[60, 90, 115, 106], value:""} ,
>
>> ], default item:2}
>
>> repeat
>
>> set i to dd interact with user
>
>> if i = 1 then exit repeat
>
>> if i = 2 and (dd get value of item 3 of d) is "OK" then dd set default item
>
>> of d to 1
>
>> end repeat
>
>> dd uninstall
>
>
>
> I'm surprised you didn't get an error. This line is wrong:
>
>
>
> dd set default item of d to 1
>
>
>
> You are setting the "default item" property of the dialog /reference/
>
> instead of the dialog /record/. Those are two different things. According
>
> to the dictionary, "default item" is a property of the "dialog" class, not a
>
> dialog reference. It looks like the only way is to change the dialog
>
> template and re-make the dialog.
>
>
>
> JR
>
>
The line is not wrong, this is how you set things in DialogDirector.
I think you are incorrect here. If default item really was a property of a
dialog reference, then the following (after making the dialog) should work:
dd get value of default item of d
But it doesn't, because there is no "default item" property of the dialog
reference. If you try it, you get the error:
"value of default item of dialog id 3 doesn't understand the dd get
message."
I believe that's DD's way of saying there's no such property in the dialog
reference.
The following works because "item"s are properties of dialog references:
dd get value of item 1 of d
>
The reference gets evaluated before setting, unless (I suppose) you coerce it
>
"as reference".
Right; but still "default item" is not a property of the reference.
>
With this syntax I've been able to change some things (like the
>
size of a button), but not others (like the size of the whole dialog box).
I could be wrong; but my understanding is that properties of items within
the dialog are available for reading / writing, but not properties of the
dialog itself.
JR
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.