Wondering how to get message count in local Inbox

D

dmarcantonio

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
Email Client: Exchange

Does anyone know the AppleScript wording to see if a user has anything in their local Inbox vs. their Exchange Inbox. The place I work for needs to figure out how many of our users in the office have local messages in the On My Computer inbox. The users may not know if we asked, but figured an AppleScript with the right context run on their computer would be more helpful. Any ideas on the AS wording?
 
D

Diane Ross

Does anyone know the AppleScript wording to see if a user has anything in
their local Inbox vs. their Exchange Inbox. The place I work for needs to
figure out how many of our users in the office have local messages in the On
My Computer inbox. The users may not know if we asked, but figured an
AppleScript with the right context run on their computer would be more
helpful. Any ideas on the AS wording?

The number is shown at the bottom left of the main window. They could select
all to show all messages.
 
J

John Mayson

I have an Apple Script that shows how many messages are in Apple Mail. I
know this isn't exactly what you're looking for, but perhaps you could
modify it.

John
 
E

Ed Kimball

The number is shown at the bottom left of the main window. They could select
all to show all messages.

That count is not exact (at least in E 2004) if the user has View > Arrange
by... > View in Groups. In that case, the count includes the headers as
"selected" as well as the actual messages!
 
M

mrove

Yes, you can get the local mail folder message count in Entourage using AppleScript like this:

tell application "System Events" to set EntourageIsRunning to (name of processes) contains "Microsoft Entourage"
if EntourageIsRunning is false then
do shell script "echo Entourage is not running on this Mac"
else
tell application "Microsoft Entourage"
set dInbox to count every message of inbox folder
set dDrafts to count every message of drafts folder
set dOutbox to count every message of outbox folder
set dSentItems to count every message of sent items folder
set dDeletedItems to count every message of deleted items folder
set dJunkMail to count every message of junk mail folder
set dFullname to full name of last Exchange account
end tell
set dMessageCount to dInbox + dDrafts + dOutbox + dSentItems + dDeletedItems + dJunkMail
do shell script "echo " & dFullname & return & "Inbox = " & dInbox & return & "Drafts = " & dDrafts & return ¬
& "Outbox = " & dOutbox & return & "SentItems = " & dSentItems & return & "DeletedItems = " & ¬
dDeletedItems & return & "JunkMail = " & dJunkMail & return & "Total Message Count = " & dMessageCount
end if

If you'd like to send it out via Apple Remote Desktop using osascript then use this format:

osascript<<END
tell application "System Events" to set EntourageIsRunning to (name of processes) contains "Microsoft Entourage"
if EntourageIsRunning is false then
do shell script "echo Entourage is not running on this Mac"
else
tell application "Microsoft Entourage"
set dInbox to count every message of inbox folder
set dDrafts to count every message of drafts folder
set dOutbox to count every message of outbox folder
set dSentItems to count every message of sent items folder
set dDeletedItems to count every message of deleted items folder
set dJunkMail to count every message of junk mail folder
set dFullname to full name of last Exchange account
end tell
set dMessageCount to dInbox + dDrafts + dOutbox + dSentItems + dDeletedItems + dJunkMail
do shell script "echo " & dFullname & return & "Inbox = " & dInbox & return & "Drafts = " & dDrafts & return ¬
& "Outbox = " & dOutbox & return & "SentItems = " & dSentItems & return & "DeletedItems = " & ¬
dDeletedItems & return & "JunkMail = " & dJunkMail & return & "Total Message Count = " & dMessageCount
end if
END
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top