Scripting is a very powerful capability of InDesign. It can save time, make you more productive, and add new functionality not in the product today. Scripts can do everything from very small tasks like setting a tab stop at the location of the text cursor to providing complete features. You can create your own scripts and you can run scripts that other people have created.
Any action that can change a document or its contents can be scripted. Therefore, scripts can draw frames, create new documents, enter and format text, place graphics, and print or export the pages of the document. Common Extensibility Platform (CEP) can also be used in conjunction with scripts to create new user interfaces in InDesign to collect data and/or provide data to the user.
Almost anything you can do with InDesign’s existing user interface can also be done with a script. There are even a few things you can do in scripting that you cannot accomplish using the user interface. For example, scripts can create menus, add menu items, create and display dialog boxes and panels, and respond to user-interface selections. Scripts can read and write text files, parse XML data, and communicate with other applications.
We tend to think of scripting in terms of long, repetitive tasks, like laying out a phone book, but it is also good for things like the following:
You can see the benefits of scripting by running simple scripts that do only one thing from the collection of scripts included in InDesign itself, or using scripts from the community. Check out the script code if you’re curious to see how they were written. From there you can move on to advanced scripts that automate your entire publishing workflow. It’s not hard to write your own either — see resources below.
Scripts are easy to run within InDesign. You can even assign a keyboard shortcut to run a script. To learn more about how to run scripts, read this adobe helpx page.