[Pythonmac-SIG] py-appscript changes to filtering?
Nicholas Riley
njriley at uiuc.edu
Sat Sep 8 20:53:47 CEST 2007
Hi,
I ran into a bug with py-appscript 0.17.2 (handling apps that had quit
while you still had a reference to them) and updated to the current
trunk. This fixed this problem but broke some of my other code. This
code:
systemEvents = app(id='com.apple.systemEvents')
frontName = systemEvents.processes[its.frontmost][1].name()
which worked fine with 0.17.2 doesn't work any more. I get:
File "/Library/Python/2.3/site-packages/appscript-0.18.0-py2.3-macosx-10.4-ppc.egg/appscript/reference.py", line 457, in __getitem__
return Reference(self.AS_appdata, self.AS_aemreference.byfilter(
File "/Library/Python/2.3/site-packages/appscript-0.18.0-py2.3-macosx-10.4-ppc.egg/aem/types/objectspecifiers/specifier.py", line 385, in byfilter
return ElementsByFilter(self.AEM_want, self, expression)
File "/Library/Python/2.3/site-packages/appscript-0.18.0-py2.3-macosx-10.4-ppc.egg/aem/types/objectspecifiers/specifier.py", line 425, in __init__
raise TypeError, 'Not a test specifier: %r' % key
TypeError: Not a test specifier: its.property('pisf')
It works if I use [its.frontmost == True], but that's kind of ugly.
Is this intentional?
Thanks,
--
Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
More information about the Pythonmac-SIG
mailing list