Re: scripting mail to select mailboxes
Re: scripting mail to select mailboxes
- Subject: Re: scripting mail to select mailboxes
- From: John Delacour <email@hidden>
- Date: Thu, 13 Mar 2003 11:56:07 +0000
- Mac-eudora-version: 6.0a11
At 10:50 pm -0500 12/3/03, David P. Baker wrote:
Sorry, I don't understand. I'm not inside a "tell message viewer"
block....
I know what the problem is.
In Applescript in "all" applications
the first thing = the front thing = thing 1
But Mail's developers have have not learned this rule. In Mail, the
front message viewer (or message viewer 1), may be the front message
viewer as we humans conceive of it, or it may not.
So if you run this script you will see that the front message viewer
clearly has no messages displayed, but Mail will report the
properties of another message viewer instead.
tell app "System Events"
set visible of processes whose name is not "Mail" to false
end tell
tell app "Mail"
set s1 to "Result of:" & return
activate
(* start afresh *)
close windows
(* try to get Mail to understand its own dictionary *)
make message viewer with properties {selected mailboxes:{sent mailbox}}
-- ONE LINE TILL -----
set s2 to "make message viewer with properties {selected
mailboxes:{sent mailbox}}"
------
display dialog s1 & s2 buttons "OK" default button 1
(* this doesn't work so close the window *)
close windows
set v1 to make message viewer
set selected mailboxes of v1 to {sent mailbox}
set v1's drawer is visible to true
set s2 to "set v1 to make message viewer
set selected mailboxes of v1 to {sent mailbox}
set v1's drawer is visible to true"
display dialog s1 & s2 buttons "OK" default button 1
(* Finally we have a result *)
make message viewer
set s2 to "make message viewer"
display dialog s1 & s2 buttons "OK" default button 1
(* which will obviously be the FRONT message viewer
and have no selected mailboxes *)
set MarchMadness to get selected mailboxes of the front message viewer
(* But Mail reports properties of the back message viewer *)
tell me to activate
return {"Selected mailboxes of the front message viewer:
", MarchMadness}
--> {sent mailbox of application "Mail"}
end tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.