该错误通常出现在使用AppleScript发送电子邮件时,因为发件人或收件人参数被错误地指定为不支持的类型。解决方法是确保将发件人和收件人参数指定为字符串类型。例如:
set recipientAddress to "jdoe@example.com" set recipientName to "John Doe" set senderAddress to "jsmith@example.com" set senderName to "Jane Smith"
tell application "Mail" set theMessage to make new outgoing message with properties {subject:"Test email", content:"This is a test email."} tell theMessage make new to recipient with properties {name:recipientName, address:recipientAddress} make new from recipient with properties {name:senderName, address:senderAddress} send end tell end tell
在以上代码示例中,使用了字符串类型的参数来指定发件人和收件人。这应该可以解决“Unrecognized direct parameter type”错误。