[Pythonmac-SIG] [ann] AppScripting 0.1.0

Bob Ippolito bob at redivi.com
Wed Nov 19 13:50:02 EST 2003


On Nov 19, 2003, at 12:10 PM, has wrote:

> Jack wrote:
>
>> On 19 Nov 2003, at 10:11, has wrote:
>>> More important stuff includes figuring out how to create 
>>> typeAppSignature AEDescs (or equivalent) for apps like Address Book 
>>> that don't have creator codes, and how best to implement the user 
>>> interface for the by-test reference form (aka 'whose clauses').
>>
>> Assume that a LaunchServices or ApplicationServices or whatever 
>> module will be available soon. That'll solve the first problem, 
>> right?
>
> Afraid I'm too ignorant of the lower workings of MacOS to give an 
> answer. Must defer to smarter minds for that.
>
>
>> The second problem is more of a design problem, Python has no 
>> language construct for this that we could use. But the bad news is 
>> that I don't have an easy solution either:-(
>
> The options I can think of are:
>
> 1.  Let users work directly with the various test-related classes, eg:
>
>    imagesRef = blah.blah.blah.whose(AS.is_in(AS.ref.name_extension, 
> ['gif', 'jpg', 'png']))
>
> (This'd be simple to implement, but also the least pleasant to use.)
>
>
> 2. Let users express the test as an interpolated string that's parsed 
> for meaning internally, eg:
>
>    imagesRef = blah.blah.blah.whose('name_extension is in $', ['gif', 
> 'jpg', 'png'])
>
> (This'd require a basic parser, but nothing I couldn't write myself. 
> And Python folk are already used to %-interpolated strings so 
> shouldn't find this variant too tedious.)
>
>
> 3. Let users express the test as a series of attribute accesses and 
> method calls:
>
>    imagesRef = blah.blah.blah.whose.name_extension.is_in(['gif', 
> 'jpg', 'png'])
>
> (This is just an extension of the approach ScriptingInterface uses to 
> build OSA object specifiers - a series of chained __getattr__ calls 
> hanging off a smart 'whose' object that assembles the OSA expression.)

Yeah, this is the biggest reason why I haven't implemented comparisons 
in aeve.  I couldn't think of a non-ugly way to make the application do 
it through the bridge so right now I use Python to filter stuff (which 
can be much slower but more powerful and easier).

-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20031119/df3bb742/smime.bin


More information about the Pythonmac-SIG mailing list