[Pythonmac-SIG] Applescript

Jack Jansen Jack.Jansen at cwi.nl
Fri Jan 9 10:06:22 EST 2004


On 9-jan-04, at 11:13, has wrote:
> Well, I've followed AppleScript's approach, which is to do the  
> query-building thing, then cover it with syntactic sugar to make it  
> look and feel pleasant and familiar; eg:
>
> - AppleScript:
>
>    a reference to first character of every paragraph of text of  
> document "ReadMe.txt"
>
> - Python:
>
>     
> app('TextEdit.app').documents['ReadMe.txt'].text.paragraphs.characters[ 
> 0]
>
>
> Whereas the unsugared form would look like:
> app('TextEdit.app').elems('document').byName('ReadMe.txt').prop('text') 
> .elems('paragraph').elems('character').byIndex(0)

[>FLASH<]

after years and years of struggling and failing to understand the  
AppleScript one simple example causes Jack's enlightenment.

THANK YOU VERY MUCH!!!!!!!

One question remains: are all these objects selectors? Are they all of  
the same Python class?
--
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