tell application "Mail"
set emailSelection to (get selection)
set theText to content of (item 1 of the emailSelection)
set subText to paragraph 1 of theText
end tell
Я получаю сообщение об ошибке сказав:Applescript: (. Не может сделать пункт 2 [...] в текст типа Unicode)
(Can’t make paragraph 2 of "Below is the result of your feedback form. It was submitted by" into type Unicode text.)
Примечание пункт 2 разница пункт 1 также.
РЕДАКТИРОВАТЬ
Кроме того, только пытался копировать содержимое содержимое сообщение в новый объект (без ссылок), чтобы удалить любой объект специфической странности. Но сообщение об ошибке по-прежнему ссылается на сообщение Mail, а не на новый объект, который, как я думаю, ошибочен.
try
tell application "Mail"
set emailSelection to (get selection)
set theMessage to (item 1 of the emailSelection)
log "1 ****** " & return & content of theMessage
copy contents of (item 1 of the emailSelection) to theText
log " 2 ****** " & return & content of theText
set subText to (the first paragraph of theText)
log " 3 ****** " & return & content of theText
-- set subText to paragraph 1 of theText as Unicode text
end tell
on error the error_message number the error_number
display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
end try
тзд Ошибка:
Error: -1728. Mail got an error: Can’t get paragraph 1 of message id 740166 of mailbox "INBOX" of account "IMAP PL…".
Я также попытался добавления «в строке» на 4-й строке: та же ошибка –
ли эту работу на любых других писем, кроме этого. Кроме того, эта обратная связь формирует то, что мы можем получить, чтобы получить от нее электронное письмо для тестирования. – markhunte