You should have and then I wouldn't have wasted an hour!

On a Mac I think you would need to use AppleScript but I am not a Mac programmer.

If you have a PC I would try it there with a few files only to start with.