Automation - Send Files to a Watch Folder…and bring them back

I’ve said a few times: anything you do more than once, a computer should be able to do for you. The catch there is that it has to be the exact same task. Any variable to a task makes it that much harder to automate.

Such is the case for a simple task I as a video editor come across with pretty much every project: transcoding deliverables from a master file.

To spell it out, the workflow goes something like this: set up a watch folder in a transcoding app to convert your high-res master file to a compressed deliverable. Any video file that is moved or copied into that watch folder triggers the transcoder to do its job. When it’s done, the new file is created in an Output folder within the watch folder (so that it doesn’t trigger the watch folder again) and the source file is moved to a Source folder within the watch folder. Then, you either move the source back to the project folder or delete it if it was a copy, and move the deliverable file to the folder it needs to go to. So everytime the watch folder runs, you have two files, the source and the new output, and each of those files need managing at some point.

This is super easy (much easier than I just explained it). But I wanted to make it easier. Because you really reap the benefits of automation from processes that are frequently performed. Both in time savings and accuracy.

The tool to get this done is Automator 1, which comes with every Mac. Here’s the screenshot of the automation, (you may need to download the image to see it in detail) and a download link below 2.

I’m sure there’s better ways to do this, but this is what finally worked for me. Finding the right Applescript was the key, which I found in this forum post from 2008. Computers can be reliable sometimes.

Send to Watch Folder AutomationSend to Watch Folder Automation

My new automation will—with one click—copy the master file to the watch folder and then when it’s done transcoding, ask you to confirm and (this is the exciting part =) take the new output file and puts it back into the original folder the source master came from, and then delete the copied master from the source folder.

Which when I spell it out like that, makes me feel like it’s actually doing a lot. It’s really just copying and moving files around, but it’s the variable component that makes this useful to me. I now have a button anywhere in my file system 3 to send a file to a watch folder on my desktop and then a confirmation window will appear to move the new transcode back to the folder (any folder!) the source file came from, and then even delete the copied source.

Two things that threw me off in figuring this out; one: the applescript. I thought I could do it without going to code, but this was the only way that worked for me. I did not write a character of it, just copy paste. And two, I did not realize how to make one step ignore the previous input. You do that by right-clicking on the little connection tabs between steps. That’s how I made two separate variables, one for the folder path where the new file should go back to, and one for the source file to be transcoded.

If you’re new to Automator and want to try this out, first, know that I have this set to delete the copied source media, so note that if you move your source rather than copy it to a watch folder, this is deleting the source. Then, open Automator on your Mac, and open my automation with the File > Open command. Then customize it to your liking; you’ll probably want/need to pick a new watch folder (I keep one on my desktop) and if you Save As, you can rename it to what you want. Notice at the top where it says what kind of file it recieves and in which app, since this is a Quick Action, that means when you right click on a video file in the Finder, you’ll see this Automation under services in that menu, and the menu name is the name of this Automator file. You’ll need to save it to the services menu in your system, see the link below on the specifics.

I’m pretty happy with how this is working, now on to find the next automat-able task.


NOTE: please go through this and make sure it is doing what you want; I usually copy my source media to my watch folder so this automation automatically deletes the copied source media. So if you move your source instead of copy it, this automation will move that source to the trash.


  1. Automator Manual↩︎

  2. Download my automation!↩︎

  3. Install a systemwide service↩︎



Date
November 17, 2021