Re: scripting mail to select mailboxes
Re: scripting mail to select mailboxes
- Subject: Re: scripting mail to select mailboxes
- From: "David P. Baker" <email@hidden>
- Date: Thu, 13 Mar 2003 15:35:14 -0500
Wait wait! If windows appear in front-to-back order, then their
placement in the list will change as you focus different windows. If
the message viewer list is in creation order, then it won't. In fact,
the example you show has this exact behavior: window id 1 (the top
window) is the same as window of message viewer 4 (the last created
window). It makes perfect sense, and is actually reasonable, since
sometimes you want to refer to the windows by z-order, and sometimes to
the objects by order of creation (the only problem being that if you
want to get to the underlying message viewer of the topmost window,
it's hard: you have to loop through the message viewers to get the one
whose window is window 1. and yes, i've tried doing message viewer
whose window is window 1, and it doesn't work).
And you say message viewer is a special case of window, but message
viewer is defined as a subclass of item, not window, in the dictionary.
Maybe that's not as it should be (presumably it's an instance of a
window controller in the underlying Cocoa object model), but there it
is.
--dpb
On Thursday, March 13, 2003, at 02:40 PM, John Delacour <email@hidden>
wrote:
At 10:04 am -0500 13/3/03, David P. Baker wrote:
Actually, I think I figured out that message viewer 1 is the first
message viewer in order of creation (in what must be an array of
viewers), but the WINDOWS are in front-to-back order (although the
dictionary says "back-to-front order"). So if message viewer A is
the front window, then window 1 = window of message viewer A. That
should clear up your problem with ordering of message viewers..
I have no problem! Mail has the problem because Mail is rewriting
all the rules. Window 1 has always been the front window and the
latest created, document ditto. It is ridiculous to expect users to
regard as reasonable a back-to-front arrangement of message viewers,
which after all are just windows with special properties. It's
debatable whether the class is necessary at all, just as 'all
messages' has been declared redundant. No discipline is evident in
the whole spitting match.
tell application "Mail"
close windows
repeat 4 times
make message viewer
end repeat
set ls to {return}
repeat with i from 1 to 4
set end of ls to {id of window of message viewer i, id of window
i}
set end of ls to return
end repeat
return ls
end tell
{"
", {2306, 2320}, "
", {2312, 2316}, "
", {2316, 2312}, "
", {2320, 2306}, "
"}
_______________________________________________
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.