• 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: Yvan KOENIG <email@hidden>
  • Date: Tue, 07 Jul 2015 18:56:12 +0200


Le 07/07/2015 à 18:24, Robert Poland <email@hidden> a écrit :

Hi,

I’ve been ignoring all the scripts about mail, now I need one.

Here is my attempt which errors, "access not allowed”;

tell application "Mail"
delay 0.2
set x to (count of visible messages in  “Inbox" of account 1)
say x
delay 0.2
set y to x is less than 18
delay 0.2
end tell
return y

Robert Poland
Fort Collins, CO

Hello Robert

(1) Here your code refused to compile. I'm not writing about the curly quote but about the word mailbox missing before "Inbox" (which as far as I know is spelled "INBOX")

(2) As far as I know, visible messages aren't belonging to a mailbox but to a message viewer.

I tried :

tell application "Mail"
set currentViewer to item 1 of message viewers
log result --> (*message viewer id 24*)
count visible messages of currentViewer
end tell

and got error "Erreur dans Mail : Le gestionnaire AppleEvent a échoué." number -10000


Yvan KOENIG (VALLAURIS, France) mardi 7 juillet 2015 18:56:06


 _______________________________________________
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: Robert Poland <email@hidden>
References: 
 >Mail, count of visible messages (From: Robert Poland <email@hidden>)

  • Prev by Date: Mail, count of visible messages
  • Next by Date: Re: Save and restore Finder Window setup
  • Previous by thread: Mail, count of visible messages
  • Next by thread: Re: Mail, count of visible messages
  • Index(es):
    • Date
    • Thread