this I know is going to be a very dumb question but I cannot figure out the correct syntax to count the number of messages in a mailbox. My efforts are shown in the following script none of which have worked.
tell application "Mail"
set m_boxes to the name of every mailbox
set this_box to choose from list ((m_boxes))
set y to ((count of (messages of this_box)) as string)
set y to (count of every message in this_box)
set y to count every message of this_box
set y to count (messages of this_box)
set y to count messages in this_box
display dialog y
end tell
I would appreciate any suggestions.
Thanks
Peter