• 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: how many emails in Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how many emails in Mail


  • Subject: Re: how many emails in Mail
  • From: "Mohammad F. Haque" <email@hidden>
  • Date: Mon, 11 Feb 2002 23:09:12 -0500

global unread_mail

on run
set unread_mail to 0
tell application "Mail"
set total_messages to get count of every message of mailbox
"INBOX" of account "FooBar"
repeat with x from 1 to total_messages
set aMessage to message x of mailbox "INBOX" of account "FooBar"
set isRead to get is read of aMessage
if isRead is equal to 0 then
set unread_mail to unread_mail + 1
end if
end repeat
end tell
end run

unread_mail now holds the number of unread emails
works like a charm, man i'm starting to love applescript. thanks guys
for all the help.
_______________________________________________
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.

References: 
 >Re: how many emails in Mail (From: Douglas Wagner <email@hidden>)

  • Prev by Date: Re: shell script with top "can't get terminal attributes"?
  • Next by Date: Re: Create a folder with today's date as the folder name
  • Previous by thread: Re: how many emails in Mail
  • Next by thread: Re: how many emails in Mail
  • Index(es):
    • Date
    • Thread