Understanding Hazel

I think that’s what I’m doing wrong then. I’m trying to run it as an Automator workflow via quick actions on the Finder.
How can I fix the script to to do it manually on the finder instead of doing through Hazel?