Delete all files with .tmp extension in a specific folder with no further user intervention

As my title suggests, I would like to run a macro that would delete (or send to trash) all files in a specific folder that has an extension of .tmp

Adobe Audition creates these files whenever it renders audio. When it finishes, it deletes the tmp file, but for some reason, if I do this in a dropbox folder, the tmp file returns, unless I disable syncing while rendering.

I would like to run a macro that would simply delete any file with an extension of .tmp in my dropbox audio folder.

I did try some of the macros that were submitted, but they all needed my input, and when I tried to eliminate them, the macro didn’t work at all.

Sorry I’m a bit of a newbie in this area.

Use the For Each action with the Folder Contents collection. Use the If Then Else action and the Variable condition to test if the path ends in “.tmp”. Use the Trash or Delete a File action to delete the file.

WARNING: This could go horribly wrong if you make a mistake. You could delete all the files in this or some other folder. Make sure you have a complete solid verified backup and that you test what will be deleted carefully. I would definitely use Trash and not Delete for additional safety.