[Pythonmac-SIG] AppleScript Example

Robin Siebler Robin.Siebler@corp.palm.com
Tue, 13 Aug 2002 11:43:52 -0700


With help from viewers like you, I now have the following script which
*should* work (or so I believe).  However, it doesn't.  Am I doing something
wrong, or is there a bug somewhere?

Here is the code:

 import CodeWarrior
 cw = CodeWarrior.CodeWarrior(start=1)
 cw.activate()
 cw.open (file1)
 cw.disassemble_file(file2)
 text = cw.get(CodeWarrior.text(CodeWarrior.document(1)))

After I run this, text is None, so either I am doing something wrong (my
guess) or there is a bug.  Any takers?

Robin L. Siebler
Software Test Engineer
Palm
---------------------------------------
Homer Simpson: Bart, I'm not asking you to give blood for free. That would
be crazy! You may not realize it now, but when you save a rich guy's life,
he showers you with riches! Don't you know the story of Hercules and the
Lion?    Bart Simpson: Is it a Bible story?    Homer Simpson: Yeah,
probably. Anyway, once upon a time, there was a big, mean lion who got a
thorn in his paw. All the villagers tried to pull it out, but nobody was
strong enough, so they got Hercules and he used his mighty strength, and
bingo! Anyway, the moral is, is that the lion was so happy, that he gave
Hercules this big... thing... of riches!    Bart Simpson: How did a lion get
riches?    Homer Simpson: It was the olden days!    Bart Simpson: Oh!