Automator Quick Action Help - Send file as e-mail attachment with the subject being the name of the file. Then add said file to specific folder location.

Appreciate any help with this. My workflow is as follows;


1) Create PDF file and save to desktop.


2) Send PDF file to a specific e-mail address(es), with the subject being the name of the file.


3) Add the file which I have just sent to a pre-selected specific folder location.


I know this is probably simple but I am really bad at using automator. Any help would be greatly appreciated and would make my life a lot easier every day.


Many thanks


MacBook Pro 13″, macOS 10.15

Posted on Jan 5, 2021 11:37 AM

Reply

Similar questions

8 replies

Jan 5, 2021 7:36 PM in response to smh9321

This is what I came up with:


The AppleScript is:

on run {input, parameters}
	set subjectInfo to {}
	tell application "Finder"
		repeat with oneFile in input
			copy name of oneFile to end of subjectInfo
		end repeat
	end tell
	set AppleScript's text item delimiters to {", "}
	return text items of subjectInfo as text
end run


This allows you to select more than one file, adding each to the Subject Line.

The problem with it is it will move the files before sending, so if you cancel the email, the files are already moved.

I couldn't make the move after because the new Mail message Action doesn't pass the input back out. The move Action passes the files through the Action so they can be processed further along.


If you don't enter a message, the file names get put into the message.

I set it to only accept PDFs so that acts as a filter for you picking something that is not a PDF. You could just use "files and folders," but that would allow you to possibly process unintended files.



Jan 6, 2021 8:08 AM in response to Barney-15E

Thank you so much for this. Extremely helpful and working well.


I have one more question and I realise this might be impossible.


After sending the file is it possible to forward a sent receipt to a different e-mail address (without the attachment) or would I have to do this manually?


At work we have to prove to the office that we have sent the file to the destination. They don’t like attachments as it “clogs up their inbox” apparently.


Again, many thanks for your help which will no doubt make my life a lot easier in the long run.

Jan 6, 2021 11:53 AM in response to smh9321

I would suppose you could just add another New Mail Message after the first one, address it as needed, and put the "Filename" variable wherever you need it, Subject or Body.


If you need to actually forward the Sent message from previous, I don't think there would be a way to do that in automator.


Someone with better AppleScript skills than me might be able to go fetch the sent message that matches the subject and tell Mail to forward that, but I don't know how.

Jan 22, 2021 2:27 PM in response to Barney-15E

This is fantastic. The only hiccup I'm getting is that the file seems to only be text (it's filename) in the body of the email rather than a PDF attachment.


I don't need it to move location, however I've tried it with and without moving the document. I can't get either to work!


It seems to have worked for smh9321, so I'm just wondering if you have any idea what I'm doing wrong..


Thanks!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Automator Quick Action Help - Send file as e-mail attachment with the subject being the name of the file. Then add said file to specific folder location.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.