I have a script written in JavaScript which needs to run one small piece of AppleScript (to achieve some functionality I've been unable to implement due to a number of factors natively in JS).
It should be able to take a single string argument, and is pretty much a tell-endtell one liner.
Is it possible to assemble this nanoprogramme as a string in JavaScript then pass the string to the AppleScript environment for execution, and how would that be done?
There's plenty of explanations online about how to run JavaScript from Applescript, but not as much coming the other way.
Would this - in all likelihood - involve a shell invocation of osascript -e
to achieve, or are there cleaner, more JXA-ey ways?