Reputation: 15502
I can use AppleScript to send ExtendScript to Photoshop and get back the result:
This sends "2" to stdout:
tell application "Adobe Photoshop CC 2017"
do javascript "var x = 2; x"
end tell
I get a syntax error when I try the same thing for InDesign 2015:
This results in a syntax error: Expected end of line but found application constant or consideration.
tell application "Adobe InDesign CC 2015"
do javascript "var x = 2; x"
end tell
This similar code, using script
instead of javascript
does slightly better, resulting in this error message: Adobe InDesign CC 2015 got an error: A identifier can’t go after this identifier.
tell application "Adobe InDesign CC 2015"
do script "var x = 2; x"
end tell
Any suggestions for getting this to work?
Upvotes: 0
Views: 739
Reputation: 2193
The main difference is that "do script" is a specific command of the InDesign Scripting model in Applescript so its syntax is specific.
set myJavaScript to "var x = 2; x"
do script myJavaScript language javascript
Upvotes: 3