• 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: Mail, count of visible messages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail, count of visible messages


  • Subject: Re: Mail, count of visible messages
  • From: Christopher Stone <email@hidden>
  • Date: Wed, 08 Jul 2015 10:57:24 -0500

On Jul 08, 2015, at 09:59, Patrick Stanford <email@hidden> wrote:
The problem seems to be with Visible Messages.
______________________________________________________________________

Hey Pat,

Visible messages works fine on 10.9.5 at least (I hope a new bug has not been introduced in Yosemite).

---------------------------------------------------------------------------------------
# Test for MailHub Plug-In — adjust if necessary.
---------------------------------------------------------------------------------------
try
  alias ((path to library folder from user domain as text) & "Mail:Bundles:MailHub.mailbundle:")
  set offsetForMailHub to 1
on error
  set offsetForMailHub to 0
end try
---------------------------------------------------------------------------------------

tell application "Mail"
  set frontMsgVwr to some message viewer whose index is 1 + offsetForMailHub

  

  tell frontMsgVwr
    set visibleMessageCount to count of visible messages
  end tell

  

end tell

---------------------------------------------------------------------------------------

* Note that if you have the MailHub Plug-In installed it will alter the indexing of Mail-Viewer Windows.

I actually don’t know what the visible messages is supposed to return, but it does not seem to work in any context.  Is it supposed to give only the messages that can be seen in the message viewer or all of the messages that can be scrolled to?

On my 10.9.5 system it gives all messages currently available in the message list of the Message-Viewer-Window — including those NOT VISIBLE behind the Preview Pane.

It will also work with messages shown via Seach or via Smart-Mailbox, so it does have its uses.

Note that it is dangerous to refer to Message-Viewers in this way:

tell application "Mail"
front message viewer
first message viewer
message viewer 1
end tell

Because these will NOT refer to the FRONTMOST Message-Viewer if more than 1 Message-Viewer-Window is open.

Open two or more and point them to different mailboxes — then iterate through these to see it in action.

tell application "Mail"
name of front message viewer
name of first message viewer
name of message viewer 1
end tell

--
Best Regards,
Chris

 _______________________________________________
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

  • Follow-Ups:
    • Re: Mail, count of visible messages
      • From: Yvan KOENIG <email@hidden>
References: 
 >Mail, count of visible messages (From: Robert Poland <email@hidden>)
 >Re: Mail, count of visible messages (From: Luther Fuller <email@hidden>)
 >Re: Mail, count of visible messages (From: Yvan KOENIG <email@hidden>)
 >Re: Mail, count of visible messages (From: Patrick Stanford <email@hidden>)

  • Prev by Date: Re: Mail, count of visible messages
  • Next by Date: Re: Mail, count of visible messages
  • Previous by thread: Re: Mail, count of visible messages
  • Next by thread: Re: Mail, count of visible messages
  • Index(es):
    • Date
    • Thread