How to use JavaScript in a smart rule (finally)

I’m curious why you want to do it in JavaScript. Didn’t moving the AppleScriptObjC part into a script library (see here) work for you?