Re: DialogDirector - default item
Re: DialogDirector - default item
- Subject: Re: DialogDirector - default item
- From: "Romulus Barabas" <email@hidden>
- Date: Fri, 22 Feb 2002 19:12:02 -0500
From: JollyRoger <email@hidden>
To: Applescript-Users <email@hidden>
CC: Romulus Barabas <email@hidden>
Subject: Re: DialogDirector - default item
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
Sorry JR, but I'll stick to my statements. Here's why:
> 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.
dd get bounds of d
--> {476, 340, 676, 550}
dd set bounds of d to {576, 340, 876, 550}
--> the box will actually move and change its size
So my syntax is correct, it's only that the object doesn't support the
command, namely, default item is not get-able. If you still have doubts, try
dd get default item of contents of d
which will evaluate the link for sure - but you will get the same result.
Try
dd get bounds of contents of d
it will work.
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.
This seems to be true, except for the size and position of the dialog
itself, which can be changed. I was kinda hoping for more exceptions, do you
know any?
Thanks,
Romy
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
_______________________________________________
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.