[Pythonmac-SIG] How does AppleScript find unqualified properties?
Jack Jansen
Jack.Jansen at cwi.nl
Tue Dec 2 09:33:58 EST 2003
On 2 Dec 2003, at 14:40, Bob Ippolito wrote:
>> Either way, it seems that "with properties" is magic. Could we use
>> this in our wrappers? I'm thinking of something along the lines of
>> making it possible to say
>> >>> shape = ap.make(new=og.shape, origin=(100,100), size=(20,20),
>> name="Circle")
>>
>> This would be implemented by having make() collect all the unknown
>> keyword arguments, look them up in the properties dict, stuffing them
>> in a dict and passing that as the with_properties argument.
>>
>> Or is this too much magic?
>
> How is that any different from:
> shape = app.make(new=og.shape, with_properties=dict(origin=(100, 100),
> size=(20, 20), name="Circle")) ? 'with properties' isn't special,
> it's just an optional "kwarg" of the make command.
"origin" won't work there, if I read the other mails in the thread
correctly you would have to say dict(og.graphic.origin=(100, 100),
og.graphic.size=(20, 20), og.shape.name="Circle").
Or do I misunderstand, and would the simpler dict(og.origin=(100, 100),
og.size=(20, 20), og.name="Circle") work too? If that is the case then
I'd be happy.
Hmm, no, that won't fly. At least, with the old gensuitemodule stuff I
came across overloaded names: the same name used for both a class and a
property.
--
Jack Jansen <Jack.Jansen at cwi.nl> http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma
Goldman
More information about the Pythonmac-SIG
mailing list