Re: need a fix in this entourage script
Re: need a fix in this entourage script
- Subject: Re: need a fix in this entourage script
- From: Jean-Baptiste Le Stang <email@hidden>
- Date: Tue, 21 May 2002 16:27:22 +0200
You might try the following script but there is surely a better way to do
it.
You're also trying to increase the id of your folders 1 by 1 which is not
the case, that's why I have an handler dedicated to making the list of the
id of every folders
Jean-Baptiste LE STANG
global pidlist
global umc
set umc to 0
tell application "Microsoft Entourage"
set IdOfFolders to ID of every folder
repeat with x in IdOfFolders
set IdOfFolders to IdOfFolders & my explorefolder(x)
end repeat
IdOfFolders
display dialog ((my calculate_unread_message_count(IdOfFolders)) as
string) & " unread messages"
end tell
on explorefolder(this_folder_id)
tell application "Microsoft Entourage"
try
set pidlist to (ID of every folder in folder id this_folder_id)
repeat with y in pidlist
set pidlist to pidlist & my explorefolder(y)
end repeat
on error
return {}
end try
end tell
end explorefolder
on calculate_unread_message_count(thoose_folders_id)
tell application "Microsoft Entourage"
repeat with x in thoose_folders_id
set umc to umc + (unread message count of folder id x)
end repeat
end tell
end calculate_unread_message_count
>
Hi!
>
>
I am a cocoa developer playing around with AppleScript. Now want to get
>
all unread count from my Entourage mailboxes. I wrote this little script:
>
>
> property FolderCount : 0
>
> property UnreadCount : 0
>
> property FolderNumber : 0
>
> property TotalUnreadCount : 0
>
>
>
> on activated theObject
>
> tell application "Microsoft Entourage"
>
> set FolderCount to number of folders
>
> repeat FolderCount times
>
>
>
> try
>
> set FolderNumber to (FolderNumber + 1)
>
>
>
> set UnreadCount to unread message count of folder id (FolderNumber)
>
> set TotalUnreadCount to TotalUnreadCount + UnreadCount
>
>
>
> end try
>
> end repeat
>
> end tell
>
> tell window "mailwindow"
>
> set contents of text field "foldercounter" to TotalUnreadCount
>
> end tell
>
> end activated
>
>
No what I thought I was doing is that I get how many folders I have in
>
Entourage (starting with id 1 as the inbox...), then repeat my script as
>
many times as i have folders, and get the unread count of each
>
individual folder, add them up and write out my unread count to my text
>
field in my window. Now this is not happening. In fact all that's going
>
on is that Entourage keeps crashing and quitting everytime I run the
>
script. The strange thing is that if i put an integer, like 1 or 2
>
instead of FolderNumber, the app works, but only for the folder I
>
specified the ID for. So I guess my syntax is alright, by why does
>
Entourage keep crashing on me?
>
>
Thanks in advance for all comments,
>
stupidFish23
>
_______________________________________________
>
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.
_______________________________________________
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.