3 Replies Latest reply: Nov 30, 2012 3:24 PM by rjonk
rjonk Level 1 (0 points)


Clean a folder from obsolete files. Go to sub directories and clean files in that subfolder.


When I want to delete selected files with automator I try to create a search and then use "move finder Items to trash" but after choosing that action I cannot find a way to do a second search and delete.

I can make a shell script to do this all but I try to do this in the GUI of automator.

Does anybody know how to return to the start folder and do a new search / delete action?

macbook pro, Mac OS X (10.6)
  • softwater Level 5 (5,370 points)

    I apologise in advance for this post, because I know how annoying it is when you ask a question and instead of a reply you get a 'why would you want do that?' But...


    If you know how to do this in a shell script, why would you bother doing it in Automator and applescript, which is only converting those commands into the shell script commands you already know how to write?

  • rjonk Level 1 (0 points)

    Somebody else needs to do the cleaning up multiple times and knows how to select the right mouse button and select a folder action as service or can drag a group of files in a folder with folder actions on it, but dont know how to use the terminal "gui". So I need a way to make it simple to do a multiple search and delete this way.

  • rjonk Level 1 (0 points)

    I found myself one way to do it with a variable. But maybe this can be quicker I don't know yet..

    • Create App
    • Select the folowing items in the Library: "Ask for finder items"
    • Set value of Variable  with name "storage"
    • Get Folder Contents
    • Filter Finder Items (fill in the search criteria)
    • Move Finder Items to Trash
    • Get Value of Variable (storage)
    • Get Folder Contents
    • Filter Finder Items (fill in the search criteria)
    • Get Folder Contents (sub folder search)
    • Filter Finder Items (fill in the second search criteria)
    • Move Finder Items to Trash