On Mar 19, 2008, at 6:40 PM, Philip Aker wrote: On 08-03-19, at 14:31, Christopher Nebel wrote: On Mar 19, 2008, at 1:10 PM, Vince Angeloni wrote:
I thought applications were not supposed to make themselves visible when launched via applescript in Leopard unless they are specifically "activated." I have seen this work with iCal, but it seems to fail with Mail here:
tell application "Mail" set newMessage to make new outgoing message with properties {subject:"test", content:"mytext"} tell newMessage make new to recipient at end of to recipients with properties {name:"yourNameHere", address:" email@hidden"} end tell end tell
Applications do launch hidden in Leopard, and Mail did in fact launch hidden, but there's nothing to say that an application can't make itself visible in response to a command. In this case, you implicitly told it to show by not specifying "visible:false" in the outgoing message properties. That said, it wouldn't have worked right even if you did, because Leopard Mail seems to always show the new message at least briefly, so that's a bug in Mail.
tell application "TextEdit" to launch -- launches hidden tell application "Mail" to launch -- always launches shown
Mail doesn't launch hidden.
Actually, it does launch hidden, though you can't really tell unless you have the Sooper Sekrit™ option turned on to dim hidden applications, because it immediately barges its way into visibility anyway, presumably thanks to showing a viewer window. I guess I have to write another bug.
--Chris Nebel AppleScript Engineering
|