This generates a syntax error at the `do script` line: "Expected end of line, etc. but found “script”."
You haven’t defined val_2—val_1 is set to "Foo" and "Bar". The error is being generated from something in the JS you are calling.
This works for me:
The HelloWorld JS:
var a1 = arguments; var a2 = arguments; alert(a1 + " " + a2);
Thanks. val_2 was just an omission on my part while pasting the code here. The problem I'm having is AppleScript console throws an error when I want to use "do script" command. Only when I comment it out then I can save the script. May I know the macOS version and InDesign version you're trying it on?
InDesign 2020 and High Sierra
Does this compile?
Sadly, no. Must be macOS Catalina, then?
Probably. There does seem to be a lot of AS problems with Catalina. I’m seeing some apps abandon their AS support—the latest version of Fetch is no longer scriptable.
Happy to report the above works after upgrading to macOS 10.15.4!
So the issue was definitely Catalina 10.15.3 – not sure about earlier.
I'm having the same issue with 10.15.7
I am as well.