I know that you can tell
Chrome or Safari to do JavaScript
(or write entirely in JS... à la JXA) but whilst answering another question, I got curious...
Is there a way to arbitrarily execute an inline JavaScript statement inside an AppleScript (without tell
ing another process)?
So far I've only used something like this (in an AppleScript):
do shell script "osascript -l JavaScript -e '\"" & myVar & "\".trim()'"
But that seems such a silly workaround