AppleScript Property for Mail not found with Catalina

Hello,

i have some script which reads the active email adresses from apple mail. The code looks like this:


set text item delimiters to ";"
tell application "Mail"
  set email_accounts to {}
  repeat with acc in accounts
  set emailAdresses to (email addresses of acc) as rich text
  if enabled of acc then
  set end of email_accounts to (id of acc) & ":" & emailAdresses
  end if
  end repeat
  email_accounts
end tell


This versions runs until catalina without a problem. Now it looks like "enabled of acc" which means the property Enabled of an email account couldn't found any more.


The failure is

error "Mail got an error: AppleEvent handler failed." number -10000


How could this be fixed ?

Replies

This looks like a bug to me. The following script fails in a similar way:

tell application "Mail"
    set acc to account 1
    enabled of acc
end tell

Please file a bug report about this, and then post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"