• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: exists mailbox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exists mailbox


  • Subject: Re: exists mailbox
  • From: Luther Fuller <email@hidden>
  • Date: Fri, 23 Oct 2009 12:33:37 -0500

On Oct 23, 2009, at 8:26 AM, Christopher Stone wrote:

On Oct 23, 2009, at 07:19, Luther Fuller wrote:
On Oct 22, 2009, at 6:52 PM, Christopher Stone wrote:
BTW: How are you managing to reference the front message viewer?

That's just the variable name I use for ... set frontViewer to (message viewer 1)
______________________________________________________________________

Ah.  On Leopard 'message viewer 1' does not mean the front message viewer (and neither does 'front message viewer'), so watch out if you have more than one open.

I was wrong. Using ...

set frontViewer to (window index 1)

does not work, either. So, I did some experiments. It seems that, while message viewer windows appear in the indexed list of all windows, message viewer windows have a different indexing scheme when you try to get only message viewer windows.

Finally, I arrived at this handler which returns the frontmost message viewer but which may not be the frontmost window. (It may be covered by a message window.)

on getFrontViewer()
tell application "Mail"
repeat with i from 1 to (count windows)
try
(some message viewer whose index is i)
return the result
end try
end repeat
end tell
error "A message viewer window must be open in Mail."
end getFrontViewer -------------------------

This is much more complex than necessary and indicates a bug in the window indexing scheme.
(Also, the Mail dictionary says that window indexing is in back to front order. No. Window index 1 is the frontmost window.)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >exists mailbox (From: Luther Fuller <email@hidden>)
 >Re: exists mailbox (From: Brian Christmas <email@hidden>)
 >Re: exists mailbox (From: Luther Fuller <email@hidden>)

  • Prev by Date: scripting QT7 Pro to export (or print?) frames as PDFs?
  • Next by Date: Re: watermark
  • Previous by thread: Re: exists mailbox
  • Next by thread: problem with font
  • Index(es):
    • Date
    • Thread