This code used to work just fine:
...
set theContact to grep("^Client Name:\\s+(.*)\\n", theContent, "\\1", {})
...
on grep(findThis, inThis, returnThis, regex_flags)
try
return find text findThis in inThis using returnThis regexpflag regex_flags with regexp and string result
on error errMessage number errNumber
if errNumber is equal to -2763 then
return ""
else
display dialog (errMessage)
end if
end try
end grep
Once I put the first section of code inside a tell block…
tell application "Mail"
...
set theContact to my grep("^Client Name:\\s+(.*)\\n", theContent, "\\1", {})
...
end tell
…I get an error '“^Client Name:\s+(.*)\n” doesn’t understand the <> message. Please note that “find text” is provided by the Satimage scripting extension.
What am I missing?