I'm trying to interact with the default Mail app using Javascript for Automation (JXA). I want to click on the first email in the list so that it opens in its own window. but clicking does nothing. The solution suggested here is what I tried and it does not work.
My code:
var se = Application("System Events");
var mail = se.applicationProcesses.byName("Mail");
mail.windows[0]
.splitterGroups[0]
.splitterGroups[0]
.groups[0]
.scrollAreas[0]
.tables[0]
.rows[0].click()
If I remove the click()
and use .select()
it will select the email from the menu, but clicking on the email list item itself just returns null
in the repl. I tried clicking on each of the inner uiElements
but this doesn't work either.