[Pythonmac-SIG] ASTranslate (appscript) has a runtime error (variable not defined) on what I think is valid appscript

John Owens john_owens at yahoo.com
Sun Jun 26 02:07:20 CEST 2011


Would love a little help solving this! I guess this is a bug report, but I don't know how else to contact the ASTranslate developers. I'd like to hear how to translate this AppleScript to appscript properly. Details at the following link, also copied below:

http://stackoverflow.com/questions/6475872/astranslate-appscript-has-a-runtime-error-variable-not-defined-on-what-i-thin


Here's the AppleScript (first snippet):


http://dinhviethoa.tumblr.com/post/5967294192/applescript-with-sparrow

tell application "Sparrow" 
activate
set theMessage to make new outgoing message with properties {subject:"meeting at 4:00", content:"We'll be 4 to discuss about the future of our life."}
tell theMessage make new to recipient at end of to recipients with properties {name:"John Doe", address:"john at gmail.com"}
make new to recipient at end of cc recipients with properties {name:"Sonia Jones", address:"sonia at gmail.com"}
sendmessage
end tell
end tell 

ASTranslate reveals:

app(u'Sparrow').activate()
app(u'Sparrow').make(new=k.outgoing_message, with_properties={k.content: u"We'll be 4 to discuss about the future of our life.", k.subject: u'meeting at 4:00'})
Runtime Error: The variable theMessage is not defined. (-2753) 

What I was trying (that crashed Sparrow hard):

sparrow = app('Sparrow')
sparrow.activate()
sparrow.help()
msg = sparrow.make(new=k.outgoing_message, with_properties={k.subject:"Foo", k.content:"Bar"})
msg.make(new=k.to_recipient, at=msg.to_recipients.end, with_properties={k.name:"foo at bar.com"})
msg.sendmessage() 

Any help appreciated, thanks.

JDO 


More information about the Pythonmac-SIG mailing list