How to copy URL for the latest item sent from Gmail

Let me share a scenario and please let me know if you see a way to automate it through TextBlaze (especially given that I have the Gmail packet):

Every Gmail message has its own URL. I leverage this feature on a daily basis. When I want to document that I sent a certain email or want to access a sent message when I need to perform a task related to it, I take the following action:

  1. Send the message.
  2. Click on "Sent items"
  3. Click on the email I just sent. (It would be the first one in the list.) Clicking on the email displays the URL for that email in the address bar.
  4. Use Ctrl + L to place the cursor in the address bar and highlight the URL.
  5. Use Ctrl + C to copy the URL.

At that point, I am free to paste that URL in an Evernote note, the note section of a task, etc.

I am hoping to construct a snippet that would automate the key presses I am doing manually. Thanks for any help you can provide.

Hi @frank1
This is somewhat brittle, but try it.
You trigger the snippet when sending the email (the snippet will send the email for you).
It doesn't copy the url, but will type it in the search box and select it, so you only need to copy it.
I'm waiting 5 seconds after sending because it takes a few seconds for the email to show up in sent items.

{gmail-send}{wait: delay=+5s}{key: g}{key: t}{key: enter}{click: selector=[name="q"]}{key: cmd-a}{site: url}{key: cmd-a}