Want to return all the email addresses in Mail application. Have written a scrip that does half the job but if an account has more than one address it treats it as one.
This is my scrip any suggestions appreciated.
set emailAddressList to {}
tell application "Mail" to set numberOfAccounts to (count of accounts)
repeat with accountNumber from 1 to numberOfAccounts
tell application "Mail"
set theaccount to account accountNumber
tell theaccount
set eMailList to {email addresses}
set end of emailAddressList to eMailList
end tell
end tell
display dialog emailAddressList as string
end repeat
set listcount to number of items in emailAddressList
display dialog listcount
display dialog item 1 of emailAddressList as string
In my particular case I have 4 accounts one of which has 2 addressees so 5 addresses in total but the Display Dialog listcount only shows 4 the number of accounts I have not the addresses.
Thanks Peter