mark all mail inside subfolder groups as read?

P

Peter Minter

i'd like to mark all mail inside all my mail subfolders as 'read' - without
having to select each folder individually. the option-apple-T command only
seems to work on a folder that does not contain nested subfolders.

maybe i'm missing something? any advice welcome
 
D

Dave Cortright

i'd like to mark all mail inside all my mail subfolders as 'read' - without
having to select each folder individually. the option-apple-T command only
seems to work on a folder that does not contain nested subfolders.

maybe i'm missing something? any advice welcome

Try this (thanks to Paul for the GetSubfolder routine):

--Mark all messages in selected folder and its subfolders as read
tell application "Microsoft Entourage"
try
if class of window 1 is not browser window then return
set theFeature to displayed feature of window 1
on error
return
end try
if class of theFeature is folder then
set flattenedFolderHierarchy to my GetSubFoldersOf(theFeature)
repeat with theFolder in flattenedFolderHierarchy
set read status of every message of theFolder to read
end repeat
end if
end tell

on GetSubFoldersOf(aFolder)
tell application "Microsoft Entourage"
set subList to {aFolder}
if (every folder of aFolder) ‚ {} then
set subFolderNames to (name of every folder of aFolder)
repeat with j from 1 to count of subFolderNames
set subFolderName to item j of subFolderNames
set subFolder to folder subFolderName of aFolder
set end of subList to subFolder
set subSubList to my GetSubFoldersOf(subFolder)
if (count of subSubList) > 1 then set subList to (subList &
rest of subSubList)
end repeat
end if
end tell
return subList
end GetSubFoldersOf
 
Top