Shortcuts - Send email when I add a file to folder

Hi - I can't work out how to set up a MacOS Ventura shortcut that automatically sends an email to another person, when I add a video file to a specific shared folder, with the title of the file.


Is there a resource I can use to go through a step by step for something like that?


Thanks in advance!

MacBook Pro Apple Silicon

Posted on Jan 12, 2023 11:17 PM

Reply
25 replies

Jan 13, 2023 7:52 PM in response to RonEdwards

Maybe it doesn't recognize that video file as a "Movie."

Drag in a Get Specified Finder items above Filter Finder Items. Add that same file.

Click on Results for the Filter Finder Items, and Step through the actions until the Filter Finder Items finishes. See if that file shows up in the Results. If it doesn't, we might have to fiddle with the Filter criteria so it finds your video files. For instance, you can use File Extension instead of Kind. You can also change All of the Following to Any of the following and add multiple file extensions if needed.


Once you figure out the filter criteria necessary, you can remove the Get Specified Finder Items.


Jan 13, 2023 6:34 PM in response to RonEdwards

Open Automator and create a new Folder Action. Choose the folder for it to work from in the top of the workflow pane.

From the Files and Folders category, drag a Filter Finder Items to the workflow pane. Set the criteria (kind is Movie).

From the Utilities category, drag in a Run AppleScript action. Replace all of the script with:

on run {input, parameters}
	set filenames to {}
	tell application "Finder"
		repeat with aFile in input
			copy name of aFile to end of filenames
		end repeat
	end tell
	set text item delimiters to ", "
	return filenames as text
end run

From the Mail Category, drag in a New Mail Message action. Set it up the recipients, Subject, and account.

Drag in a Send Outgoing Messages action.

Save it.

Jan 23, 2023 4:01 AM in response to RonEdwards

In those screenshots, you don’t have a get specified finder items passing a movie file into the workflow. If you’re running it from Automator, you have to have that in order to test.

Place I get specified finder items, action at the top of the workflow, add a movie file to it, and then run it.

if the movie file doesn’t keep getting passed through each action, then we can tell where it gets caught up. Once we determined that we may be able to fix it, so it works when you drop a file into the folder.

Jan 14, 2023 6:07 AM in response to Barney-15E

I'm getting the same thing. I added a Reveal Finder Items after the Filter Finder Items.

It selects the files you dropped, but it does then add the name to the email.


The Filter Action has had problems in the past where it doesn't seem to work. This may be some manifestation of that age-old problem. It's odd that it worked from a Get Specified Finder Items.


Revealing the items is somewhat annoying as you'll get the window opening and the items selected, but it seems to do what you need. I'll see if I can find a less obtrusive way.

Jan 20, 2023 7:25 PM in response to RonEdwards

Hi - yes, it's the correct folder set-up. I don't think I have “Get Specified Files” set up, so that's ok?

No, you just need it for testing/troubleshooting. You can add it with a Movie file specified, then run it in Automator to see if it creates the email correctly. If that works, we can try to figure out why the folder action doesn't pick up the added file.

So it's still not adding the file name to the body of the email - why would that be?

I don't know. Can you take a screenshot that includes all of the actions. You a collapse the New Mail Message action by clicking on the carat at the top, left of the action. I don't need to see what is in that.

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.

Shortcuts - Send email when I add a file to folder

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