Copy link to clipboard
Copied
Hey All,
I have experience with Javascript for web development and have some questions about InDesign automation.
It's a bit tough to get started with a simple script and started reading the scripting guide and have some questions.
InDesign scripts are written, then loaded into InDesign to be executed from the application.
You can't run the commands from a command line or other program, right?
I do a lot of typesetting, using different master pages for different designs.
Clients sends us excel files with the fields and records and it would be great to automate this repetitive process.
Data merge is useful to some degree but not with multiple master pages.
With InDesign scripting, is it possible to read an excel/csv file, select a master page for a given record and then merge the data into the master page?
Some master pages have multiple text boxes, can these be targeted from within the scripts?
It's a bit tough to get started writing a simple script and looking for something practical and useful for what I do.
Any suggestions or resources for this type of use case?
Thanks!
Copy link to clipboard
Copied
Hey All,
I have experience with Javascript for web development and have some questions about InDesign automation.
It's a bit tough to get started with a simple script and started reading the scripting guide and have some questions.
InDesign scripts are written, then loaded into InDesign to be executed from the application.
You can't run the commands from a command line or other program, right? CORRECT
I do a lot of typesetting, using different master pages for different designs.
Clients sends us excel files with the fields and records and it would be great to automate this repetitive process. THIS IS POSSIBLE
Data merge is useful to some degree but not with multiple master pages. THIS IS POSSIBLE
With InDesign scripting, is it possible to read an excel/csv file, select a master page for a given record and then merge the data into the master page? THIS IS POSSIBLE
Some master pages have multiple text boxes, can these be targeted from within the scripts? THIS IS POSSIBLE
It's a bit tough to get started writing a simple script and looking for something practical and useful for what I do.
Any suggestions or resources for this type of use case? with the extendscript toolkit youll find sample scripts to get you started. there's also a reference pdf included. looking at google resources are scarce (goolge: extendscript tutorial pdf) but available. there's a few useful PDF's out there, this forum and stackoverflow, other than that i suppose cash or a solid background in programming could get you somewhere as well.
Thanks! YEP
Copy link to clipboard
Copied
spicyDoge wrote
…InDesign scripts are written, then loaded into InDesign to be executed from the application.You can't run the commands from a command line or other program, right? CORRECT
…
That's not correct. You can run scripts from the command line.
See for example here:
Running ExtendScript Toolkit in command line - Trusted location message
Regards,
Uwe
Copy link to clipboard
Copied
Scripts that target InDesign will cause the operating system to launch InDesign before they are executed.
But if the scripts are just plain Extendscripts that don't target any particular app (and you can do quite a lot with that kind of script, because you've got all of ScriptUI at your disposal, as well as the File and Socket objects!) then no apps will be launched (presumably the Extendscript interpreter is loaded in the background, but nothing that the user would notice).
Ariel
Copy link to clipboard
Copied
My couple of cents:
InDesign scripts are written, then loaded into InDesign to be executed from the application. You can't run the commands from a command line or other program, right?
In JavaScript, you can execute an InDesign script via BridgeTalk object from such adobe apps as Bridge, Photoshop, Illustrator, etc. and vice versa, control other apps from InDesign.
You can write a script in AppleScript on Mac or VisualBasic on Windows to interact with (theoretically) any scriptable app: e.g. export a pdf from Indy and send it by e-mail from Mail/Outlook.
Also you can mix JavaScript with AppleScript/VisualBasic in InDesign triggering them by doScript() method.
You can run it from a bat-file (on Windows)
Clients sends us excel files with the fields and records and it would be great to automate this repetitive process.
You can get data directly from Excel. This is an example of above mentioned mixing JS with VB/AS
Copy link to clipboard
Copied
Data merge is useful to some degree but not with multiple master pages.
With InDesign scripting, is it possible to read an excel/csv file, select a master page for a given record and then merge the data into the master page?
Some master pages have multiple text boxes, can these be targeted from within the scripts?
Once I scripted data merge, but it was a dead end. Here I described a problem: not everything in data merge is available to scripting.
I've found an ugly work around breaking the script into two steps.
In my opinion, from my practical experience, a much better and flexible approach is to read data from excel using the above mentioned function and create documents from beforehand created templates filling them with the data. In the templates, on master pages, I created frames for text and images and labeled them in the label panel — e.g. childName, className, schoolName, etc. — so the script would know where to place each piece of data. A good news is you have do do this manually only once and later you can easily edit them if necessary. The script could quickly create thousands of docs from them.
Also, a word of warning: there's a bug when you're overriding objects on a master page by script: they change their position and/or in size. I found a workaround for my particular situation: created a couple of pages (portrait and landscape) with manually overridden master page items and duplicated them by script.
— Kas
Copy link to clipboard
Copied
Hi,
If you are a Macintosh user, you might want to explore working with AppleScript. The nice thing about AppleScript is that it can "talk" to a wide variety of applications as well as the system itself (including, of course, InDesign). A script written in AppleScript can be launched from just about anywhere on the system including an event such as dragging a file or folder onto a folder designated as a Folder Action. My personal opinion is that the syntax for AppleScript is easier for the beginning scripter.
Shirley Hopkins
yourscriptdoctor.com
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more