[Mac Mail] Identifying cursor field / active field

I’m writing a script which will create a jira link when launched from the body of the email.

However, I’d like to put an ‘if’ statement in there which instead, places the jira ID and title when the cursor is in the ‘Subject’ field.

How can I identify if the cursor focus is set on the subject line?