Error -10000 for NSAppleScriptMBS

Why does one user get an error -10000 when running an AppleScript that gets the accounts from Mail:

with timeout of 10000 seconds

tell application id “com.apple.mail”

set theAccounts to (get accounts)

set AccountInfo to {}

repeat with theAccount in theAccounts

set theName to name of theAccount

set end of AccountInfo to theName

end repeat

return AccountInfo

end tell

end timeout

The script is super simple and I do the script like every day. I already had him restart the computer. The permissions for Automation have been set correctly.

I’m out of ideas. Unfortunately, my app needs this AppleScript before anything else can be done if the user wants to archive emails from Mail.

Isn’t very helpful either… “errAEEventFailed”. I’d start by asking him to run a test script from Script editor. If that doesn’t work, then the system has issues. If it works, then it might be a TCC issue.

Executing the script directly works fine.

If you don’t care debugging with your user, you could have a test script, based on the one you showed above, that:
1: has “try”, “on error etxt number enum” and “end try” statements (“try” as the very first line and the others at the end, like in Xojo).
2: initialise a variable to count each line (or section), as you think is best.
3: in the “on error etxt number enum” statement, display a dialog showing etxt, enum and the last line number your code has set.

As in Xojo, you can then point out the offending line and start investigating from there, as the execution will jump directly to the “on error” handler when the problem occurs.

HTH.