I am trying to create an automator based workflow whereby I create archives of folders but exclude certain files from the final archive. I would also like to specify the files or folders to exclude (e.g. ".cvs" or ".git" or ".psd" etc).

Here's how I have currently tried to do it, but cannot get step2 below working:

  1. I specify a folder to scan and archive.
  2. Automator/script recursively filters out certain files which I can specify (e.g. ".cvs" or ".git")
  3. Automator creates an archive of the remaining files from step2.

Im certain there must be an easy way of achieving this with automator - any assistance would be appreciated.

  • Are you ok calling a script in Automator (or just doing this through a script)?
    – jmlumpkin
    Apr 8 '11 at 21:52

Automator won't be enough to do this.

You'll have to devise an applescript (or some other kind of script) to do the filtering, since the automator action "Filter Folder Items" will not work recursively. Any folder will not have the undesired extensions so will be added, even if the folder contains files with those extensions.

  • I kinda think this should be a comment since it doesn't give a functioning answer. It is good info, just not a full answer IMO. Apr 8 '11 at 18:58
  • Oh well. I wish I had known this before spending so much time trying to do this. I will leave the question open for a while, in case there's people out there that do know of a way. If there isn't any solution then I guess @ghoppe is right and I will select this as the corrent answer. hope
    – mozami
    Apr 8 '11 at 20:01
  • 1
    You can execute shell scripts or AppleScripts from Automator. So, don't abandon Automator altogether. You'll need to supplement the drag-and-drop stuff, but you can do it all from an Automator workflow. Apr 9 '11 at 1:29
  • 1
    Yep, Nathan's right. If you're using Automator for your workflow, you can still use it to run another script to do what you want. When I said it won't be "enough" I didn't mean you'd have to abandon it.
    – ghoppe
    Apr 9 '11 at 18:18

You must log in to answer this question.

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