I was wondering if someone could give me a hint on a macro I want to create, My team and I always work creating new versions every time we make any change on a project, at the end of the day we end up with a lot of old files that we manually move to a folder called _OLD.
I was thinking of using (for each in finder selection "move or delete"), but I don't know how to tell keyboard maestro to move everything but the latest file modified.
Thank you in advance,
the final folder can look like this and at the end of the day we can end up with 30 or more folders with this same look, which is tedious to clean them all manually!
Set your actual folder paths in the green actions.
First, the macro counts all .cpr files in the source folder. Then it moves files (sorted by modification date) while counting backwards from the number of found files, until the counter reaches 1.
ls builds a list of all .cpr files, sorted by modification date, tail removes the first one from the list and passes the rest to mv, which moves them to the destination folder.
THANK YOU VERY MUCH, all of them work and me and my team are using them a lot, I even modify some of them to do other stuff related and it has saved us tons of time. thank you all!