Thanks Chrillek. Okay, so I found your previous post (JavaScript: Using a script stand-alone and in a smart rule](JavaScript: Using a script stand-alone and in a smart rule) and I attempted to replicate, but I’m getting an error.
I’d be grateful if you could help steer me toward a solution.

Thank you for your time and effort, I really do appreciate your help as not very versed in scripting and automation.