[Pythonmac-SIG] boolean values in appleevents - solution
Lee Phillips
lphillip@lcp.nrl.navy.mil
Fri, 8 Feb 2002 10:00:49 -0500
Several people generously responded to my question; one response
actually provided a solution to the problem:
From Vincent Marchetti, using
import aetypes
AETrue = aetypes.Boolean(1) # or AEFalse = aetypes.Boolean(0)
works perfectly, at least for the two applications I've tested it
for: the makedisk.py example and a test I wrote that talks to BBedit.
Thank you!
From Jack Jansen,
> I had also expected the receiving end to do the type cast, if
> needed. Most receivers seem to do so
I've only experimented with Disk Copy and BBedit, and neither one
understands "1" or "0" as boolean. If that's not what you mean, just
ignore me; I'm just starting with this and don't understand most of
what you said.
Bill fancher writes that if he tells Disk Copy
create "testImg" saving as file "Nanook:testImg.dmg" leave
image mounted 0
a message is sent that he thinks looks ok, and the image is indeed
not mounted. When I try this from the Script Editor the image is
mounted. When I change it to
.... leave image mounted 1
the image is also mounted. When I use the formulations "with leave
image mounted" or "without leave image mounted", things work as they
should. Maybe we have different versions of Disk Copy, or something.
Also, the events sent are different, of course.
Am I alone in thinking that appleevents are a fairly hairy system of IAC?