I thought I could just do this:
tell application "Mail"
activate
end tell
Although I can see the Mail toolbar at the top. It hasn’t brought the mail app to the front to be fully visible.
My recorder doesn’t work for some reason too, so I can’t use that to find out what I need to do.
How can I do this?
You probably have closed the mail window so when you activate the application there isn’t any open windows to show. As such you have to open one yourself. Note that the main window in mail is called a "message viewer". Try this…
AppleScript:
JXA:
By the way, the recorder doesn’t work in most applications so I’m not surprised to hear that it doesn’t work for Mail. An application author has to code this ability into the program and most developers (including Apple) do not do this.