InDesign scripting - OSAscript Activate finder
I'm trying to activate finder with osascript, this command works directly in terminal, but will not work when called through doScript.
Works in terminal:
osascript -e 'tell application \"finder\" to activate
Causes error being called through InDesign
app.doScript("osascript -e 'tell application \"finder\" to activate", ScriptLanguage.applescriptLanguage);
Here is the error:
Eval Error (#-2740): "A unknown token can’t go after this identifier." in '/Users/PATH TO SCRIPT/script.jsx' [6:undefined] in host 'indesign-19.064 (main)'.
This alternative seems to work:
app.doScript('do shell script "open -a finder"', ScriptLanguage.applescriptLanguage)
Right before this, I run a function that opens a finder window, then I launch an alert through indesign so it steals focus, and I want to activate finder as the last step. Is there a way with OSA script? Just wondering if it's possible in case I needed to run additional steps.
