I use a little gem called "Folder Actions"

To be on the safe side put this in front of the macro:

See this post and the follow-ups.