Delete File, if Name Is


How would I create a macro 1) that is triggered when new files are put in a folder.
2) And if any of the files in the folders added, contains a specific name, they are deleted?

Have a software that spits out a bunch of files on export, some that I want to keep, some I want to delete and some that I want to rename. When having to do all this manually every time I make a change, it becomes very cumbersome.

Hey There,

In general I don't like to set up automated processes to delete files. I've been bitten one two many times by unexpected behavior.

The basic task is easy enough, but I recommend that you activate it manually.

The last action in the macro opens the Trash, so you can make sure all is copacetic before emptying it.

Once you're confident the macro is working as you wish you can disable or delete that step if desired.

If you really want to you can play around with a Folder trigger, but I would run some serious tests before depending upon one.


Delete Files Containing { Strings } from a Specific Folder.kmmacros (5.8 KB)


Thank you so much! Sorry for delay in reply.