Command [type] error

I created the following macro which:

  1. Opens Gmail in the browser
  2. It specifies the sender because I can send from several accounts
  3. It types the email address in the ‘To’ field
  4. It enters an subject for the email
  5. It types ‘Hi John, this is just a template’ in the body
  6. It sends the email by pressing CMD+ENTER

Problem
It’s not entering the text in the body

This is the HTML when the email is empty:
image

This is the HTML after I ran the macro:
image

This is the HTML when I type the text manually – right way to do it:
the following screenshot shows a different id (id=":vn") because I refreshed the page. don’t pay attention to the different id.

It looks like that <div dir="ltr"> is making the difference. Any way to fix it?

Macro

{
  "Name": "Foro - Gmail",
  "CreationDate": "2020-5-24",
  "Commands": [
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "comment",
      "Target": "open // https://mail.google.com/mail/u/0/#inbox?compose=new",
      "Value": ""
    },
    {
      "Command": "comment",
      "Target": "waitForPageToLoad // ",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "name=from",
      "Value": "sender@domain.com"
    },
    {
      "Command": "type",
      "Target": "name=to",
      "Value": "\"Test user\" <address@gmail.com>"
    },
    {
      "Command": "type",
      "Target": "name=subjectbox",
      "Value": "Testing email subject"
    },
    {
      "Command": "type",
      "Target": "name=body",
      "Value": "Hi John, this is just a template"
    },
    {
      "Command": "XType",
      "Target": "${KEY_CMD+KEY_ENTER}",
      "Value": ""
    }
  ]
}

I suggested to use XType to get around all the Javascript “stuff” on Gmail.
So replace

“type”, “name=body”, “Value”: “Hi John, this is just a template”

with

  • XClick | name=body (to set focus, a normal CLICK probably also works ok and is faster)
  • XType | Hi John, this is just a template