Copy link to clipboard
Copied
I have a small automation project I want to do—note that I haven't done any scripting in InDesign since CS6—and opened up Script Editor.
First problem: File ► Open Dictionary... and using that to open InDesign spit back a blank window with the message "Nothing to see here, move along."
Oooookay. So I posted the following script:
tell application "Adobe InDesign CC 2018"
tell document 1
set aNewPage to make page at end
end tell
end tell
and I got the following error:
error "The variable page is not defined." number -2753 from "page"
More concerning was that in opening up the Scripts window in InDesign, I discovered that the AddGuides script doesn't work, either; the JavaScript version does, but the AppleScript one throws an error.
So, how do I get the current scripting dictionary for InDesign CC 2018? Did something change with the scripting lately?
Copy link to clipboard
Copied
HI
yeah, things have changed a ee nit since CS6
try this
tell application "Adobe InDesign CC 2018"
set myDoc to make new document with properties {document preferences:{page width:100, page height:100, facing pages:false}}
tell myDoc
set aNewPage to make page at after page 1
end tell
end tell
Copy link to clipboard
Copied
As far as the script goes, it doesn't matter if I make a new document or use document 1; the problem is that when I type "make page", it assumes "page" is a variable rather than an object. "at end" or "at after page 1" or whatnot doesn't really matter, either.
Copy link to clipboard
Copied
just in case, is your document active?, as it will not work unless it is so
your code works fine if I have an active document
Copy link to clipboard
Copied
forgot to mention, to get the dictionary from Script Editor, open it, in the file menu select open dictionary, then scroll to your desired app
Copy link to clipboard
Copied
Er, yes, that's exactly what I did. And that's the result I got.
("First problem: File ► Open Dictionary... and using that to open InDesign spit back a blank window with the message 'Nothing to see here, move along.'")