1

I run some tests on my Mac that take several hours. When the tests are done, I want to send myself an email with a screenshot of the test results.

Here is how I configured my Automator App:

  1. New mail message (to me, subject: tests done, message: here are the results)
  2. Take screenshot (type: full screen, main monitor only, save to Desktop: latest-test-results)
  3. Add attachments to front message
  4. Send outgoing message

This doesn't work because when the screenshot is taken, the Mail app is already open and covering Terminal, which is showing the test results.

So I next tried this:

  1. Take screenshot (type: full screen, main monitor only, save to Clipboard)
  2. New mail message (to me, subject: tests done, message: here are the results)
  3. Get contents of clipboard
  4. Add attachments to front message
  5. Send outgoing message

For some reason, this action sends me an attachment that is a zip file containing the files on my desktop, but not the screenshot, which is apparently not saved to the desktop. I don't want a zip file; I want the actual screenshot, and obviously I don't want all the files on my desktop.

This seems like a simple task... what am I doing wrong? I want to take a screenshot and then email it to myself. The Automator app is triggered through a bash script that runs the tests.

macOS Ventura.

1
  • Have you thought about taking the screenshot first, then creating the email?
    – Allan
    Feb 21 at 15:59

1 Answer 1

2

So, I configured it as such, and it worked. It's saving to a file called "test". You could trash it after sending if you wanted too. This is all in automator, but if you're wrapping it in bash you could use the screencapture command to capture the image first, then trigger the automation to send it. Something like:

screencapture ~/desktop/out.png

Here's the working config:

Working Config

This produced this email (I had this question up in Safari), and you can see that it's not covered with the email window:

Resulting Email

1
  • I've been experimenting on similar lines, but you beat me to it. I found that the screens capture action in Automator cannot pass contents via clipboard to the Attach action, but needed an intermediate filename. Also, as you have found, take the screenshot first, otherwise you end up with a screenshot of the Mail app if you open that first! Feb 21 at 17:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .