Accessibility

TechNote (Archived)

Scripting languages and resources (Adobe InDesign CS and CS2)

What's covered

The InDesign Scripting Guide

Requirements for scripting in InDesign

Script commands supported by InDesign

Resources for writing and troubleshooting scripts

Adobe Technical Support programs offer different levels of assistance for troubleshooting of Adobe certified language scripts, steps, and their expected behavior from within the Adobe application. For additional information and details on current Adobe Support programs, visit the Adobe website at www.adobe.com/support/programs/ .

The InDesign Scripting Guide

The InDesign Scripting Guide can be found in the following locations:

-- InDesign CS2 (installed as a stand-alone application): The Adobe InDesign CS2 Scripting Guide is located in the Adobe Technical Info/InDesign CS2/Scripting folder on the Adobe InDesign CS2 CD-ROM. Sample scripts are also located in this folder.

-- InDesign CS2 (installed as part of the Adobe Creative Suite 2): The Adobe InDesign CS2 Scripting Guide is located in the Adobe Technical Information/InDesignCS2/Scripting folder on the Resources and Extras CD-ROM. Sample scripts are also located in this folder.

-- InDesign CS: The Adobe InDesign CS Scripting Guide is located on the Adobe website at www.adobe.com/products/indesign/pdfs/indesign_cs_scripting_guide.pdf .

- InDesign CS (installed as a stand-alone application): The Adobe InDesign CS Scripting Guide is located in the Adobe Technical Info/InDesign CS/Scripting folder on the Adobe InDesign CS CD-ROM. Sample scripts are also located in this folder.

- InDesign CS (installed as part of Adobe Creative Suite): The Adobe InDesign CS Scripting Guide is located in the Adobe Technical Info/InDesign CS/Scripting folder on the Resources and Extras CD-ROM. Sample scripts are also located in this folder.

Requirements for scripting in InDesign

Because some of the scripting languages that InDesign supports are platform-specific, the requirements for scripting in InDesign depend on the platform you use. Depending on their content, InDesign CS scripts may not work in InDesign CS2, and vice versa.

JavaScript

To use JavaScript with InDesign in Mac OS or Windows, you need a text editor that can save files in text-only format. To run scripts, you must have the system resources (that is, memory and disk space) necessary to run both InDesign and a JavaScript editor application simultaneously.

AppleScript

To use AppleScript with InDesign in Mac OS, you need to have AppleScript installed and an AppleScript editor. AppleScript is included with Mac OS, but you can also download it for free from the Apple website at www.apple.com . The Apple Script Editor is included with AppleScript, but there are also third-party script editors. To run scripts, you must have the system resources (that is, memory and disk space) necessary to run both InDesign and an AppleScript editor application simultaneously.

Visual Basic

To use Visual Basic with InDesign, you need to have Microsoft Visual Basic or an application that contains Visual Basic for Applications (VBA) installed. Microsoft Office, Visio, and AutoCAD are some of the applications that include VBA. While InDesign supports VBA, it does not include it. In the InDesign Scripting Guide, you'll find more information on the differences between Visual Basic and VBA, and how those differences affect InDesign scripting.

Microsoft Visual Basic comes in a variety of packages. The least expensive one, the Learning Edition, provides all the functionality you need to script InDesign. To run scripts, you must have the system resources (that is, memory and disk space) to run both a Visual Basic Editor application and InDesign simultaneously.

Script commands supported by InDesign

For a complete reference of script commands supported by InDesign, refer to the Adobe InDesign CS2 Scripting Guide.

To see what AppleScript or Visual Basic commands InDesign supports, you can also view the InDesign object model within a script editor.

To view the InDesign object model within Apple Script Editor:

1. Open Script Editor.

2. Choose File > Open Dictionary.

3. Navigate to the InDesign application icon, and click Open.

To view the InDesign object model within Visual Basic:

1. In any Visual Basic project, choose Project > References. Visual Basic displays the References dialog box.

2. In the References dialog box, select Adobe InDesign CS Type Library (InDesign CS2) or Adobe InDesign CS Type Library (InDesign CS) and click OK.

Note:You cannot load both libraries simultaneously.

3. Choose View > Object Browser.

4. Choose InDesign from the list of open libraries in the Project/Library pop-up menu. Visual Basic displays the classes (each type of InDesign object) and the members of those classes (that is, the objects and methods making up each class).

5. Click an object class or class member to see more information about it at the bottom of the dialog box.

Resources for writing and troubleshooting scripts

A number of websites and third-party books provide information on scripting.

Note: Adobe doesn't support or endorse third-party resources, and they are subject to change without notice.

Adobe User to User Forums and InDesign scripting information

-- www.adobe.com/support/forums/main.html

-- www.adobe.com/products/indesign/scripting.html

Resource Center Exchange

Visit the Resource Center Exchange website at http://share.studio.adobe.com/default.asp for a repository of sample scripts and other files that allow you to add new features to Adobe products.

Third-party websites

JavaScript

-- www.javascript.com

The Definitive JavaScript Resource

-- www.developer.com/lang/jscript

JavaScript/Jscript articles, tutorials, and other resources

AppleScript

-- www.apple.com/applescript

The Apple official AppleScript website

-- http://developer.apple.com/documentation/Carbon/AppleScript-date.html

The AppleScript documentation page, which includes a copy of the AppleScript Language Guide, and an overview of creating AppleScripts for OS X.

-- www.tecsoft.com

Training resource that covers AppleScript basics and how to script InDesign to create real-world automation solutions.

Visual Basic

-- http://msdn.microsoft.com

Microsoft Developer Network site

-- www.angelfire.com/ca/yosh

The Visual Basic Help Center

-- www.prestwood.com/community/

Visual Basic articles and discussion forums

-- http://coolvb.com

Visual Basic help, FAQs and downloads

Third-party books on JavaScript

-- Adobe InDesign CS2 Official JavaScript Reference by Adobe Systems Inc.

-- JavaScript: The Definitive Guide by David Flanagan

-- JavaScript Bible (and JavaScript Examples Bible) by DannyGoodman

-- JavaScript: The Complete Reference by Fritz Schneider and Thomas A. Powell

-- JavaScript by Example by Ellie Quigley

Third-party books on AppleScript

-- AppleScript Finder Guide: English Dialect by Inc Staff Apple Computer

-- The Tao of AppleScript by Derrick Schneider (with Hans Hansen, who wrote the definitive guide on Adobe PageMaker scripting)

-- AppleScript for Dummies by Tom Trinko

-- Danny Goodman's AppleScript Handbook by Danny Goodman

-- AppleScript in a Nutshell by Bruce W. Perry

Third-party books on Visual Basic Scripting

-- Microsoft Visual Basic 6.0 Step-by-Step by Michael Halvorson

-- Beginning Visual Basic 6 by Peter Wright

-- Inside Microsoft Visual Basic: Scripting Edition (Microsoft Programming Series) by Scot Hillier

-- Learn Microsoft Visual Basic Scripting Edition Now by Gary Cornell

-- How to Program Microsoft Visual Basic: Scripting Edition by Robert McDaniel

-- 1001 Visual Basic Programmer's Tips by Kris A. Jamsa, Lars Klander

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:333598
OS:Windows (All)
Mac OS (All)

Products Affected:

indesign