I am trying to figure how to get the names of my mail Accounts that are enabled. The short script below works to get the names of all my accounts but i have the two lines commented out that give me an error when I try to just get the enabled ones. I checked in the forms and can’t seem to find anything that helps and I don’t quite understand what show up in the Dictionary.
PolishPrince
tell application "Mail"
set everyAccount to name of every account
--set enabledAccount to everyAccount whose {properties, enabled} is equal to true
repeat with eachAccount in everyAccount
display dialog eachAccount -- as Unicode text
--display dialog enabledAccount -- as Unicode text
end repeat
end tell
Hi
Does this do what your looking for ?
tell application "Mail"
set enabledAccount to name of every account whose enabled is true
repeat with eachAccount in enabledAccount
display dialog eachAccount as Unicode text
end repeat
end tell
Mitchellmultari
This is what i was looking for. It looks so easy once you see it done. Thank you for the reply and the quick response.
PolishPrince
Acknowledging that I’m bored, I’ve prettified Michell Multari’s correct answer.
tell application "Mail"
set enabledAccount to name of every account whose enabled is true
set tid to AppleScript's text item delimiters
set AppleScript's text item delimiters to return & "¢ "
set tAns to enabledAccount as rich text
set AppleScript's text item delimiters to tid
display dialog "The open email accounts are:" & return & return & "¢ " & tAns
end tell
Adam
I will be saving this code as an example because it is very neat the way you used the TID and the * to do the list in the dialog.
Thanks,
PolishPrince