How to find and open an email in Apple Mail with a specific word in the subject line

Hello,

I wrote a macro to process (open a URL link in the email, etc) a specific type of email containing the term 'POEM:' at the beginning of the subject line (POEM is a technical acronym; I am not a poet). Please note that the text following POEM: in the subject line varies with each email I have to process.

The macro works fine if I open apple mail and highlight the email in question.

I would like to add the following instructions to the beginning of the macro:

  • activate apple mail (no problem, I know the action)
  • go to the the inbox, search for and highlight the email whose subject starts with POEM: (there will be only one such email at any one time).
  • open that email (just type return which I know how to do in a macro).

after that, I will run the rest of the macro

thanks very much