I have the following script for replying to emails:
set myReply to "Override"
set theSender to "Me <me@gmail.com>"
tell application "Mail"
set theSelection to selection
if theSelection is {} then return
activate
set myList to {}
repeat with thisMessage in theSelection
if (extract address from sender of thisMessage) is "watson@gmail.com" then
set theOutgoingMessage to reply thisMessage with properties {visible:true, sender:theSender}
delay 1
tell application "System Events"
keystroke myReply
delay 1
end tell
send theOutgoingMessage
delay 1
set myList to myList
delay 1
end if
end repeat
end tell
How can I find a specific word in the whole body of the message when I don’t know in which paragraph it is exactly located? I want to find “incompatible classes”.