JSX and doScript differences in InDesign 2022 and 2023
Hi,
I am noticing an issue in the behavior of app.doScript in InDesign 2022 and 2023.
I have a jsx file that is invoked from our plugin which opens up a URL in the default browser on macOS
function openNativeBrowser (pUrl){
// open the url in the default browser on Mac
var body = [ 'open location "%s"'.replace ("%s", pUrl),
].join ("\r");
app.doScript (body,ScriptLanguage.APPLESCRIPT_LANGUAGE);
}
var body = ["do shell script \"open %s\"".replace("%s", pUrl)].join("\r");
app.doScript(body, ScriptLanguage.APPLESCRIPT_LANGUAGE)
So, I have three questions:
1. Is there a specific reason why the first code snippet does not work in InDesign 2023?
2. Is the second code snippet a better and more reliable approach?
3. The URL has several query parameters and are there any other better approaches considering this?
Thanks
