광고
광고
Adobe InDesign CS
Scripting Guide
version .0
4 September, 2003
ADOBE SYSTEMS INCORPORATED
Corporate Headquarters
345 Park Avenue
San Jose, CA 950-2704
(408) 536-6000
Adobe InDesign CS Scripting Guide
Copyright 2003 Adobe Systems Incorporated.
All rights reserved.
The information in this document is furnished for informational use only, is subject to change without notice, and should not be construed as a
commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies that
may appear in this document. The software described in this document is furnished under license and may only be used or copied in accordance
with the terms of such license.
Acrobat, Adobe, InCopy, and InDesign are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States
and/or other countries. Macintosh and Apple are registered trademarks, and Mac OS and AppleScript are trademarks of Apple Computer, Inc.
registered in the United States and other countries. Microsoft, Visual Basic, Windows, Windows 95, Windows 98, and Windows NT are either
registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. All other brand and product names are
trademarks or registered trademarks of their respective holders.
Introduction
If you’re reading this, you’ve discovered the most powerful feature in InDesign. No other feature—no tool, palette,
or dialog box that you see in the program’s user interface—can save you as much time, trouble, and money as
scripting.
What is scripting?
A script is a series of commands that tell InDesign to perform a series of actions. These actions can be simple, and
affect only a single, selected object in the current publication; or complex, and affect all of the objects in all of the
InDesign publications on your hard drive. The actions might involve only InDesign, or they might involve other
applications, such as word processors, spreadsheets, and database management programs. Virtually every task you
can perform by manipulating InDesign’s tools, menus, palettes, and dialog boxes can be performed by a script.
We naturally think of scripting as a way to automate repetitive tasks, but it can also be a creative tool. In addition
to performing routine production tasks, such as preparing a set of publications for remote printing, you can use
scripts for creative tasks that would be too difficult or time consuming to do yourself. For example, you could write
a script to randomly change the font and color of the characters in a selection, or gradually increase the size and
baseline shift of characters from one end of a range of text to the other. Without scripting, you might not use these
creative effects.
Scripting isn’t only for software engineers—it’s for every InDesign user. You don’t need a degree in computer
science or mathematics to write scripts that can automate a wide variety of common page layout tasks in InDesign.
If you can read this text, you can write InDesign scripts.
We realize, however, that not every InDesign user will be familiar with programming terms, concepts, and
techniques, so we’ve included a chapter, “Getting Started with InDesign Scripting,” containing introductory
information that should help get you started with scripting (even if you’re experienced with AppleScript, Visual
Basic, or JavaScript, you should read this chapter, as it covers a number of InDesign-specific matters). At the
same time, we cannot fully document AppleScript, Visual Basic, or JavaScript, so you’ll probably also need
documentation for any or all of those scripting languages.
On the Macintosh, scripting is accomplished using AppleScript, a scripting system that sends messages to
applications or to the operating system using AppleEvents. In Windows, Visual Basic programs use a similar
system for interapplication communication, usually referred to as Windows Automation. InDesign JavaScripts, by
contrast, run on either platform. The terminology differs among the scripting languages, but the idea is the same—
to send information from one program (the scripting system) to another program (InDesign) to make the receiving
application perform some task.
This doesn’t mean that all applications can be controlled by scripts. For scripting to work, an application has
to receive messages from another application, and has to be able to turn those messages into actions. Next, the
messages you send to an application have to be constructed in a particular way, or the application won’t be able to
understand what you want it to do.
You can think of this book as a kind of “language lesson”—in it, we’ll show you how to talk to InDesign.
InDesign CS Scripting Guide
Introduction
1
Why use scripting?
Graphic design is a field characterized by creativity, but most of the actual work of page layout is anything but
creative. When you think about the work that you do, chances are good you’ll find that you spend most of your time
doing the same or similar production tasks, over and over again. In fact, you’ll probably notice that the time you
spend placing and replacing images, correcting errors in text, and preparing files for printing at an imagesetting
service provider often reduce the time you have available for doing creative work.
Wouldn’t it be great if you could hire an assistant—one that wouldn’t mind doing some or all of the boring,
repetitive tasks for you? If you could do that, you’d have more time to concentrate on the creative aspects of your
work.
With a small investment of time, InDesign scripting can be the page layout assistant you need. You can start with
short, simple scripts that save you a few seconds every day, and move on to scripts that work all night while you’re
sleeping.
Think about your work—is there a repetitive task that’s driving you crazy? If so, you’ve identified a candidate
for a script. Think analytically about the task. What are the steps involved in performing the task? What are the
conditions in which you need to do the task? Once you understand the process you go through, you’ll be able to
turn it into a script.
What about macros?
A macro is a recording of a series of user interface actions—menu choices, key presses, and mouse movements.
When you “play” a macro, the macro performs all of the recorded actions. You create macros using special utility
programs. QuicKeys, from CE Software, is an example of a macro-creating program.
Many people are confused about the difference between macros and scripting. Macros and scripts are both ways of
automating repetitive tasks, but they work very differently. The following points summarize the key differences.
• Macros use a program’s user interface to do their work. As a macro runs, it displays and closes dialog boxes,
pulls down menus and makes menu choices, and types text into documents or fields. Scripts do not use a
program’s user interface to perform their tasks, and execute far faster than the fastest macro.
• Macros have very limited facilities for getting and responding to information from a program. Scripts are
capable of getting information and making decisions and calculations based on the information they receive.
System requirements
The language you use to write scripts depends on the scripting system of the platform you’re using: Visual Basic for
Windows; AppleScript for the Macintosh, or JavaScript for either platform. While the scripting systems differ, the
ways that they work with InDesign are very similar. Each example script shown in this manual will be shown in
both systems. Translating a script from one system to another is a fairly easy task.
Macintosh
To write AppleScripts on the Macintosh, you must have AppleScript (it comes with all Apple systems, or can be
downloaded for free from Apple’s web site) version 1.6 or higher, and an AppleScript script editor. Apple’s Script
Editor is included with the Mac OS; third-party script editors, such as Script Debugger (from Late Night Software,
http://www.latenightsw.com), are also available.
2
Introduction
InDesign CS Scripting Guide
Windows
To use InDesign scripting in Windows, you’ll need some version of Microsoft Visual Basic—Visual Basic 5 Control
Creation Edition (CCE), Visual Basic 6, Visual Basic .NET, VBScript, or an application that contains Visual Basic
for Applications (VBA). Microsoft Office, Visio, AutoCAD, and other programs include VBA. While InDesign
supports VBA, it does not include VBA.
If you do not already have one of the Visual Basic versions, you can use the Visual Basic 5.0 Control Creation
Edition, available for free download from http://msdn.microsoft.com.
Visual Basic applications require certain external components in order to run. If you’re having trouble running the
compiled scripting examples, you’ll need to install some or all of the following files:
• MSVBVM60.DLL
• STDOLE2.TLB
• OLEAUT32.DLL
• OLEPRO32.DLL
• COMCAT.DLL
• ASYNCFILT.DLL
• CTL3D32.DLL
These files are available for download from http://support.microsoft.com/download/support/mslfiles/Vbrun60.exe.
To create InDesign scripts using VBScript ( “stripped down” version of Visual Basic), all you need is a text editor
(Notepad will do). To run the VBScripts, you use the free Windows Scripting Host (WSCRIPT.EXE). The Windows
Scripting Host is included with most current Windows installations, or can be downloaded from: http://msdn.
microsoft.com.
To use InDesign scripting in Windows, you must install InDesign from a user with Administrator privileges.
After you’ve completed the installation, any user can run InDesign scripts, and any user with Power User or
Adminstrator priveleges can add scripts to the InDesign Scripts palette.
JavaScript
InDesign also supports JavaScript for cross-platform scripting. InDesign’s JavaScript support is based on an
Adobe implementation of JavaScript known as ExtendScript. The ExtendScript interpreter conforms to the
current ECMA 262 standard for JavaScript. All language features of JavaScript 1.5 are supported, including
try/catch/finally, equality operators, and the new instanceof and in operators. Adobe GoLive also uses the
ExtendScript JavaScript interpreter.
InDesign JavaScript files must be run from the Scripts palette, which guarantees that they are interpreted by the
ExtendScript interpreter. These scripts will not run from your operating system (as Jscripts would in Windows or
OSA JavaScripts would on the Mac OS). InDesign JavaScript files must have the file extension “.js” to be recognized
by the Scripts palette.
InDesign CS Scripting Guide
Introduction
3
InDesign scripting resources
In addition to this Guide, you can find more information on InDesign scripting at adobe.com. The InDesign
scripting community has its own user to user forum (at http://www.adobeforums.com), where scripters can ask
questions, post answers, and show off their newest scripts. At the time of this writing, the forum contains literally
hundreds of example scripts.
4
Introduction
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
If you’ve used InDesign, you’ve worked with frames and their contents, and you’ve learned to apply colors, formatting, and styles.
You’ve set up publications, spreads, pages, and the design elements on those pages. If you’ve done all of this, you’ve gotten used to
thinking of an InDesign publication as a series of objects.
InDesign scripting relies on the same approach. The heart of InDesign scripting is the object model: a description of all of the types
of items—documents, spreads, pages, frames, and the contents of those frames—that can appear in an InDesign publication. Each
type of object has its own special properties, and every object in an InDesign publication has its own identity.
In this chapter, we’ll cover the basic concepts of scripting, or programming, for both Windows and the Macintosh. For more detailed
directions on using your particular scripting system with InDesign, see the appropriate reference chapter later in this manual.
Experienced scripters might want to skip directly to those chapters.
Objects
The terminology of object oriented programming can be hard to understand, at first. “Objects” belong to “classes,” and have
“properties” you manipulate using “methods” (Windows) or “commands” (Macintosh). What do these words mean in this context?
Here’s a way to think about objects and object properties. Imagine that you live in a house that responds to your commands (you can
think of this house as technologically advanced, or magical, or both). The object properties of your house might include the number
of rooms, the color of the exterior paint, or the date of its construction.
Each object in the house can respond to various methods according to its capabilities. Windows and doors, for example, can open or
close—but the floor and ceiling cannot.
Imagine that the house can change some of its properties—if given the right sort of command. You might say, “House, paint yourself
blue.” Because your house can respond to the method “paint,” you’ll soon have a house of a different color.
Next, your house contains a number of smaller objects. Each room, for example, might be an object, with each window, door, or
appliance being other objects inside the room. You can talk to these objects directly, or you can talk to them through the house. You
have to be very specific, though—you can’t tell your house to open a window without telling it which window you want to open. You
can also give commands to the objects inside the rooms. “Tell the kitchen to open the north window,” you might say.
Some properties of objects can be changed; some cannot. The location of a piece of furniture can be changed; the construction date of
the house cannot. Properties that can be changed are “read/write”; properties that cannot be changed are “read only.”
To apply this metaphor to InDesign—the application is the house, the spreads and pages are the rooms, and the frames on your pages
are the windows and doors. You can tell InDesign pages to add frames, and you can tell frames to change their attributes or content.
You can then tell the frames to change color, or import a graphic, or populate themselves with text.
Objects in your publication are arranged in a hierarchy—frames are on pages, which are inside a document, which is inside InDesign.
When we speak of an “object model,” or a “hierarchy,” we’re talking about this structure.
Object references
When you send a command to an InDesign object, you need to make sure you send the message to the right object—the correct
“address.” To do this, you identify objects by their position in the hierarchy. The following examples show how to refer to the first text
frame of the first spread of the active document (note that these are not complete scripts).
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
5
AppleScript
first text frame of the first spread of the first document
Visual Basic
Documents.Item(1).Spreads.Item(1).TextFrames.Item(1)
JavaScript
app.documents.item(0).spreads.item(0).textFrames.item(0)
When you identify an object in this fashion, you’re creating an object reference. Visual Basic and AppleScript use different ways to
create object references, but the idea is the same—to give the script a road map to the object you want to work with.
AppleScript Note: When your script refers to a text object, InDesign returns the text contained in the object—not a reference to the
object itself. To get a reference to the text object, use the object reference property, as shown below.
tell application "InDesign CS"
set myDocument to make document
tell spread 1 of myDocument
set myTextFrame to make text frame
set contents of myTextFrame to "InDesign"
--The following line would return the text "InDesign"
get paragraph 1 of myTextFrame
--The following line would return a text object
get object reference of paragraph 1 of myTextFrame
end tell
end tell
Object classes
Objects with similar qualities are grouped into “classes.” In InDesign, every type of frame—rectangles, polygons, ovals, and
freeform paths—belongs to the class “PageItems,” and shares properties with every other member of that class. Properties such as the
geometric location of the object on the page, for example, are common to all PageItems.
Comments
Comments are a way to add descriptive text to a script. Comments are ignored by the scripting system as the script executes—this
keeps comments from producing errors when you run your script. Comments come in handy when you want to document the
operation of a script (for yourself or for someone else).
To enter a comment in an AppleScript, type “--” to the left of your comment. In Visual Basic, enter “Rem” (for “remark”) or “’” (a
single straight quote) to the left of the comment. Enter the comment marker at the beginning of a line to make the entire line a
comment. In JavaScript, enter “//” to the left of the comment, or surround the comment with “/*” and “*/”.
AppleScript
--this is a comment
(* and so is this *)
Visual Basic
Rem this is a comment
‘ and so is this
6
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
JavaScript
// this is a comment
/* and so is this */
Values
The point size of a character of text, the horizontal location of a text frame on a page, or the color used to format the stroke of a
rectangle are all examples of values used in InDesign scripting. Values are the data your scripts use to do their work.
The type of a value defines what sort of data the value contains. The value type of the contents of a word, for
example, is a text string; the value type of the leading of a paragraph is a number. Most of the time, the values
used in your scripts will be numbers or text. The following table explains the value types most commonly used
in InDesign scripting.
Value type:
boolean
integer
double (Visual Basic),
fixed or real (AppleScript),
floating point (JavaScript)
string
array (Visual Basic,
JavaScript)
or list (AppleScript)
What it is:
Logical True or False
Example:
Whole numbers (no decimal points). Integers can be
positive or negative. In Visual Basic, you can use the
long data type for integers. In AppleScript, you can
also use the fixed or long data types for both integers
and real numbers.
A high-precision number which may contain a decimal point.
14
A series of text characters. Strings appear inside
(straight) quotation marks
A list of values (the values can be any type).
"I am a string"
True
13.9972
{"0p0", "0p0", "16p4", "20p6"} in
AppleScript, or Array("0p0", "0p0",
"16p4", "20p6") in Visual Basic, or
["0p0", "0p0", "16p4", "20p6"] in
JavaScript.
Variables
Variables are containers for data. A variable might hold a number, a string of text, or a reference to an InDesign object. Variables
have names, and you refer to a variable by its name. To put data into a variable, we assign the data to the variable. The file name of the
current InDesign publication, the current date and time, and the number of pages in the publication are all examples of data that can
be assigned to a variable.
Why not simply enter the data itself (the publication’s name, or the current date and time, or the number of pages in the publication),
rather than using variables? Because, if you do, you’ll end up with a script that will work in only one publication or situation. By
using variables, you can write scripts that will work in a wider range of situations. As a script executes, it can assign data to the
variables that reflect the current publication and selection (for example), and then make decisions based on the content of the
variables.
Assigning values or strings to variables is fairly simple, as shown below.
AppleScript
set myNumber to 10
set myString to "Hello, World!"
Visual Basic
myNumber = 10
myString = "Hello, World!"
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
7
JavaScript
var myNumber = 10;
var myString = "Hello, World!";
In AppleScript, you can assign a reference to an InDesign object to a variable as you create the object:
set myTextFrame to make text frame with properties(geometric bounds: (0,0,3.5, 4))
...or you can fill the variable with a reference to an existing object:
tell application "InDesign CS"
set myTextFrame to first text frame of the first spread of the first document
end tell
Visual Basic works about the same way—to assign a variable as you create a frame (“myInDesign” in the following line is a reference
to the InDesign application object):
Set myTextFrame = myInDesign.Documents.Item(1).Spreads.Item(1).TextFrames.Add
...or to refer to an existing frame:
Set myTextFrame = InDesign.Documents.Item(1).Spreads.Item(1).TextFrames.Item(1)
The same operation in JavaScript is somewhat more similar to Visual Basic than it is to AppleScript (in InDesign JavaScript, “app” is a
reference to the InDesign application):
var myTextFrame = app.documents[0].spreads[0].textFrames[0];
//or
var myTextFrame = app.documents.item(0).spreads.item(0).textFrames.item(0);
Note: In JavaScript, all variables are considered global by default—that is, they are not bound to a specific function. In AppleScript
and Visual Basic, variables are local unless specifically defined as global variables. This means that the variables do not persist outside
the function in which they are created.
In general, in any of the languages, it’s best to use local variables and pass specific values to functions/subroutines/handlers rather
than defining and using global variables. In JavaScript, you define a variable as a local variable using “var,” as shown above. To
specify that a number of variables in a JavaScript function are local variables, you can list them at the beginning of the function, as
shown below.
function myFunction(){
var myNumber, myString;
}
About variable names
Try to use descriptive names for your variables—something like “firstPage” or “corporateLogo,” rather than “x” or “c.” Using more
verbose names makes your script much easier to read, and does not slow the execution of the script.
Variable names must be a single word, but you can use internal capitalization (such as “myFirstPage”) or underscore characters
(“my_first_page”) to create more readable names. Variable names cannot begin with a number, and they can’t contain punctuation or
quotation marks.
You might also want to give your variable names a prefix so that they’ll stand out from the objects, commands, and keywords of your
scripting system. All of the variables used in this book, for example, begin with “my.”
8
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
To “Set” or not to “Set”?
In AppleScript, you use “set” to assign any value type to a variable:
set myDocument to active document
set myString to "X"
In Visual Basic versions other than VB.NET, you use “Set” to assign object references to variables, but not to string, array, and
number variable types.
Set myDocument = myInDesign.Documents.Add
myString = "X"
In VB.NET, you do not need to use “Set” for object variables.
myDocument = myInDesign.Documents.Add
myString = "X"
Like VB.NET, JavaScript does not require “Set” when you are assigning values to variables, regardless of the type of the variable.
myDocument = app.documents.add();
myString = "X";
About array variables
AppleScript, Visual Basic, and JavaScript all support arrays—a variable type that is a list of values. In AppleScript, an array is called a
“list.”
AppleScript
set myArray to {1, 2, 3, 4}
Visual Basic
myArray = Array(1, 2, 3, 4)
Rem In Visual Basic.NET: myArray = New Double (1, 2, 3, 4)
JavaScript
myArray = [1, 2, 3, 4];
To refer to an item in an array, you refer to the item by its index in the array. The first item in an array in Visual Basic and JavaScript
is item 0; in AppleScript, the first item in an array is item 1.
AppleScript
set myFirstArrayItem to item 1 of myArray
Visual Basic
myFirstArrayItem = myArray(0)
Note: Visual Basic’s Option Base statement can be used to set the first item of an array to item 1. The examples
in this book and on your InDesign CD assume that the first item in an array is item 0, not item 1, as that is the default. If you have set
the Option Base to 1, you will need to adjust all of the array references in the example
scripts accordingly.
JavaScript
myFirstArrayItem = myArray[0];
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
9
Arrays can include other arrays, as shown below.
AppleScript
set myArray to {{0, 0}, {72, 72}}
Visual Basic
myArray = Array(Array(0,0), Array(72, 72))
Rem In Visual Basic.NET: myArray = New Array(New Double(0,0), NewDouble (0,0))
JavaScript
myArray = [[0,0], [72,72]];
Converting values from one type to another
All of the scripting languages supported by InDesign provide ways to convert variable values from one type to another. The most
common conversions involve converting numbers to strings (so that you can enter them in text or display them in dialog boxes) or
converting strings to numbers (so that you can use them to set a point size or page location).
AppleScript
--To convert from a number to a string:
set myNumber to 2
set myString to (myNumber as string)
--To convert from a string to a number:
set myString to "2"
set myNumber to (myString as integer)
--if your string contains a decimal value, use "as real" rather than "as integer"
Visual Basic
Rem To convert from a number to a string:
myNumber = 2
myString = cstr(myNumber)
Rem To convert from a string to an integer:
myString = "2"
myNumber = cInt(myString)
Rem If your string contains a decimal value, use "cDbl" rather than "cInt":
myNumber = cDbl(myString)
JavaScript
//To convert from a number to a string:
myNumber = 2;
myString = myNumber + "";
//To convert from a string to an integer:
myString = "2";
myNumber = parseInt(myString);
//If your string contains a decimal value, use "parseFloat" rather than "parseInt":
myNumber = parseFloat(myString);
//You can also convert strings to numbers using the following:
myNumber = +myString;
Finding the value type of a variable
Sometimes, your scripts will need to make decisions based on the value type of an object. If you’re working on a script that operates
on a text selection, for example, you might want to have that script stop if the type of the selection is a page item. All of the scripting
languages feature the ability to get the type of a variable.
10
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
AppleScript
-- Given a variable of unknown type, "myMysteryVariable"...
set myType to class of myMysteryVariable
--myType will be an AppleScript type (e.g., rectangle)
Visual Basic
Rem Given a variable of unknown type, "myMysteryVariable"...
myType = TypeName(myMysteryVariable)
Rem myType will be a string corresponding to the variable type (e.g., "Rectangle")
JavaScript
//Given a variable of unknown type, "myMysteryVariable"...
var myType =typeof (myMysteryVariable);
//If the variable is an object, "typeof" will return "object".
//To get the specific type of the object, add the following:
if (myType == "object"){
myType = myMysteryVariable.constructor.name;
}
//myType will be a string corresponding to the JavaScript type (e.g., "Rectangle")
When you are iterating through a collection, JavaScript will insist that the type of the item is the type of the collection. When you
are iterating through a pageItems collection, for example, the type of each item will be “PageItem,” rather than “Rectangle,” “Oval,”
“Polygon,” “GraphicLine,” or “TextFrame.” To get the specific type of an item when you are iterating through a collection of unlike
items, use the “getElements()” method, as shown below.
for(myCounter = 0; myCounter < app.activeDocument.pages.item(0).pageItems.length; myCounter ++){
var myPageItem = app.activeDocument.pages.item(0).pageItems.item(myCounter);
var myPageItemType = myPageItem.getElements()[0].constructor.name;
alert(myPageItemType);
}
Operators
Operators use variables or values to perform calculations (addition, subtraction, multiplication, and division) and return a value. For
example:
MyWidth/2
Would return a value equal to half of the content of the variable “myWidth.”
You can also use operators to perform comparisons (equal to, not equal to, greater than, or less than). For example:
MyWidth > myHeight
Would return the value “true” (or 1) if myWidth is greater than myHeight, or “false” (0), if it isn’t.
All of the scripting languages provide additional “utility” operators. In AppleScript and Visual Basic, the “&” concatenates (or joins)
two strings:
"Pride " & "and Prejudice"
...would return the string:
"Pride and Prejudice."
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
11
To accomplish the same end using JavaScript, use “+” to join the two strings.
"Pride " + "and Prejudice"
//returns the string: "Pride and Prejudice."
Methods
Methods (sometimes called “commands,” or “events”) are the “verbs” of scripting—they’re the parts of the script that make things
happen. The type of the object you’re working with determines the number and type of methods you can use to manipulate it.
In AppleScript, you’ll use the “make” command to create new objects, “set” to assign values to properties or create object variables.
In Visual Basic, you’ll use the “Add” method to create new objects, the “Set” statement to assign InDesign objects to Visual Basic
variables, and the = (equals) operator to property values (in Visual Basic.NET, you can omit the “Set”). In JavaScript, you use the
“add()” method to create new objects, and use “=” to assign objects to a variable.
If you use more than one scripting language, it’s easy to get confused as you switch from one language to another. When you’re using
AppleScript, remember that the equals sign is only used in logical statements (“If...”) and that “set” is used for all variable assignment.
When you’re using Visual Basic (versions other than VB.NET), keep in mind that “Set” is only used when you are creating an object
variable. In JavaScript, the equals sign is used for assigning values to a variable; you use “==” to compare objects.
Parameters are “control inputs” to the method—when you create a group, for example, InDesign needs to know which objects to
use when creating the new group. This is an example of a required paramter. When you create a new document, you can specify that
InDesign base the new document on a document preset, but it’s not required (it’s an optional parameter).
AppleScript
In AppleScript, you can also use the “with properties” to specify object properties as the object is created.
tell application "InDesign CS"
--Example of an optional parameter (requires that you have a document preset
--named "7x9_book_cover").
set myDocument to make document with document preset "7x9_book_cover"
tell page 1 of myDocument
--Example of using "with properties" to specify object properties as you create the object.
set myOval to make oval with properties {geometric bounds:{"6p", "6p", "18p", "18p"}}
--Another "with properties" example.
set myRectangle to make rectangle with properties {stroke weight:4}
--Example of a required parameter:
set myGroup to make group with properties {group items:{myOval, myRectangle}}
end tell
end tell
VBScript
Set myInDesign = CreateObject("InDesign.Application.CS")
Rem Example of an optional parameter (requires that you have
Rem a document preset named "7x9_book_cover").
Set myDocument = myInDesign.Documents.Add(myInDesign.DocumentPresets.Item("7x9_book_cover"))
Set myOval = myDocument.Pages.Item(1).Ovals.Add
myOval.GeometricBounds = Array("6p", "6p", "18p", "18p")
Set myRectangle = myDocument.Pages.Item(1).Rectangles.Add
myRectangle.StrokeWeight = 4
Rem Example of a required parameter.
Set myGroup = myDocument.Pages.Item(1).Groups.Add(Array(myOval, myRectangle))
12
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
JavaScript
//Example of an optional parameter (requires that you have
//a document preset named "7x9_book_cover").
var myDocument = app.documents.add(app.documentPresets.item("7x9_book_cover"))
//Example of setting object properties as you create the object.
//The "add" method can take three optional parameters. To set the properties as you
//create an object, you must use "undefined" for optional parameters you do not intend to set.
var myOval = myDocument.pages.item(0).ovals.add(undefined, undefined, undefined, {geometricBounds:["6p", "6p",
"18p", "18p"]});
var myRectangle = myDocument.pages.item(0).rectangles.add(undefined, undefined, undefined, {strokeWeight:4});
//Example of a required parameter.
var myGroup = myDocument.pages.item(0).groups.add([myOval, myRectangle]);
Conditional statements
If you could talk to InDesign in the course of a work session, you might say, “If the selected object is a rectangle, then set its stroke
weight to 12 points.” Conditional statements make decisions—they give your scripts a way to evaluate something (the color of the
selected object, or the number of pages in the publication, or the date) and then act according to the result. Conditional statements
almost always start with “if.”
The following examples check the number of currently open publications. If no publications are open, the scripts display a messages
in a dialog box.
AppleScript
tell application "InDesign CS"
if (count documents) = 0 then
display dialog "No InDesign documents are open!"
end if
end tell
Visual Basic
Dim myInDesign as InDesign.Application
Set myInDesign = CreateObject ("InDesign.Application.CS")
If myInDesign.Documents.Count = 0
MsgBox "No InDesign documents are open!"
End If
End Sub
JavaScript
if(app.documents.length==0){
alert("No InDesign documents are open!");
}
Note: JavaScript uses “==” for comparing values (as in the example above), and “=” for assigning values. Visual Basic and AppleScript
use “=” for both purposes.
Control structures
If you could talk to InDesign, you might say, “Repeat the following procedure twenty times.” In scripting terms, this sort of direction
is called a “control structure.” Control structures provide for repetitive processes, or “loops.” The idea of a loop is to repeat some
action over and over again, with or without changes between instances (or “iterations”) of the loop, until some condition is met.
Our scripting languages have a variety of different control structures to choose from. The simplest form of a loop is one that repeats
some series of script operations a set number of times.
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
13
AppleScript
repeat with counter from 1 to 20
--do something
end repeat
Visual Basic
For counter = 1 to 20
Rem do something
Next counter
JavaScript
for(var myCounter = 0; myCounter < 20; myCounter++){
//do something
}
A more complicated type of control structure loops until some condition is true or false.
AppleScript
set myStop to false
repeat while myStop = false
--do something, at some point setting myStop to true to leave the loop.
end repeat
Visual Basic
Do While myStop = false
Rem do something, at some point setting myStop to true to leave the loop.
loop
JavaScript
while (myStop == false){
//do something, at some point setting myStop to true to leave the loop.
}
Coordinates
InDesign, like every other page layout and drawing program, uses simple two-dimensional geometry to record the position of objects
on a page or spread. The horizontal component of a coordinate pair (or “point”) is referred to as “x,” the vertical position is denoted
by “y.” You can see these coordinates in the Transform palette when you select an object using the Selection tool. As in the InDesign
user interface, coordinates are measured relative to the location of the zero point, which may be at the upper-left corner of the spread,
or of the page, or at the binding edge of the spread.
There is one difference between the coordinates used in InDesign and the “traditional” geometric coordinate system you learned
about in Junior High School—on InDesign’s vertical (or “y”) axis, coordinates below the zero point are positive numbers; coordinates
above the zero point are negative numbers.
Most of the time, InDesign returns coordinates in x, y order, and expects you to provide them in that order. To tell InDesign to move
the current selection to a position two picas to the right and six picas below the zero point, for example, you’d use the following
script:
14
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
AppleScript
tell application "InDesign CS"
set mySelection to item 1 of selection
move mySelection to {"2p", "6p"}
end tell
Visual Basic
Dim myInDesign as InDesign.Application
Set myInDesign = CreateObject("InDesign.Application.CS")
myDocument.Selection.Item(1).Move Array("2p","6p")
JavaScript
with(app){
mySelection = selection[0];
mySelection.move(["2p", "6p"]);
}
Note, however, that InDesign returns some coordinates in a different order, and expects you to supply them in that order. Geometric
bounds and visible bounds are both arrays containing four coordinates—these coordinates define, in order, the top, left, bottom, and
right edges of the object’s bounding box (or “y1, x1, y2, x2”).
Measurement Units
When you send measurement values to InDesign, you can send either numbers (e.g., 14.65) or measurement strings (e.g., “1p7.1”). If
you send numbers, InDesign uses the publication’s current units of measurement; if you send measurement strings, InDesign uses
the units of measurement specified in the string.
InDesign returns coordinates and other measurement values using the publication’s current measurement units. In some cases, these
units will not resemble the measurement values shown in the Transform palette. If the current measurement system is picas, for
example, InDesign will return fractional values as decimals, rather than using the “picas and points” notation used by the Transform
palette. “1p6,” for example, is returned as “1.5.” InDesign does this because your scripting system would have trouble trying to
perform arithmetic operations using measurement strings—trying to add “0p3.5” to “13p4,” for example, would produce a script
error; adding .2916 to 13.333 (the converted pica measurements) will not.
If your script depends on adding, subtracting, multiplying, or dividing specific measurement values, you might want to set the
corresponding measurement units at the beginning of the script. At the end of the script, you can always set the measurement units
back to whatever they were before you ran the script. Or you can use measurement overrides, as many of the example scripts do.
A measurement override is a string containing a special character: “p” for picas (“1p6”), “pt” for points “18pt”, “m” for millimeters
(“2.3m”), or “i” for inches (“1.125i”).
Subroutines and Handlers
Subroutines and functions (in Visual Basic or JavaScript) or handlers (in AppleScript) are scripting modules you can refer to from
within your script. (In Visual Basic, the only real difference between subroutines and functions is that a function returns a value; a
subroutine does not.) Typically, you send a value or series of values to a subroutine (or handler), and get back some other value or
values. There’s nothing special about the code used in subroutines and handlers-they’re nothing more than conveniences to keep you
from having to type the same lines of code over and over again in your script. If you find yourself typing or pasting the same lines of
code into several different places in a script, you’ve identified a good candidate for a subroutine or handler.
AppleScript
--Calculate the geometric center of a selected page item
--Assumes you have a single page item selected.
tell application "InDesign CS"
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
15
set mySelection to item 1 of selection
--Use "my" (or "of me") to specify a handler outside of the current "tell" context.
set myCenterPoint to my myCalculateCenterPoint(mySelection)
display dialog "x center: " & item 1 of myCenterPoint & return & "y center: " & item 2 of myCenterPoint
end tell
--The following lines define the handler.
on myCalculateCenterPoint(myObject)
set myGeometricBounds to geometric bounds of myObject
set myX1 to item 2 of myGeometricBounds
set myY1 to item 1 of myGeometricBounds
set myX2 to item 4 of myGeometricBounds
set myY2 to item 3 of myGeometricBounds
set myXCenter to myX1 + ((myX2 - myX1) / 2)
set myYCenter to myY1 + ((myY2 - myY1) / 2)
return {myXCenter, myYCenter}
end myCalculateCenterPoint
Visual Basic
Rem Calculate the geometric center of a selected page item
Rem Assumes you have a single page item selected.
Dim myInDesign As InDesign.Application
Set myInDesign = CreateObject("InDesign.Application.CS")
Set mySelection = myInDesign.Selection.Item(1)
myCenterPoint = myCalculateCenterPoint(mySelection)
MsgBox "x center: " & myCenterPoint(0) & vbCr & "y center: " & myCenterPoint(1)
Private Function myCalculateCenterPoint(myObject)
myBounds = myObject.GeometricBounds
myX1 = myBounds(1)
myY1 = myBounds(0)
myX2 = myBounds(3)
myY2 = myBounds(2)
myXCenter = myX1 + ((myX2 - myX1) / 2)
myYCenter = myY1 + ((myY2 - myY1) / 2)
myCalculateCenterPoint = Array(myXCenter, myYCenter)
End Function
JavaScript
with(app){
var mySelection = selection[0];
var myCenterPoint = myCalculateCenterPoint(mySelection);
var myString = "x center: " + myCenterPoint[0] + "\n" + "y center: " + myCenterPoint[1];
alert(myString);
}
function myCalculateCenterPoint(myObject){
var myGeometricBounds = myObject.geometricBounds;
var myX1 = myGeometricBounds[1];
var myY1 = myGeometricBounds[0];
var myX2 = myGeometricBounds[3];
var myY2 = myGeometricBounds[2];
var myXCenter = myX1 + ((myX2 - myX1)/2);
var myYCenter = myY1 + ((myY2 - myY1)/2);
return [myXCenter, myYCenter];
}
16
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
Continuation
In both AppleScript and Visual Basic, a carriage return at the end of a line signals the end of the statement. Script lines, however, can
be quite long. How can you make the script more readable without breaking the long lines?
Both AppleScript and Visual Basic define special “continuation” characters—characters that break a line but direct the script to read
the broken line as a legitimate instruction. In AppleScript, enter Option-Return to enter a continuation character. In Visual Basic,
enter an underscore (“_”) followed by a carriage return at the end of the line to continue the line.
In both languages, the continuation character cannot be entered inside a string.
In JavaScript, “;” indicates the end of a statement. Statements may contain carriage returns, so there’s no need for a continuation
character. At the same time, JavaScript does not require semicolons at the end of statements, and will interpret each line as a complete
statement if it is possible to do so. For example:
return
true;
Will not be interpreted as:
return true;
In general, therefore, it’s best to end each line with a semicolon, and insert returns only a the end of statements.
Looking at InDesign’s Object Model
While the objects and commands available in InDesign are all documented in this guide, you can also view them from inside your
scripting system if you are using AppleScript or Visual Basic (JavaScript does not provide a way to view the InDesign object model).
AppleScript
To view InDesign’s AppleScript dictionary:
1. Start InDesign and the Apple Script Editor. The Script Editor comes with all Macintosh systems. If you can’t find the Script Editor,
you’ll have to reinstall it from your Mac OS System CD (or download it from http://www.apple.com).
2. In the Script Editor, choose File > Open Dictionary. The Script Editor displays a standard Open File dialog box.
3. Select the InDesign application and click the OK button. The Script Editor displays a list of InDesign’s objects and commands.
You’ll also be able to see the properties associated with each object.
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
17
Visual Basic
To view InDesign’s object library in Visual Basic (the steps shown are for Visual Basic 6; Visual Basic 5 CCE and Visual Basic.NET
users will see slightly different dialog boxes):
1. In any Visual Basic project, choose Project > References. Visual Basic displays the References dialog box.
2. Turn on the “Adobe InDesign CS Type Library” option from the list of available references and click the OK button If the library
does not appear in the list of available references, click the Browse button and locate and select the file “Resources for Visual Basic.
tlb” (which is usually inside ~:/Documents and Settings/user_name/ApplicationData/Adobe/InDesign CS—where “user_name” is
your user name). Once you’ve found the file, click the Open button to add the reference to your project.
3. Choose View > Object Browser. Visual Basic displays the Object Browser dialog box.
4. Choose “InDesign” from the list of open libraries shown in the Project/Library pop-up menu. Visual Basic displays the objects
making up the InDesign object model.
5. Click an object class. Visual Basic displays the properties and methods of the object. For more information on a property or
method, select the item—Visual Basic displays the definition of the item at the bottom of the Object Browser window.
18
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
JavaScript and VBScript
If you’re using JavaScript or VBScript to write your InDesign scripts, you won’t be able to view the InDesign object model as you can
in AppleScript or Visual Basic. Instead, refer to the corresponding reference section of this guide.
Your First InDesign Script
The traditional first project in any programming language is to display, or print, the message “Hello World!” In this example, we’ll
create a new InDesign publication, then add a frame containing this message.
AppleScript
To create an AppleScript script:
1. Locate and open the Apple Script Editor.
2. Enter the following script. The lines preceded by “--” are comments, and will be ignored by the scripting system. They’re included
to describe the operation of the program. As you look through the script, you’ll see how we create, then address each object in
turn. The AppleScript command “tell” sets the object that will receive the next message we send.
--Hello World
tell application "InDesign CS"
--Create a new document and assign its
--identity to the variable "myDocument"
set myDocument to make document
tell myDocument
--Create a new text frame on the first page.
tell page 1
set myTextFrame to make text frame
--Change the size of the text frame.
set geometric bounds of myTextFrame to {"0p0", "0p0", "18p0", "18p0"}
--Enter text in the text frame.
set contents of myTextFrame to "Hello World!"
end tell
end tell
end tell
3. Save the script.
4. Run the script (click the Run button in the Script Editor). InDesign should create a new publication, add a text frame, and enter
text. During this process, the Script Editor might ask where your copy of InDesign is located—select the application from the list
of applications displayed, and the Script Editor will remember where it is the next time you run the script.
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
19
Visual Basic
To create a Visual Basic script (the steps shown are for Visual Basic 6; Visual Basic 5 CCE and Visual Basic.NET users will see slightly
different dialog boxes):
1. Start Visual Basic and create a new project. Add the InDesign CS Type Library reference to the project, as shown earlier.
2. Create a new button on the default form. Double-click the button to open the Code window.
3. Enter the following code (between the “Private Sub” and “End Sub: lines defining the code under the button). The lines preceded
by “Rem” are comments, and will be ignored by the scripting system. They’re included to describe the operation of the program.
As you look through the script, you’ll see how we create, then address each object in turn. You do not need to enter the comments.
20
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
Rem Hello World
Rem Declare variable types (optional if Option Explicit is off).
Dim myInDesign As InDesign.Application
Dim myDocument As InDesign.Document
Dim myPage As InDesign.Page
Dim myTextFrame As InDesign.TextFrame
Rem End of variable type declarations.
Set myInDesign = CreateObject("InDesign.Application.CS")
Rem Create a new document.
Set myDocument = myInDesign.Documents.Add
Rem Get a reference to the first page.
Set myPage = myDocument.Pages.Item(1)
Rem Create a text frame.
Set myTextFrame = myDocument.TextFrames.Add
Rem Specify the size and shape of the text frame.
myTextFrame.GeometricBounds = Array("0p0", "0p0", "18p0", "18p0")
Rem Enter text in the text frame.
myTextFrame.Contents = "Hello World!"
4. Save the form.
5. Start InDesign.
6. Return to Visual Basic and run the program.
7. Click the button you created earlier. InDesign should create a new publication, create a new text frame, and then enter the text.
VBScript
To create a VBasic script:
1. Start any text editor (Notepad, for example).
2. Enter the following code. The lines preceded by “Rem” are comments, and will be ignored by the scripting system. They’re included to describe the operation of the program. As you look through the script, you’ll see how we create, then address each object in
turn. You do not need to enter the comments.
Rem Hello World
Set myInDesign = CreateObject("InDesign.Application.CS")
Rem Create a new document.
Set myDocument = myInDesign.Documents.Add
Rem Get a reference to the first page.
Set myPage = myDocument.Pages.Item(1)
Rem Create a text frame.
Set myTextFrame = myDocument.TextFrames.Add
Rem Specify the size and shape of the text frame.
myTextFrame.GeometricBounds = Array("0p0", "0p0", "18p0", "18p0")
Rem Enter text in the text frame.
myTextFrame.Contents = "Hello World!"
3. Save the file as text only to the Scripts folder in the Presets folder inside your InDesign application folder. Give the file the file
extension “.vbs”.
4. Display the Scripts palette, if it’s not already visible. Double-click the script name in the palette to run the script.
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
21
JavaScript
To create a JavaScript:
1. Using any text editor (including InDesign), enter the following text:
//Hello World!
var myDocument = app.documents.add();
with(myDocument){
var myPage = myDocument.pages.item(0);
with(myPage){
//Create a new text frame and assign it to the variable "myTextFrame"
var myTextFrame = textFrames.add();
//Specify the size and shape of the text frame.
myTextFrame.geometricBounds = [ "0p0", "0p0", "18p0", "18p0"];
//Enter text in the text frame.
myTextFrame.contents = "Hello World!"
}
}
2. Save the text as a plain text file with the file extension “.js” in the Scripts folder inside the Presets folder in your InDesign folder.
3. To test the script, double-click the script name in InDesign’s Scripts palette.
Adding features to “Hello World”
Next, let’s create a new script that makes changes to the “Hello World” publication we created with our first script. Don’t worry if
you’ve closed the publication without saving it—all you have to do to make a new one is run the script again. Our second script will
demonstrate how to:
• Get the active document.
• Use a function (or “handler” in AppleScript) in your script.
• Get the page dimensions and page margins of the active publication.
• Resize a text frame.
• Change the formatting of the text in the text frame.
AppleScript
To create the script:
1. Choose File > New in the Script Editor to create a new script.
2. Enter the following code:
--Improved "Hello World"
tell application "InDesign CS"
--Get a reference to a font.
try
--Enter the name of a font on your system, if necessary.
set myFont to font "Helvetica"
end try
--Get the active document and assign the result to the variable "myDocument."
22
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
set myDocument to active document
tell myDocument
--Use the handler "myGetBounds" to get the bounds of the
--"live area" inside the margins of page 1.
set myBounds to myGetBounds(myDocument, page 1)
tell text frame 1 of page 1
--Resize the text frame to match the page margins.
set geometric bounds to myBounds
tell paragraph 1
--Change the font, size, and paragraph alignment.
try
set applied font to myFont
end try
set point size to 72
et justification to center align
end tell
end tell
end tell
end tell
--myGetBounds is a handler that returns the bounds of the "live area" of a page.
on myGetBounds(myDocument, myPage)
tell application "InDesign CS"
set myPageHeight to page height of document preferences of myDocument
set myPageWidth to page width of document preferences of myDocument
set myLeft to left of margin preferences of myPage
set myTop to top of margin preferences of myPage
set myRight to right of margin preferences of myPage
set myBottom to bottom of margin preferences of myPage
end tell
set myRight to myLeft + (myPageWidth - (myRight + myLeft))
set myBottom to myTop + (myPageHeight - (myBottom + myTop))
return {myTop, myLeft, myBottom, myRight}
end myGetBounds
3. Save the script. Make sure you have the “Hello World” document open, then run the script.
Visual Basic
To create the script:
1. Open the project you created for the “Hello World” script, if it’s not already open.
2. Add a new button to the form.
3. Double-click the button to display the Code window, then enter the following code.
Rem
Rem
Dim
Dim
Dim
Dim
Dim
Rem
Set
Rem
Improved "Hello World"
Declare variable types (optional if Option Explicit is off)
myInDesign As InDesign.Application
myDocument As InDesign.Document
myPage As InDesign.Page
myStory As InDesign.Story
myTextFrame As InDesign.TextFrame
End of variable type declarations.
myInDesign = CreateObject("InDesign.Application.CS")
Enter the name of a font on your system, if necessary.
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
23
Set myFont = myInDesign.Fonts.Item("Arial")
Set myDocument = myInDesign.ActiveDocument
Set myPage = myDocument.Pages.Item(1)
Rem Get page width and page height using the function "myGetBounds".
myBounds = myGetBounds(myDocument, myPage)
Set myTextFrame = myPage.TextFrames.Item(1)
Rem Resize the text frame to match the publication margins.
myTextFrame.GeometricBounds = myBounds
Set myParagraph = myTextFrame.Paragraphs.Item(1)
Rem Change the font, size, and alignment.
If TypeName(myFont) <> "Nothing" Then
myParagraph.AppliedFont = myFont
End If
myParagraph.PointSize = 48
myParagraph.Justification = idJustification.idLeftAlign
4. After the “End Sub” line, enter the following text to create a function.
Private Function myGetBounds(myDocument, myPage)
Rem Declare variable types (optional if Option Explicit is turned off)
Rem Omit if you are using VBSCript.
Dim myPageHeight, myPageWidth, myTop, myLeft, myRight, myBottom As Double
Rem End of variable declaractions.
myPageHeight = myDocument.DocumentPreferences.PageHeight
myPageWidth = myDocument.DocumentPreferences.PageWidth
myTop = myPage.MarginPreferences.Top
myLeft = myPage.MarginPreferences.Left
myRight = myPage.MarginPreferences.Right
myBottom = myPage.MarginPreferences.Bottom
myRight = myPageWidth - myRight
myBottom = myPageHeight - myBottom
myGetBounds = Array(myTop, myLeft, myBottom, myRight)
Rem If you are using VB.NET, replace the line above with the following:
Rem myGetBounds = New Double(myTop, myLeft, myBottom, myRight)
End Function
5. Save the form. Make sure you have the “Hello World” document open, then click the button you created in Step 2 to run the script.
VBScript
To create the script:
1. Start any text editor (Notepad, for example).
2. Enter the following code. The lines preceded by “Rem” are comments, and will be ignored by the scripting system. They’re included to describe the operation of the program. As you look through the script, you’ll see how we create, then address each object in
turn. You do not need to enter the comments.
Rem Improved "Hello World"
Set myInDesign = CreateObject("InDesign.Application.CS")
Rem Enter the name of a font on your system, if necessary.
Set myFont = myInDesign.Fonts.Item("Arial")
Set myDocument = myInDesign.ActiveDocument
Set myPage = myDocument.Pages.Item(1)
Rem Get page width and page height using the function "myGetBounds".
myBounds = myGetBounds(myDocument, myPage)
24
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
Set myTextFrame = myPage.TextFrames.Item(1)
Rem Resize the text frame to match the publication margins.
myTextFrame.GeometricBounds = myBounds
Set myParagraph = myTextFrame.Paragraphs.Item(1)
Rem Change the font, size, and alignment.
If TypeName(myFont) <> "Nothing" Then
myParagraph.AppliedFont = myFont
End If
myParagraph.PointSize = 48
myParagraph.Justification = idJustification.idLeftAlign
Function myGetBounds(myDocument, myPage)
myPageHeight = myDocument.DocumentPreferences.PageHeight
myPageWidth = myDocument.DocumentPreferences.PageWidth
myTop = myPage.MarginPreferences.Top
myLeft = myPage.MarginPreferences.Left
myRight = myPage.MarginPreferences.Right
myBottom = myPage.MarginPreferences.Bottom
myRight = myPageWidth - myRight
myBottom = myPageHeight - myBottom
myGetBounds = Array(myTop, myLeft, myBottom, myRight)
Rem If you are using VB.NET, replace the line above with the following:
Rem myGetBounds = New Double(myTop, myLeft, myBottom, myRight)
End Function
3. Save the text as a plain text file with the file extension “.vbs” in the Scripts folder inside the Presets folder in your InDesign folder.
4. To test the script, make sure you have the “Hello World” document open, then double-click the script name in InDesign’s Scripts
palette.
JavaScript
1. Enter the following JavaScript in a new text file.
//Improved Hello World!
//Enter the name of a font on your system, if necessary.
myFont = app.fonts.item("Arial");
var myDocument = app.activeDocument
with(myDocument){
var myPage = pages.item(0);
var myBounds = myGetBounds(myPage,myDocument);
with(myDocument.pages.item(0)){
//Get a reference to the text frame.
var myTextFrame = textFrames.item(0);
//Change the size of the text frame.
myTextFrame.geometricBounds = myBounds;
var myParagraph = myTextFrame.paragraphs.item(0);
myParagraph.appliedFont = myFont;
myParagraph.justification = Justification.leftAlign;
myParagraph.pointSize = 48;
}
}
//myGetBounds calculates and return the bounds of the "live area" of the page.
function myGetBounds(myPage, myDocument){
var array = new Array()
var item = 0;
with (myDocument.documentPreferences){
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
25
var myPageHeight = pageHeight;
var myPageWidth = pageWidth;
}
with(myPage.marginPreferences){
var myX1 = left;
var myY1 = top;
var myY2 = bottom;
var myX2 = right;
}
array[item++] = myY1;
array[item++] = myX1;
array[item++] = myPageHeight - myY2;
array[item++] = myPageWidth - myX2;
return array;
}
2. Save the text as a plain text file with the file extension “.js” in the Scripts folder inside the Presets folder in your InDesign folder.
3. To test the script, double-click the script name in InDesign’s Scripts palette.
26
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
Adding a user interface
If you want your script to collect and act on information entered by you or any other user of your script, you’ll probably want to add
a user interface to the script. While AppleScript, VBScript, and JavaScript can create dialog boxes for simple yes/no questions and
text entry, you might want to create more complex dialog boxes. While Visual Basic can create complete user interfaces, these run
from a separate Visual Basic executable file. InDesign scripting includes the ability to create complex dialog boxes that appear inside
InDesign, and look very much like the program’s standard user interface items.
Dialog overview
An InDesign dialog is an object like any other in InDesign scripting. The dialog can contain text edit fields (known as “text editbox
controls”), number entry fields (“real editbox,” “integer editbox,” and other controls), pop-up menus (“dropdown controls”), controls
which combine a text edit field with a pop-up menu (combobox controls), checkboxes (“checkbox controls”) and radio buttons
(“radiobutton controls”).
Actually, the dialog object itself does not directly contain the controls—that’s the purpose of the dialog column object. Dialog
columns give you a way to control the positioning of controls within a dialog box. Inside dialog columns, you can further subdivide
the dialog into other dialog columns or border panels (both of which can, if necessary, contain further dialog columns and border
panels).
border panel
dialog column
dialog column
dialog column
dialog column
static text
radiobutton group
radiobutton control
integer editbox
checkbox control
dropdown
Like any other InDesign scripting object, the various parts of a dialog box have their own properties. A checkbox control, for
example, has a property for its text (“static label”) and another property for its state (“checked state”). The dropdown control has a
property for setting the list of options that appear on the control’s menu (“string list”).
To use a dialog box in your script, you create the dialog box object, populate it with various controls, display the dialog box, and then
gather values from the dialog box controls for use in your script. Dialogs remain in InDesign’s memory until they are destroyed. This
means that you can keep a dialog box in memory and have data stored in its properties used by multiple scripts, but it also means that
the dialog boxes take up memory and should be disposed of when the are not in use. In general, you should destroy the dialog box
object before your script finishes execution.
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
27
Adding a user interface to “Hello World”
In this example, we’ll add a simple user interface to our “Hello World” script. The options in the dialog box will provide a way
for you to specify the example text (we assume you’re tired of the phrase “Hello World” by now) and change the point size of the
text. These examples also use a handler (AppleScript), or function (VBScript, JavaScript) to get the “live area” of the current page
(“myGetBounds”).
AppleScript
1. Enter the following AppleScript in your script editor.
--Simple User Interface Example
tell application "InDesign CS"
activate
set myDocument to make document
set myDialog to make dialog
tell myDialog
set name to "Simple User Interface Example Script"
set myDialogColumn to make dialog column
tell myDialogColumn
--Create a text entry field.
set myTextEditField to make text editbox with properties {edit contents:"Hello World!", min width:180}
--Create a number (real) entry field.
set myPointSizeField to make real editbox with properties {edit contents:"72"}
end tell
show
--Get the settings from the dialog box.
--Get the point size from the point size field.
set myPointSize to edit contents of myPointSizeField as real
--Get the example text from the text edit field.
set myString to edit contents of myTextEditField
--Remove the dialog box from memory.
destroy myDialog
end tell
tell page 1 of myDocument
--Create a text frame.
set myTextFrame to make text frame
set geometric bounds of myTextFrame to my myGetBounds(myDocument, page 1 of myDocument)
--Apply the settings from the dialog box to the text frame.
set contents of myTextFrame to myString
--Set the point size of the text in the text frame.
set point size of text 1 of myTextFrame to myPointSize
end tell
end tell
on myGetBounds(myDocument, myPage)
tell application "InDesign CS"
set myPageHeight to page height of document preferences of myDocument
set myPageWidth to page width of document preferences of myDocument
set myLeft to left of margin preferences of myPage
set myTop to top of margin preferences of myPage
set myRight to right of margin preferences of myPage
set myBottom to bottom of margin preferences of myPage
end tell
set myRight to myLeft + (myPageWidth - (myRight + myLeft))
set myBottom to myTop + (myPageHeight - (myBottom + myTop))
return {myTop, myLeft, myBottom, myRight}
end myGetBounds
28
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
2. Save the text as a compiled script in the Scripts folder inside the Presets folder in your InDesign folder.
3. To test the script, double-click the script name in InDesign’s Scripts palette, or run it from your script editor.
VBScript
Because most Visual Basic users will use Visual Basic forms and controls to create user interfaces, the following example is a
VBScript. Save this script as a text file with the file extension “.vbs” to the Scripts folder inside the Presets folder in your InDesign
folder, then run the script from the Scripts palette.
1. Enter the following VBScript using any text editor.
Rem Simple User Interface Example
Set myInDesign = CreateObject("InDesign.Application.CS")
Set myDialog = myInDesign.Dialogs.Add
myDialog.CanCancel = True
myDialog.Name = " Simple User Interface Example Script"
Set myDialogColumn = myDialog.DialogColumns.Add
Set myTextEditField = myDialogColumn.TextEditboxes.Add
myTextEditField.EditContents = "Hello World!"
myTextEditField.MinWidth = 180
Rem Create a number (real) entry field.
Set myPointSizeField = myDialogColumn.RealEditboxes.Add
myPointSizeField.EditValue = 72
myDialog.Show
Rem Get the values from the dialog box controls.
myString = myTextEditField.EditContents
myPointSize = myPointSizeField.EditValue
Rem Remove the dialog box from memory.
myDialog.Destroy
Rem Create a new document.
Set myDocument = myInDesign.Documents.Add
Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
Rem Resize the text frame to the "live" area of the page (using the function "myGetBounds").
myBounds = myGetBounds(myDocument, myDocument.Pages.Item(1))
myTextFrame.GeometricBounds = myBounds
Rem Enter the text from the dialog box in the text frame.
myTextFrame.Contents = myString
Rem Set the size of the text to the size you entered in the dialog box.
myTextFrame.Texts.Item(1).PointSize = myPointSize
Rem Function for getting the bounds of the "live area"
Function myGetBounds(myDocument, myPage)
myPageHeight = myDocument.DocumentPreferences.PageHeight
myPageWidth = myDocument.DocumentPreferences.PageWidth
myTop = myPage.MarginPreferences.Top
myLeft = myPage.MarginPreferences.Left
myRight = myPage.MarginPreferences.Right
myBottom = myPage.MarginPreferences.Bottom
myRight = myPageWidth - myRight
myBottom = myPageHeight - myBottom
myGetBounds = Array(myTop, myLeft, myBottom, myRight)
End Function
2. Save the text as a plain text file with the file extension “.vbs” in the Scripts folder inside the Presets folder in your InDesign folder.
3. To test the script, double-click the script name in InDesign’s Scripts palette.
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
29
JavaScript
1. Enter the following JavaScript using any text editor.
//Simple User Interface Example
var myDialog = app.dialogs.add({name:"Simple User Interface Example Script",canCancel:true});
with(myDialog){
//Add a dialog column.
with(dialogColumns.add()){
//Create a text edit field.
var myTextEditField = textEditboxes.add({editContents:"Hello World!", minWidth:180});
//Create a number (real) entry field.
var myPointSizeField = realEditboxes.add({editValue:72});
}
}
//Display the dialog box.
var myResult = myDialog.show();
if(myResult == true){
//Get the values from the dialog box controls.
var myString = myTextEditField.editContents;
var myPointSize = myPointSizeField.editValue;
//Remove the dialog box from memory.
myDialog.destroy();
//Create a new document.
var myDocument = app.documents.add()
with(myDocument){
//Create a text frame.
var myTextFrame = pages.item(0).textFrames.add();
//Resize the text frame to the "live" area of the page (using the function "myGetBounds").
var myBounds = myGetBounds(myDocument, myDocument.pages.item(0));
myTextFrame.geometricBounds=myBounds;
//Enter the text from the dialog box in the text frame.
myTextFrame.contents=myString;
//Set the size of the text to the size you entered in the dialog box.
myTextFrame.texts.item(0).pointSize = myPointSize;
}
}
else{
//User clicked Cancel, so remove the dialog box from memory.
myDialog.destroy();
}
function myGetBounds(myDocument, myPage){
with(myDocument.documentPreferences){
var myPageHeight = pageHeight;
var myPageWidth = pageWidth;
}
with(myPage.marginPreferences){
var myTop = top;
var myLeft = left;
var myRight = right;
var myBottom = bottom;
}
myRight = myPageWidth - myRight;
myBottom = myPageHeight- myBottom;
return [myTop, myLeft, myBottom, myRight];
}
30
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
2. Save the text as a plain text file with the file extension “.js” in the Scripts folder inside the Presets folder in your InDesign folder.
3. To test the script, double-click the script name in InDesign’s Scripts palette.
Creating a more complex user interface
In the next set of examples, we’ll add more controls and more different types of controls to the example dialog box.
AppleScript
1. Enter the following AppleScript in your script editor.
--Complex User Interface Example
tell application "InDesign CS"
activate
set myDocument to make document
set myDialog to make dialog
--This example dialog box uses border panels and dialog columns to
--separate and organize the user interface items in the dialog.
tell myDialog
set name to "User Interface Example Script"
set myDialogColumn to make dialog column
tell myDialogColumn
set myBorderPanel to make border panel
tell myBorderPanel
set myDialogColumn to make dialog column
tell myDialogColumn
make static text with properties {static label:"Message:"}
end tell
set myDialogColumn to make dialog column
tell myDialogColumn
set myTextEditField to make text editbox with properties ¬
{edit contents:"Hello World!", min width:180}
end tell
end tell
set myBorderPanel to make border panel
tell myBorderPanel
set myDialogColumn to make dialog column
tell myDialogColumn
make static text with properties {static label:"Point Size:"}
end tell
set myDialogColumn to make dialog column
tell myDialogColumn
set myPointSizeField to make real editbox with properties {edit contents:"72"}
end tell
end tell
set myBorderPanel to make border panel
tell myBorderPanel
set myDialogColumn to make dialog column
tell myDialogColumn
make static text with properties {static label:"Vertical Justification:"}
end tell
set myDialogColumn to make dialog column
tell myDialogColumn
set myVerticalJustificationMenu to make dropdown with properties ¬
{string list:{"Top", "Center", "Bottom"}, selected index:0}
end tell
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
31
end tell
set myBorderPanel to make border panel
tell myBorderPanel
make static text with properties {static label:"Paragraph Alignment:"}
set myParagraphAlignmentGroup to make radiobutton group
tell myParagraphAlignmentGroup
set myLeftRadioButton to make radiobutton control with properties ¬
{static label:"Left", checked state:true}
set myCenterRadioButton to make radiobutton control with properties ¬
{static label:"Center"}
set myRightRadioButton to make radiobutton control with properties ¬
{static label:"Right"}
end tell
end tell
end tell
show
--Get the settings from the dialog box.
--Get the point size from the point size field.
set myPointSize to edit contents of myPointSizeField as real
--Get the example text from the text edit field.
set myString to edit contents of myTextEditField
--Get the vertical justification setting from the pop-up menu.
if selected index of myVerticalJustificationMenu is 0 then
set myVerticalJustification to top align
else if selected index of myVerticalJustificationMenu is 1 then
set myVerticalJustification to center align
else
set myVerticalJustification to bottom align
end if
--Get the paragraph alignment setting from the radiobutton group.
get properties of myParagraphAlignmentGroup
if selected button of myParagraphAlignmentGroup is 0 then
set myParagraphAlignment to left align
else if selected button of myParagraphAlignmentGroup is 1 then
set myParagraphAlignment to center align
else
set myParagraphAlignment to right align
end if
--Remove the dialog box from memory.
destroy myDialog
end tell
tell page 1 of myDocument
set myTextFrame to make text frame
set geometric bounds of myTextFrame to my myGetBounds(myDocument, page 1 of myDocument)
--Apply the settings from the dialog box to the text frame.
set contents of myTextFrame to myString
--Apply the vertical justification setting.
set vertical justification of text frame preferences of myTextFrame to myVerticalJustification
--Apply the paragraph alignment ("justification").
--"text 1 of myTextFrame" is all of the text in the text frame.
set justification of text 1 of myTextFrame to myParagraphAlignment
--Set the point size of the text in the text frame.
set point size of text 1 of myTextFrame to myPointSize
end tell
end tell
on myGetBounds(myDocument, myPage)
tell application "InDesign CS"
32
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
set myPageHeight to page height of document preferences of myDocument
set myPageWidth to page width of document preferences of myDocument
set myLeft to left of margin preferences of myPage
set myTop to top of margin preferences of myPage
set myRight to right of margin preferences of myPage
set myBottom to bottom of margin preferences of myPage
end tell
set myRight to myLeft + (myPageWidth - (myRight + myLeft))
set myBottom to myTop + (myPageHeight - (myBottom + myTop))
return {myTop, myLeft, myBottom, myRight}
end myGetBounds
2. Save the text as a compiled script in the Scripts folder inside the Presets folder in your InDesign folder.
3. To test the script, double-click the script name in InDesign’s Scripts palette, or run it from your script editor.
VBScript
Because most Visual Basic users will use Visual Basic forms and controls to create user interfaces, the following example is a
VBScript. Save this script as a text file with the file extension “.vbs” to the Scripts folder inside the Presets folder in your InDesign
folder, then run the script from the Scripts palette.
1. Enter the following VBScript using any text editor.
Rem Complex User Interface Example
Set myInDesign = CreateObject("InDesign.Application.CS")
myInDesign.Activate
Set myDialog = myInDesign.Dialogs.Add
myDialog.CanCancel = True
myDialog.Name = "User Interface Example Script"
Rem Create a dialog column.
Set myDialogColumn = myDialog.DialogColumns.Add
Rem Create a border panel.
Set myBorderPanel = myDialogColumn.BorderPanels.Add
Rem Create a dialog column inside the border panel.
Set myTempDialogColumn = myBorderPanel.DialogColumns.Add
Set myStaticText = myTempDialogColumn.StaticTexts.Add
myStaticText.StaticLabel = "Message:"
Rem Create another dialog column inside the border panel.
Set myTempDialogColumn = myBorderPanel.DialogColumns.Add
Set myTextEditField = myTempDialogColumn.TextEditboxes.Add
myTextEditField.EditContents = "Hello World!"
myTextEditField.MinWidth = 180
Rem Create another border panel.
Set myBorderPanel = myDialogColumn.BorderPanels.Add
Rem Create a dialog column inside the border panel.
Set myTempDialogColumn = myBorderPanel.DialogColumns.Add
Set myStaticText = myTempDialogColumn.StaticTexts.Add
myStaticText.StaticLabel = "Point Size:"
Rem Create another dialog column inside the border panel.
Set myTempDialogColumn = myBorderPanel.DialogColumns.Add
Set myPointSizeField = myTempDialogColumn.RealEditboxes.Add
myPointSizeField.EditValue = 72
Rem Create another border panel.
Set myBorderPanel = myDialogColumn.BorderPanels.Add
Rem Create a dialog column inside the border panel.
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
33
Set myTempDialogColumn = myBorderPanel.DialogColumns.Add
Set myStaticText = myTempDialogColumn.StaticTexts.Add
myStaticText.StaticLabel = "Vertical Justification:"
Rem Create another dialog column inside the border panel.
Set myTempDialogColumn = myBorderPanel.DialogColumns.Add
Set myVerticalJustificationMenu = myTempDialogColumn.Dropdowns.Add
myVerticalJustificationMenu.StringList = Array("Top", "Center", "Bottom")
myVerticalJustificationMenu.SelectedIndex = 0
Rem Create another border panel.
Set myBorderPanel = myDialogColumn.BorderPanels.Add
Rem Create a dialog column inside the border panel.
Set myTempDialogColumn = myBorderPanel.DialogColumns.Add
Set myStaticText = myTempDialogColumn.StaticTexts.Add
myStaticText.StaticLabel = "Paragraph Alignment:"
Rem Create another dialog column inside the border panel.
Set myTempDialogColumn = myBorderPanel.DialogColumns.Add
Set myRadioButtonGroup = myTempDialogColumn.RadiobuttonGroups.Add
Set myLeftRadioButton = myRadioButtonGroup.RadiobuttonControls.Add
myLeftRadioButton.StaticLabel = "Left"
myLeftRadioButton.CheckedState = True
Set myCenterRadioButton = myRadioButtonGroup.RadiobuttonControls.Add
myCenterRadioButton.StaticLabel = "Center"
Set myRightRadioButton = myRadioButtonGroup.RadiobuttonControls.Add
myRightRadioButton.StaticLabel = "Right"
Rem If the user clicked OK, then create the example document.
If myDialog.Show = True Then
Rem Get the values from the dialog box controls.
myString = myTextEditField.EditContents
myPointSize = myPointSizeField.EditValue
Rem Create a new document.
Set myDocument = myInDesign.Documents.Add
Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
Rem Resize the text frame to the "live" area of the page (using the function "myGetBounds").
myBounds = myGetBounds(myDocument, myDocument.Pages.Item(1))
myTextFrame.GeometricBounds = myBounds
Rem Enter the text from the dialog box in the text frame.
myTextFrame.Contents = myString
Rem Set the size of the text to the size you entered in the dialog box.
myTextFrame.Texts.Item(1).PointSize = myPointSize
Rem Set the vertical justification of the text frame to the dialog menu choice.
Select Case myVerticalJustificationMenu.SelectedIndex
Case 0
myTextFrame.TextFramePreferences.VerticalJustification = idVerticalJustification.idTopAlign
Case 1
myTextFrame.TextFramePreferences.VerticalJustification = idVerticalJustification.idCenterAlign
Case Else
myTextFrame.TextFramePreferences.VerticalJustification = idTopAlign.idBottomAlign
End Select
Rem set the paragraph alignment of the text to the dialog radio button choice.
Select Case myRadioButtonGroup.SelectedButton
Case 0
myTextFrame.Texts.Item(1).Justification = idJustification.idLeftAlign
Case 1
myTextFrame.Texts.Item(1).Justification = idJustification.idCenterAlign
Case Else
myTextFrame.Texts.Item(1).Justification = idJustification.idRightAlign
End Select
34
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
Rem Remove the dialog box from memory.
myDialog.Destroy
End If
Rem Function for getting the bounds of the "live area"
Function myGetBounds(myDocument, myPage)
myPageHeight = myDocument.DocumentPreferences.PageHeight
myPageWidth = myDocument.DocumentPreferences.PageWidth
myTop = myPage.MarginPreferences.Top
myLeft = myPage.MarginPreferences.Left
myRight = myPage.MarginPreferences.Right
myBottom = myPage.MarginPreferences.Bottom
myRight = myPageWidth - myRight
myBottom = myPageHeight - myBottom
myGetBounds = Array(myTop, myLeft, myBottom, myRight)
End Function
2. Save the text as a plain text file with the file extension “.vbs” in the Scripts folder inside the Presets folder in your InDesign folder.
3. To test the script, double-click the script name in InDesign’s Scripts palette.
JavaScript
1. Enter the following JavaScript using any text editor.
//Complex User Interface Example
//Create a dialog.
var myDialog = app.dialogs.add({name:"User Interface Example Script", canCancel:true});
with(myDialog){
//Add a dialog column.
with(dialogColumns.add()){
//Create a border panel.
with(borderPanels.add()){
with(dialogColumns.add()){
//The following line shows how to set a property as you create an object.
staticTexts.add({staticLabel:"Message:"});
}
with(dialogColumns.add()){
//The following line shows how to set multiple properties as you create an object.
var myTextEditField = textEditboxes.add({editContents:"Hello World!", minWidth:180});
}
}
//Create another border panel.
with(borderPanels.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Point Size:"});
}
with(dialogColumns.add()){
//Create a number entry field. Note that this field uses editValue
//rather than editText (as a textEditBox would).
var myPointSizeField = realEditboxes.add({editValue:72});
}
}
//Create another border panel.
with(borderPanels.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Vertical Justification:"});
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
35
}
with(dialogColumns.add()){
//Create a pop-up menu ("dropdown") control.
var myVerticalJustificationMenu = dropdowns.add({stringList:["Top", "Center", "Bottom"],
selectedIndex:0});
}
}
//Create another border panel.
with(borderPanels.add()){
staticTexts.add({staticLabel:"Paragraph Alignment:"});
var myRadioButtonGroup = radiobuttonGroups.add();
with(myRadioButtonGroup){
var myLeftRadioButton = radiobuttonControls.add({staticLabel:"Left", checkedState:true});
var myCenterRadioButton = radiobuttonControls.add({staticLabel:"Center"});
var myRightRadioButton = radiobuttonControls.add({staticLabel:"Right"});
}
}
}
}
//Display the dialog box.
if(myDialog.show() == true){
var myParagraphAlignment, myString, myPointSize, myVerticalJustification;
//If the user didn’t click the Cancel button,
//then get the values back from the dialog box.
//Get the example text from the text edit field.
myString = myTextEditField.editContents
//Get the point size from the point size field.
myPointSize = myPointSizeField.editValue;
//Get the vertical justification setting from the pop-up menu.
if(myVerticalJustificationMenu.selectedIndex == 0){
myVerticalJustification = VerticalJustification.topAlign;
}
else if(myVerticalJustificationMenu.selectedIndex == 1){
myVerticalJustification = VerticalJustification.centerAlign;
}
else{
myVerticalJustification = VerticalJustification.bottomAlign;
}
//Get the paragraph alignment setting from the radiobutton group.
if(myRadioButtonGroup.selectedButton == 0){
myParagraphAlignment = Justification.leftAlign;
}
else if(myRadioButtonGroup.selectedButton == 1){
myParagraphAlignment = Justification.centerAlign;
}
else{
myParagraphAlignment = Justification.rightAlign;
}
myDialog.destroy();
//Now create the document and apply the properties to the text.
var myDocument = app.documents.add();
with(myDocument){
var myPage = pages[0];
with(myPage){
//Create a text frame.
var myTextFrame = pages.item(0).textFrames.add();
with(myTextFrame){
36
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
//Set the geometric bounds of the frame using the "myGetBounds" function.
geometricBounds = myGetBounds(myDocument, myPage);
//Set the contents of the frame to the string you entered in the dialog box.
contents = myString;
//Set the alignment of the paragraph.
texts.item(0).justification = myParagraphAlignment;
//Set the point size of the text.
texts.item(0).pointSize = myPointSize;
//Set the vertical justification of the text frame.
textFramePreferences.verticalJustification = myVerticalJustification;
}
}
}
}
else{
myDialog.destroy()
}
//Utility function for getting the bounds of the "live area" of a page.
function myGetBounds(myDocument, myPage){
with(myDocument.documentPreferences){
var myPageHeight = pageHeight;
var myPageWidth = pageWidth;
}
with(myPage.marginPreferences){
var myTop = top;
var myLeft = left;
var myRight = right;
var myBottom = bottom;
}
myRight = myPageWidth - myRight;
myBottom = myPageHeight- myBottom;
return [myTop, myLeft, myBottom, myRight];
}
2. Save the text as a plain text file with the file extension “.js” in the Scripts folder inside the Presets folder in your InDesign folder.
3. To test the script, double-click the script name in InDesign’s Scripts palette.
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
37
About error handling
Imagine that you’ve written a script that formats the current text selection. What should the script do if the current selection turns
out not to be text at all, but a rectangle, oval, or polygon? “Error handling” is code you add to your script to respond to conditions
other than those you expect it to encounter.
If you have complete control over the situations in which your script will run, there’s no need for you to worry about error handling.
If not, however, you’ll have to add some error handling capabilities to your script. The following examples show how to how you can
stop a script from executing when no objects are selected in InDesign.
AppleScript
tell application "InDesign CS"
--First, check to see whether any InDesign documents are open.
--If no documents are open, display an error message.
if (count documents) is not equal to 0 then
set mySelection to selection
if (count mySelection) is not equal to 0 then
--Something is selected. If this were a real script, you would
--now do something with the object or objects in the selection.
display dialog "You have " & (count mySelection) & " items selected."
else
--No objects were selected, so display an error message.
display dialog "No InDesign objects are selected. Please select an object and try again."
end if
else
--No documents were open, so display an error message.
display dialog "No InDesign documents are open. Please open a document and try again."
end if
end tell
Visual Basic
Dim myInDesign As InDesign.Application
Set myInDesign = CreateObject("InDesign.Application.CS")
Rem First, check to see whether any InDesign documents are open.
Rem If no documents are open, display an error message.
If myInDesign.Documents.Count <> 0 Then
If myInDesign.Selection.Count > 0 Then
Rem Something is selected. If this were a real script, you would
Rem now do something with the object or objects in the selection.
MsgBox "You have " & CStr(myInDesign.Selection.Count) & " items selected."
Else
Rem Nothing is selected, so display an error message.
MsgBox "No InDesign objects are selected. Please select an object and try again."
End If
Else
Rem No documents are open, so display an error message.
MsgBox "No InDesign documents are open. Please open a file and try again."
End If
38
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
JavaScript
//First, check to see whether any InDesign documents are open.
//If no documents are open, display an error message.
if (app.documents.length > 0){
if (app.selection.length > 0) {
//Something is selected. If this were a real script, you would
//now do something with the object or objects in the selection.
alert("You have " + app.selection.length + " items selected.")
}
else {
//Nothing is selected, so display an error message.
alert("Nothing is selected. Please select an object and try again.")
}
}
else {
//No documents are open, so display an error message.
alert("No InDesign documents are open. Please open a document and try again.")
}
You can also use JavaScript’s “try…catch” statement for error handling, as shown in the example below:
//Display the type of the first item in the selection.
try {
myObjectType = app.selection[0].constructor.name;
alert("The first selected item is a " + myObjectType + " object.");
}
catch (e){
if (app.documents.length == 0){
//No documents are open, so display an error message.
alert("No InDesign documents are open. Please open a document and try again.");
}
else {
if (app.selection.length == 0){
//Nothing is selected, so display an error message.
alert("Nothing is selected. Please select an object and try again.");
}
else{
alert("An error occurred, but I’m not sure what it was.");
}
}
}
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
39
Testing and troubleshooting
Scripting environments provide tools for monitoring the progress of your script as it’s running. This makes it much easier for you to
track down any problems your script might be encountering or causing.
AppleScript
The Apple Script Editor application doesn’t have extensive debugging tools, but it does have the AppleScript Event Log Window.
To watch your script send commands to and receive information from InDesign, choose Controls>Open Event Log. The Script
Editor displays the Event Log window. Turn on the Show Events and Show Events Results options, and then run your script. As
the script executes, you’ll see the commands sent to InDesign, and InDesign’s responses. In addition, the Result window (choose
Controls>Show Result) displays the value returned from the most recent script statement.
Third-party AppleScript editors, such as Script Debugger (from Late Night Software: www.latenightsw.com) offer far more robust
debugging features than the Apple Script Editor. If you will be writing more than a few simple scripts, we strongly recommend that
you acquire a script editor with better script debugging capabilities.
Visual Basic
In Visual Basic, you can stop your script at any point, and can step through your script one line at a time. You can also observe the
values of variables defined in your script using the Watch and Locals windows—two very valuable tool for debugging your scripts.
To view a variable in the Watch window, select the variable and choose Debug>Quick Watch. Visual Basic displays the Quick Watch
dialog box. Click the Add button. Visual Basic displays the Watch window. To stop your script at a particular line (so you can get a
look at the Watch window, select the line and choose Debug>Toggle Breakpoint. When you run the script, Visual Basic will stop at
the breakpoint you set, and you can look at the values in your variables (if you’ve hidden the Watch window, you can display it again
by choosing View>Watch Window). Choose Debug>Step Into (or press F8 in Visual Basic 6/F11 in Visual Basic.NET) to execute
the next line of your script, or choose Run>Start (or press F5) in Visual Basic 6 or Debug>Start (or press F5) in Visual Basic.NET to
continue normal execution of the script.
40
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
JavaScript
InDesign’s JavaScript support includes a debugger for examining your scripts as they execute. You can display the debugger at the
start of every script, or when a script error occurs, or display the debugger for a single script. Once you’re using the debugger dialog,
you can step through the script line-by-line, or examine the contents of variables, or cancel script execution. Using the debugger can
greatly assist you in finding and fixing script errors.
The JavaScript debugger is controlled by the setting of the value “$.level”:
Value:
0
1
2
What it means:
Disable debugging.
Break on errors.
Break at the beginning of every script.
When the debugger is active (i.e., when the value of $.level is set to something other than 0), you can display the debug window by
entering “debugger” or “$.bp()”.
To turn on the JavaScript debugger for all scripts, run the following script:
//Turn the JavaScript debugger on.
alert("JavaScript Debugger On");
$.level = 2;
To turn the JavaScript debugger off, run the following script:
//Turn the JavaScript debugger off.
alert("JavaScript Debugger Off");
$.level = 0;
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
41
To display the JavaScript debugger when a scripting error occurs, run the following script:
//Turn the JavaScript on when errors occur.
alert("JavaScript Debugger Off")
$.level = 1;
To invoke the debugger at any point in a specific script, enter the following lines in the script:
//turn debugging on.
$.level = 1;
//display the debugger.
debugger;
//turn debugging off again (so that it won’t affect subsequent scripts.
$.level = 0;
You can also display the debugger in response to values in the script, as shown in the following example:
//conditional_break.js
$.level = 1;
with(app){
//Use "confirm" to display a yes/no dialog box.
myValue = confirm("Click Yes to start the debugger, or click No to continue.");
//If the user clicked the Yes button, display the debugger.
$.bp(myValue == true);
}
$.level = 0;
To monitor variable values as a script executes in the debugger, you can use the “write” or “writeln” methods, as shown in the
example below:
//debugger_write.js
$.level = 2;
debugger;
with(app){
$.write("Default Color Names:");
for(myCounter = 0; myCounter < colors.length; myCounter++){
$.write("Color: " + myCounter + ": " + colors.item(myCounter).name);
}
}
$.level = 0;
The text will appear in the JavaScript debugger console.
42
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
Stepping through a script
Once you’ve displayed the JavaScript Debugger window, you can step through the script. To do this, use the buttons above the code
window, or press the corresponding keyboard shortcuts.
Button:
Name:
Resume
Shortcut:
Command-R (Mac OS)
Ctrl-R (Windows)
Pause
Command-P (Mac OS)
Ctrl-P (Windows)
What it does:
Runs the script to the next error or breakpoint, or to the end of the script.
When the script terminates, InDesign closes the JavaScript Debugger
window. Closing the debugger window using the Close box also causes
script execution to resume. This button is enabled when script execution is
paused or stopped.
Halts the currently executing script temporarily. This button is enabled
when a script is running.
Stop
Stop Command-K (Mac OS)
Ctrl-K (Windows)
Stops execution of the script and generates an error. This button is enabled
when a script is running.
Step Over
Command-S (Mac OS)
Ctrl-S (Windows)
Step Into
Command-T (Mac OS)
Ctrl-T (Windows)
Halts after executing a single JavaScript statement in the script; if the
statement calls a JavaScript function, InDesign executes the function in its
entirety before stopping.
Halts after executing a single JavaScript statement or after executing a
single statement in any JavaScript function that the script calls.
At any point during script debugging, you can also enter JavaScript from the debugger’s command line (or “Console”). You can use
this feature to examine the value of a variable.
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
43
Setting breakpoints
You can also make the debugger stop at a given line by inserting a breakpoint at that line. To do this, double-click the line at which
you want to set the breakpoint. Alternatively, you can click the Breakpoint button to display the JavaScript Breakpoints dialog box
and set a breakpoint at a specific line number.
This dialog does not display breakpoints defined by the debugger statement in JavaScript code.
The Condition field may contain a JavaScript expression to evaluate when the breakpoint is reached. If the expression evaluates to
false, the breakpoint is not executed.
Using the Scripts palette
InDesign’s Scripts palette provides the easiest and best way to run most InDesign scripts. To display the Scripts palette, choose
Scripts from the Window menu (if the palette is not already visible).
If the Scripts palette is not available, it’s because the plug-in is not installed or has been disabled. Use the plug-in manager to enable
the plug-in, or reinstall the Scripts palette.
If you want to run JavaScripts in InDesign, you must have the Scripts palette installed.
To add a script to the scripts palette, put the script into the Scripts folder inside the Presets folder in your InDesign folder. Any
compiled AppleScripts, JavaScripts (.js), VBScripts (.vbs) or executable programs can be run from the Scripts palette.You can also put
file aliases (on the Mac OS) or shortcuts (in Windows) to files or folders in this folder. When you return to InDesign, the file names of
the script files (or folders) you placed in the folder will appear in the Scripts palette.
To run a script from the Scripts palette, double-click the name of the script in the palette. Scripts run from the Scripts palette run
faster than scripts run from the Finder (Mac OS) or Explorer (Windows). When you run a script using the Scripts palette, InDesign
suppresses screen drawing until the script has finished.
44
Getting Started with InDesign Scripting
InDesign CS Scripting Guide
To edit a script shown in the Scripts palette, hold down Option (on the Mac OS) or Alt (in Windows) and double-click the script’s
name. This opens the script in the editor you’ve defined for the file type.
To open the folder containing a script shown in the Scripts palette, hold down Command (Mac OS) or Ctrl (Windows) and doubleclick the script’s name. The folder containing the script will open in the Finder (Mac OS) or Explorer (Windows).
To open a JavaScript in the JavaScript debugger, hold down Shift as you double-click the script in the Scripts palette.
To add a keyboard shortcut for a script, choose Edit>KeyboardShortcuts, select an editable shortcut set from the Set pop-up menu,
then select Scripts from the Product Area menu. A list of the scripts in your Scripts palette will appear. Select a script and assign a
keyboard shortcut as you would for any other InDesign feature.
Using the Script Label palette
Many of the objects in the InDesign object model have a label property—it’s a property that can be set to any string of up to 32Kb
of text. The main purpose of the label property is to identify objects so that scripts can act on them. One way to assign a label to an
object is to use the Script Label palette (choose Window>Script Label).
If the Script Label palette is not available, it’s because the plug-in is not installed or has been disabled. Use the plug-in manager to
enable the plug-in, or reinstall the palette.
The following examples show how to get a reference to a page item with a given label.
AppleScript
--Given a reference to a page "myPage" containing a text frame with the label "myTargetFrame"
tell myPage
set myTextFrame to text frame "myTargetFrame"
end if
Visual Basic
Rem Given a reference to a page "myPage" containing a text frame with the label "myTargetFrame"
set myTextFrame = myPage.TextFrames.Item("myTargetFrame")
JavaScript
// Assuming that the first page of the active document contains
// a text frame with the label "myTargetFrame"
with(app.documents.item(0).pages.item(0)){
myTargetFrame = textFrames.item("myTargetFrame");
}
InDesign CS Scripting Guide
Getting Started with InDesign Scripting
45
AppleScript Reference
This section describes the objects in the InDesign AppleScript dictionary. The objects are shown in alphabetical order, and each
object description shows the object’s elements (objects that are contained within the object), properties (attributes of the object), and
methods (commands the object can respond to).
Note: Due to the constraints of our page layout, we’ve had to hyphenate some scripting terms. When you are entering the term, do
not enter the hyphen. No scripting terms in InDesign contain hyphens.
About long script lines
In some cases, individual script lines are too long to print on a single line in this guide. In these cases, we’ve used a special character
(¬) to show that the line continues to the next line. This character also denotes a “line end” or “ soft return” in the script. When you
copy an example script into your script editor, delete these characters.
About “with properties”
Here’s an example script that creates a color and the assigns values to various properties:
set myNewColor to make color
tell myNewColor
set color model to process
set color space to CMYK
set color value to {30, 80, 30, 10}
set name to "DCG504a"
end tell
The following example uses AppleScript’s “with properties” statement to do the same thing as the above example, but executes much
faster:
set myNewColor to make color with properties{color model:process, ¬
color space: CMYK, color value:{30, 80, 30, 10}, name: "DCG504a"}
For any “make” method, any required parameters must appear inside a properties record. For the “group” method, for example:
--Where “myPage” is a page, “myRectangle” is a rectangle, and “myOval” is an oval
tell myPage
set myGroupto make group with properties{group items:{myRectangle, myOval}}
end tell
About properties
The properties of an object are the object’s attributes—a character object, for example, has font, font style, point size, and baseline
shift properties.
Here’s an example property reference table (from the book object):
Property:
Type:
Access:
Description:
automatic
document conversion
boolean
read/write
Whether to automatically convert
document during repagination and synchronization
automatic pagination
boolean
read/write
If true, repaginate the book documents
when the book pagination changes.
46
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
file path
file reference or file name as string
read only
The file path to the book file (does not
include the file name).
full name
file reference or file name as string
read only
The file path to the book file, including the
file name.
index
integer
read only
index of the book within its parent
application
insert blank page
boolean
read/write
If true, insert blank pages to meet the
odd/even setting.
modified
boolean
read only
If true, the document has been modified
since it was last saved.
name
string
read only
The file name of the book.
object reference
book
read only
An object reference to the object.
parent
object
read only
The parent of the object.
print preferences
print preferences
read only
The print preferences of the book.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
repagination option
next page, next odd page, next even page
read/write
Sets the repagination options for the book.
saved
boolean
read only
If true, the document has been saved since
it was opened.
style source
document
document
read/write
The current master document.
In general, read only properties are either system information (such as the unique id assigned to InDesign objects) or are set as the
result of a command (the id of an book, for example, is set when the object is created).
The read/write properties, however, can be changed, as shown below:
--Given a book document "myBook"
set automatic pagination of myBook to true
set insert blank page of myBook to true
About methods
When you look at InDesign’s AppleScript dictionary using the Script Editor (or other AppleScript editor), it can be difficult to tell
which methods apply to a given object. The “merge” method, for example, might apply to layers, or colors, or documents, or all of
the above. In this reference, we’ve tried to associate methods with the objects they apply to. We have not documented AppleScript
standard commands, such as “get,” “set,” or “count,” which many or most of the objects can respond to.
Here’s an example command reference (from the document object):
Name:
export
Parameters:
Name:
Type:
Description:
format
string (name of export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Type:
Description:
nothing
Exports the object to file.
InDesign CS Scripting Guide
AppleScript Reference
47
This table shows that the export method can use up to four parameters. Parameters shown in brackets are optional. Here’s how the
parameters work:
Parameter:
What it means:
format
Defines the file format to export. Use any of the constants shown.
to
Sets the name of the file to export.
[showing options]
If true, InDesign will display the export options dialog box.
[using]
Defines the export preset to use when exporting the document. If the file type you’re exporting to does not
use export presets (e.g., SVG), omit this parameter.
The “Type” column shows the type of value returned by the command.
The following is an example export command built from the information shown in the table above:
tell document 1 to export as PDF type to "washu-chan:myPDF.pdf" ¬
using pdf export style "myPreset" showing options false
When you compile the above example, AppleScript changes the wording slightly (you can enter the text in this form, if you like).
tell document 1 to export as PDF type to "washu-chan:myPDF.pdf" ¬
using pdf export style "myPreset" without showing options
About elements
Elements are the objects contained by an object. The document object, for example, contains pages, master spreads, colors, paragraph
styles, text frames, and other objects. When objects contain elements, we’ve included a table showing the methods you can use to
refer to an element. The following is an example element from the document object.
Name:
Refere to by:
character style
index, name, range, relative, test, id
The following table shows example reference forms.
Reference:
What it means:
Example:
id
Refer to the object by its id
set myCharacterStyle to character style id 204 of document 1
index
Refer to the object by its index
set myCharacterStyle to character style 1 of document 1
name
Refer to the object by its name
set myCharacterStyle to character style "run-in head" of document 1
test
Refer to the object using an AppleScript
filter clause
set myCharacterStyle to character style 1 of document 1 ¬
whose name contains "run-in"
relative
Refer to the object relative to another
object (before/after)
set myCharacterStyle to character style after ¬
character style "heading"
48
AppleScript Reference
InDesign CS Scripting Guide
angle combobox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
edit value
fixed
read/write
Real number value of the control.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the angle combobox within its
parent dialog column, dialog row, enabling group or border panel
large nudge
fixed
read/write
The amount that the value of the control
changes when you hold down Shift and
press the uo or down arrow keys (while
editing the value in the control). If you do
not set a value for this property, the value
of the control will not change when you
hold down Shift and press the up or down
arrow keys.
maximum value
fixed
read/write
The maximum value for this control.
min width
fixed
read/write
The minimum width of the control.
minimum value
fixed
read/write
The minimum value for this control.
object reference
angle combobox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
small nudge
fixed
read/write
The amount that the value of the control
changes when you press the up and down
arrow keys while editing the value in the
control. If you do not set a value for this
property, the value of the control will not
change when you press the up or down
arrow keys.
string list
list of strings
read/write
A list of the strings that appear on the
menu of the control.
Methods
Method:
Parameters:
Return:
Description:
make
None
angle combobox
Create a new angle combobox.
InDesign CS Scripting Guide
AppleScript Reference
49
angle editbox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
edit value
fixed
read/write
Real number value of the control.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the angle editbox within its parent dialog column, dialog row, enabling
group or border panel
large nudge
fixed
read/write
The amount that the value of the control
changes when you hold down Shift and
press the uo or down arrow keys (while
editing the value in the control). If you do
not set a value for this property, the value
of the control will not change when you
hold down Shift and press the up or down
arrow keys.
maximum value
fixed
read/write
The maximum value for this control.
min width
fixed
read/write
The minimum width of the control.
minimum value
fixed
read/write
The minimum value for this control.
object reference
angle editbox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
small nudge
fixed
read/write
The amount that the value of the control
changes when you press the up and down
arrow keys while editing the value in the
control. If you do not set a value for this
property, the value of the control will not
change when you press the up or down
arrow keys.
Methods
Method:
Parameters:
Return:
Description:
make
None
angle editbox
Create a new angle editbox.
50
AppleScript Reference
InDesign CS Scripting Guide
application
Elements
Element:
Refer to by:
book
index, name, range, relative, test
character style
index, name, range, relative, test, id
color
index, name, range, relative, test, id
dashed stroke style
index, name, range, relative, test, id
dialog
index, name, range, relative, test, id
display setting
index, name, range, relative, test
document
index, name, range, relative, test
document preset
index, name, range, relative, test, id
dotted stroke style
index, name, range, relative, test, id
flattener preset
index, name, range, relative, test, id
font
index, name, range, relative, test
gradient
index, name, range, relative, test, id
ink
index, name, range, relative, test, id
language with vendors
index, name, range, relative, test, id
layout window
index, name, range, relative, test
library
index, name, range, relative, test
mixed ink
index, name, range, relative, test, id
mixed ink group
index, name, range, relative, test, id
paragraph style
index, name, range, relative, test, id
PDF export preset
index, name, range, relative, test
printer preset
index, name, range, relative, test
story window
index, name, range, relative, test
striped stroke style
index, name, range, relative, test, id
stroke style
index, name, range, relative, test, id
swatch
index, name, range, relative, test, id
tint
index, name, range, relative, test, id
TOC style
index, name, range, relative, test, id
trap preset
index, name, range, relative, test, id
user dictionary
index, name, range, relative, test
window
index, name, range, relative, test
XML export map
index, name, range, relative, test
XML import map
index, name, range, relative, test
XML tag
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
active document
document
read/write
The active (front-most) document.
active script
file reference or file name as string
read only
The file path to the current script running
from the scripts palette.
active window
object
read/write
The active (front-most) window.
button preferences
button preferences
read only
button preferences
InDesign CS Scripting Guide
AppleScript Reference
51
Property:
Type:
Access:
Description:
change preferences
change preferences
read/write
The current change settings for InDesign’s
find/change feature. This object corresponds to options found in the Find/
Change panel (including the options in
the Change Format Settings section of
that panel).
class
type
read only
The class of the object.
clipboard preferences
clipboard preferences
read only
Clipboard preferences
color settings
color setting
read only
The application default color management
settings.
dictionary preferences
dictionary preferences
read only
The application default user dictionary
preferences. This object corresponds to
the Dictionary panel of the Preferences
dialog box.
display performance preferences
display performance preferences
read only
The application default display performance preferences. This object corresponds to the Display Performance panel
of the Preferences dialog box.
document preferences
document preferences
read only
The application default document preferences. This object corresponds to the
document panel of the Preferences dialog
box.
EPS export preferences
EPS export preferences
read only
The application default epss export preferences. This object corresponds to the epss
Export dialog box (which appears when
you export an epss).
EPS import preferences
EPS import preferences
read only
The application default epss import preferences. This object corresponds to the epss
Import dialog box (which appears when
you import an epss and have turned on
the Show Options option in the Place
dialog box).
excel import preferences
excel import preferences
read only
The application default Excel Import
preferences. This object corresponds to the
Excel Import dialog box (which appears
when you import an Excel document and
have turned on the Show Options option
in the Place dialog box).
file path
file reference or file name as string
read only
The file path to the folder containing the
InDesign application (does not include the
file name).
find preferences
find preferences
read/write
The current find settings for InDesign’s
find/change feature. This object corresponds to options found in the Find/
Change panel (including the options in
the Find Format Settings section of that
panel).
full name
file reference or file name as string
read only
The file path to the InDesign application
file, including the file name.
galley preferences
galley preferences
read only
The application default story Editor
preferences. This object corresponds to the
story Editor Display panel of the Preferences dialog box.
general preferences
general preferences
read only
The application default general preferences. This object corresponds to the General
panel of the Preferences dialog box.
grid preferences
grid preferences
read only
The application default grid preferences.
This object corresponds to the Grids panel
of the Preferences dialog box.
52
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
guide preferences
guide preferences
read only
The application default guide preferences.
This object corresponds to the guides and
Pasteboard panel of the Preferences dialog
box.
image IO preferences
image IO preferences
read only
image IO preferences
IME preferences
IME preferences
read only
IME preferences
index generation
options
index options
read only
The options controlling index generation.
This object corresponds to the Generate
index dialog box (to display this dialog
box, choose Generate index from the
index palette menu).
JPEG export preferences
JPEG export preferences
read only
The application default JPEG export
preferences. This object corresponds to the
JPEG Export dialog box (which appears
when you export a JPEG).
layout adjustment
preferences
layout adjustment preferences
read only
The application default layout adjustment
preferences. The properties in this object
correspond to the options shown in the
Layout Adjustment dialog box (choose
Layout Adjustment from the Layout menu
to display this dialog box).
locale
danish locale, english locale, international english locale, finnish locale,
french locale, german locale, italian locale, portuguese locale, spanish locale,
swedish locale, japanese locale
read only
The locale of the application.
margin preferences
margin preferences
read only
The application default margin preferences. These settings affect all new documents
you create, but have no effect on the
margin preferences of existing documents.
This object corresponds to the options
found in the Margins and columns dialog
box.
name
string
read only
The name of the application.
object reference
object
read only
An object reference to the object.
package for GoLive
preferences
package for GoLive preferences
read only
The default Package For GoLive preferences
palettes visible
boolean
read/write
Whether the palettes are shown
parent
object
read only
The parent of the object.
pasteboard preferences
pasteboard preferences
read only
The application default pasteboard preferences. The properties of this object correspond to the pasteboard-related options
in the guides and Pasteboard panel of the
Preferences dialog box.
PDF export preferences
PDF export preferences
read only
The application default pdf export preferences. This object corresponds to the pdf
Export dialog box (which appears when
you export a pdf).
PDF place preferences
PDF place preferences
read only
The application default pdf import preferences. This object corresponds to the pdf
Import dialog box (which appears when
you import an pdf and have turned on the
Show Options option in the Place dialog
box).
polygon preferences
polygon preferences
read only
The application default polygon preferences. This object corresponds to the polygon
Settings dialog box (to display this dialog
box, double-click the polygon tool in the
Tools palette).
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
InDesign CS Scripting Guide
AppleScript Reference
53
Property:
Type:
Access:
Description:
selection
list
read/write
The current selection of the active window.
spell preferences
spell preferences
read only
The application default spelling preferences. This object corresponds to the Spelling
panel of the Preferences dialog box.
story preferences
story preferences
read only
The application default story preferences.
This object corresponds to the story palette. These settings affect all new InDesign
documents, but have no effect on the story
preferences in existing documents.
SVG export preferences
SVG export preferences
read only
The application default SVG export preferences. This object corresponds to the SVG
Export dialog box (which appears when
you export an SVG file).
tagged text export
preferences
tagged text export preferences
read only
The application tagged text export preferences. This object corresponds to the
Tagged text Export dialog box, which
appears when you export InDesign tagged
text.
tagged text import
preferences
tagged text import preferences
read only
The application default tagged text import
preferences. This object corresponds to
the Tagged text Import dialog box (which
appears when you import a tagged text
file and have turned on the Show Options
option in the Place dialog box).
text defaults
text default
read only
The application default text formatting.
Changing the application default text
formatting sets the default formatting for
all new documents, but has no effect on
existing documents. To change the default
text formatting for an existing document,
change the settings of the text default
object for that document.
text export preferences
text export preferences
read only
The application text export preferences.
This object corresponds to the text Export
dialog box, which appears when you
export text.
text frame preferences
text frame preferences
read only
The application default text frame preferences. Changing the properties of this
object affects all new documents; the text
frame preferences in existing documents
are not changed.
text import preferences
text import preferences
read only
The application default text import preferences. This object corresponds to the text
Import dialog box (which appears when
you import a text file and have turned
on the Show Options option in the Place
dialog box).
text preferences
text preferences
read only
The application default text preferences.
This object corresponds to the text panel
of the Preferences dialog box.
transform preferences
transform preferences
read only
Transform preferences
transparency
preferences
transparency preferences
read only
The application default transparency
preferences. This object corresponds to the
setting of the Transparency Blend Space
submenu of the Edit menu.
unused swatches
list of swatches
read only
A list of the unused swatches.
54
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
user interaction
level
never interact, interact with all, interact with self, interact with local
read/write
Use this property to suppress or activate
the application’s display of alerts and
dialog boxes. If you turn this property
off, make certain that you turn it on again
before your script completes execution.
version
fixed
read only
The version of InDesign.
view preferences
view preferences
read only
The application default view preferences.
The properties of this object correspond
to the options in the Units and Increments
panel of the Preferences dialog box.
visible
boolean
read only
If true, the application is visible.
word RTF import
preferences
word RTF import preferences
read only
The application default word/RTF import
preferences. This object corresponds to
the word/RTF Import dialog box (which
appears when you import a word or RTF
file and have turned on the Show Options
option in the Place dialog box).
XML export preferences
XML export preferences
read only
The default XML export preferences.
XML import preferences
XML import preferences
read only
The default XML import preferences.
XML view preferences
XML view preferences
read only
The application default XML view preferences. The properties of this object correspond to the show/hide options on the
Structure View menu.
Methods
Method:
Parameters:
Return:
Description:
activate
None
nothing
Brings InDesign to the front.
cascade windows
None
nothing
Arranges the open InDesign
document windows in a
“cascade” (i.e., overlapping
windows).
copy
None
nothing
Copies the selection in the
active document window to the
clipboard.
cut
None
nothing
Cuts the selection in the active document window to the
clipboard.
delete unused tags
None
nothing
Deletes all unused XML
markup tags.
nothing
Runs a script file stored on
your disk.
do script
Name:
Type:
Description:
script
file reference or file name as string
The script to execute. Either a file
reference or string
containing the file
name (including the
file path).
[language]
visual basic, javascript, applescript
The language of the
script to execute. If
not specified, the
language used to
call this method is
used.
InDesign CS Scripting Guide
AppleScript Reference
55
Method:
export presets
import
import styles
load xml tags
open
Parameters:
Name:
Type:
Description:
format
pdf export presets format, printer
presets format, flattener presets format,
document presets format
the preset format.
to
string
a file to which to
export the object.
Name:
Type:
Description:
format
pdf export presets format, printer
presets format, flattener presets format,
document presets format
The export file
format to use.
from
string
The full file path of
the file to import.
Name:
Type:
Description:
format
character styles format, paragraph styles
format, text styles format, toc styles
format
the format.
from
string
an InDesign file to
import from.
Name:
Type:
Description:
from
string
What to import
from.
Name:
Type:
Description:
from
object or objects
Either a file reference or string
containing the file
name (including the
file path) of the file
you want to open.
[showing window]
boolean
If true, show the
document window.
Return:
Description:
nothing
Export the presets to a file.
nothing
Imports a file containing
document styles, flattener
styles, pdf export presets, or
printer styles. To import text or
graphics, use the import command of the document, spread,
page, page item, or text object
you want to import into. To import XML tags, use the import
xml tags command.
nothing
Import styles or presets.
nothing
Load a set of tags from an
external file.
object or
objects
Opens a document, book or
library.
paste
None
nothing
Pastes data from the clipboard
into the active document
window.
paste in place
None
nothing
Paste data from the clipboard
into front document window
at the same position as the
original
paste into
None
nothing
Pastes data from the clipboard
into the selected object in the
active document window.
nothing
Prints one or more documents.
print out
56
Name:
Type:
Description:
from
file reference or file name as string (or,
for multiple files, a list of file reference
or strings)
One or more file
paths.
[print dialog]
boolean
If true, display the
Print dialog box.
[using]
printer preset or printer preset name as
string
The name of the
printer style to use,
or an object reference to a printer
style.
AppleScript Reference
InDesign CS Scripting Guide
Method:
quit
save xml tags
search
select
tile windows
Parameters:
Name:
Type:
Description:
[saving]
no, ask, yes
Use ask to display a
dialog box asking if
the user would like
to save changes for
each unsaved open
document; use no to
close all documents
without savign;
use yes to save
all unsaved open
document.
Name:
Type:
Description:
to
string
The file to export to.
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
selectable items
object, list of objects, or nothing (to
deselect all)
The object(s) to
select.
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
None
Return:
Description:
nothing
Quits InDesign.
nothing
Save a set of tags to an external
file.
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
Selects an object or objects.
If the object is a text object
(e.g., characters, words, lines,
paragraphs), any other selected
objects are deselected (the AppendSelection parameter has
no effect).
nothing
Arranges the open InDesign
document windows in a “tiled”
layout (i.e., non-overlapping
windows).
InDesign CS Scripting Guide
AppleScript Reference
57
asset
Properties
Property:
Type:
Access:
Description:
asset type
image type, EPS type, PDF type, geometry type, page type, text type
read/write
The type of the asset.
class
type
read only
The class of the object.
date
date
read only
The date and time the asset was created.
description
string
read/write
A description of the asset.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the asset within its parent library
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the asset.
object reference
asset
read only
An object reference to the object.
parent
library
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
list of objects
Place the asset in a document.
extract label
insert label
place asset
58
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
on
document
The document in
which to place the
asset.
AppleScript Reference
InDesign CS Scripting Guide
Description:
behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the behavior within its parent
form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the behavior.
object reference
behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
extract label
insert label
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
InDesign CS Scripting Guide
Description:
AppleScript Reference
59
book
Elements
Element:
Refer to by:
book content
index, name, range, relative, test, id
synchronize option
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
automatic
document conversion
boolean
read/write
Whether to automatically convert
document during repagination and synchronization
automatic pagination
boolean
read/write
If true, repaginate the book documents
when the book pagination changes.
class
type
read only
The class of the object.
file path
file reference or file name as string
read only
The file path to the book file (does not
include the file name).
full name
file reference or file name as string
read only
The file path to the book file, including the
file name.
index
integer
read only
index of the book within its parent
application
insert blank page
boolean
read/write
If true, insert blank pages to meet the
odd/even setting.
modified
boolean
read only
If true, the document has been modified
since it was last saved.
name
string
read only
The file name of the book.
object reference
book
read only
An object reference to the object.
parent
object
read only
The parent of the object.
print preferences
print preferences
read only
The print preferences of the book.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
repagination option
next page, next odd page, next even page
read/write
Sets the repagination options for the book.
saved
boolean
read only
If true, the document has been saved since
it was opened.
style source
document
document
read/write
The current master document.
Methods
Method:
close
export
60
Parameters:
Name:
Type:
Description:
[saving]
no, ask, yes
If true, save changes
before closing the
book.
[saving in]
file reference or file name as string
The file in which to
save the book.
Name:
Type:
Description:
[to]
file reference or file name as string
The file to which to
export the book as
File (string).
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Close the book.
nothing
Export the book to pdf
Method:
make
package
package for go live
print out
save
synchronize
Parameters:
Name:
Type:
Description:
full name
string
Full path name of
the new book.
Name:
Type:
Description:
to
string
A folder, alias or
path as string in
which to place the
packaged files.
copying fonts
boolean
If true, copy required fonts.
copying linked
graphics
boolean
If true, copy linked
graphics file.
copying profiles
boolean
If true, copy profiles.
updating graphics
boolean
If true, update
graphics links before packaging.
including hidden
layers
boolean
If true, include
objects on hidden
layers.
ignore preflight
errors
boolean
If true, ignore
preflight errors and
package anyways.
creating report
boolean
If true, create package report.
Name:
Type:
Description:
location
string
File location for
package.
Name:
Type:
Description:
[print dialog]
boolean
If true, invoke the
print dialog.
[using]
printer preset or printer preset name as
string
Printer style to use.
Name:
Type:
Description:
[to]
file reference or file name as string
Where to save the
book. If the book
is already saved, a
copy is saved at this
path, the original
file is closed the new
copy is opened.
None
Return:
Description:
book
Create a new book.
boolean
Packages the document.
boolean
Packages for GoLive.
nothing
Print the book.
nothing
Save the book.
nothing
Synchronize whole to the Style
Source document
InDesign CS Scripting Guide
AppleScript Reference
61
book content
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
date
date
read only
The date and time the book content file
was last saved.
document page
range
string
read only
The page range of the book content
document.
full name
file reference or file name as string
read only
The file path to the book content file,
including the file name.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the book content within its parent
book
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
object reference
book content
read only
An object reference to the object.
parent
book
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
size
integer
read only
Size of the book content file on disk.
status
normal, missing document, document out of date, document in use,
document is open
read only
The status of the book content file.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
book content
Create a new book content.
book content
Move the book content before/
after another book content, or
to beginning/end.
book content
Replace a file.
nothing
Sync this book content to the
Style Source document
extract label
insert label
make
move
replace
synchronize
62
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
full name
string
Full path name
of the new book
content.
Name:
Type:
Description:
[to]
before, after, at end, at beginning,
unknown
location.
[reference]
book content
Before/after this
book content.
Name:
Type:
Description:
full name
string
Full path name of
the replaced book
content.
None
AppleScript Reference
InDesign CS Scripting Guide
bookmark
Elements
Element:
Refer to by:
bookmark
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
destination
object
read only
The destination of the bookmark.
id
integer
read only
A unique number identifying the object.
indent
integer
read only
The indent level of the bookmark.
index
integer
read only
index of the bookmark within its parent
document or bookmark
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read/write
The name of the bookmark.
object reference
bookmark
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
bookmark
Create a new bookmark.
nothing
Move this bookmark under
another.
nothing
Go to the bookmark.
extract label
insert label
make
move
show bookmark
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
destination
object
The bookmark’s
destination as
hyperlinktextDestination,
hyperlinkpageDestination,
hyperlinkExternalpageDestination
or hyperlinkURLDestination.
Name:
Type:
Description:
to
before, after, at beginning, at end
The new parent
bookmark.
indent level
integer
The new indent
level.
None
InDesign CS Scripting Guide
Description:
AppleScript Reference
63
border panel
Elements
Element:
Refer to by:
angle combobox
index, name, range, relative, test, id
angle editbox
index, name, range, relative, test, id
border panel
index, name, range, relative, test, id
checkbox control
index, name, range, relative, test, id
dialog column
index, name, range, relative, test, id
dialog row
index, name, range, relative, test, id
dropdown
index, name, range, relative, test, id
enabling group
index, name, range, relative, test, id
integer combobox
index, name, range, relative, test, id
integer editbox
index, name, range, relative, test, id
measurement combobox
index, name, range, relative, test, id
measurement editbox
index, name, range, relative, test, id
percent combobox
index, name, range, relative, test, id
percent editbox
index, name, range, relative, test, id
radiobutton group
index, name, range, relative, test, id
real combobox
index, name, range, relative, test, id
real editbox
index, name, range, relative, test, id
static text
index, name, range, relative, test, id
text editbox
index, name, range, relative, test, id
widget
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the border panel within its parent
dialog column, dialog row, enabling group
or border panel
min width
fixed
read/write
The minimum width of the control.
object reference
border panel
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
make
None
border panel
Create a new border panel.
64
AppleScript Reference
InDesign CS Scripting Guide
button
Elements
Element:
Refer to by:
behavior
index, name, range, relative, test, id
close window behavior
index, name, range, relative, test, id
EPS
index, name, range, relative, test, id
goto anchor behavior
index, name, range, relative, test, id
goto first page behavior
index, name, range, relative, test, id
goto last page behavior
index, name, range, relative, test, id
goto next page behavior
index, name, range, relative, test, id
goto next view behavior
index, name, range, relative, test, id
goto previous page behavior
index, name, range, relative, test, id
goto previous view behavior
index, name, range, relative, test, id
goto URL behavior
index, name, range, relative, test, id
graphic
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
image
index, name, range, relative, test, id
movie behavior
index, name, range, relative, test, id
open file behavior
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
PDF
index, name, range, relative, test, id
PICT
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
quit behavior
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
show hide fields behavior
index, name, range, relative, test, id
sound behavior
index, name, range, relative, test, id
state
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
view zoom behavior
index, name, range, relative, test, id
WMF
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scale of the page item relative to its containing page item
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item
absolute vertical
scale
fixed
read/write
The vertical scale of the page item relative
to its containing page item
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All page items
appearance name
string
read only
Name of any appearance of field
InDesign CS Scripting Guide
AppleScript Reference
65
Property:
Type:
Access:
Description:
associated XML
element
XML element
read only
Returns the associated XML element
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The blend mode used to combine the
object’s color with the background
class
type
read only
The class descriptor type
corner effect
none, rounded corner, inverse rounded corner, inset corner, bevel corner,
fancy corner
read/write
The type of corner effect on the object
corner radius
fixed
read/write
The radius of the corner
description
string
read/write
Description
end cap
butt end cap, round end cap, projecting end cap
read/write
The appearance of both ends of an open
path
end join
miter end join, round end join, bevel end join
read/write
The appearance of the stroke at corner
points
feather corner type
sharp, rounded, diffusion
read/write
The type of feathering to apply
feather mode
none, standard
read/write
The feather mode
feather width
fixed
read/write
The width of the feathering
fill color
swatch
read/write
The fill color of the object. Can also accept: string.
fill tint
fixed
read/write
The object’s fill tint percentage (-1 indicates no override)
gap color
swatch
read/write
Gap color for the page item
gap tint
fixed
read/write
Gap tint for the page item
geometric bounds
list of fixed or measurement strings {x1, y1, x2, y2}
read/write
The bounds of the page item excluding
the stroke width, in the format (top, left,
bottom, right)
gradient fill angle
fixed
read/write
Angle of a linear gradient on the fill
gradient fill length
fixed
read/write
Length of ramp for a linear gradient or
radius of a radial gradient on the fill
gradient fill start
list of fixed or measurement strings {x, y}
read/write
Center point for a radial gradient or starting point for a linear gradient on the fill
gradient stroke
angle
fixed
read/write
Angle of a linear gradient on the stroke
gradient stroke
length
fixed
read/write
Length of ramp for a linear gradient or
radius of a radial gradient on the stroke
gradient stroke
start
list of ns
read/write
Center point for a radial gradient or
starting point for a linear gradient on the
stroke
horizontal scale
fixed
read/write
The horizontal scaling percentage.
id
integer
read only
The button’s unique id
index
integer
read only
index of the button within its parent
spread, master spread, group, text frame,
story, text, character, word, line, text
column, paragraph, text style range, cell,
table, page, document, layer or insertion
point
isolate blending
boolean
read/write
Indicates whether the object should blend
in isolation
item layer
layer
read/write
The layer the object is on
knockout group
boolean
read/write
Indicates whether the object is a knockout
group
label
string
read/write
A label that can be set to any string
left line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the left
end of an open path
66
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
local display setting
high quality, typical, optimized, default
read/write
The display settings for this page item
locked
boolean
read/write
Whether the button is locked
miter limit
fixed
read/write
When a corner point switches from
a mitered (pointed) join to a beveled
(squared-off) join
name
string
read/write
The name of the button
nonprinting
boolean
read/write
Whether the page item is non-printing
object reference
button
read only
An object reference for this button
opacity
fixed
read/write
The opacity of the object
overprint fill
boolean
read/write
Whether to overprint the fill
overprint gap
boolean
read/write
Whether to overprint the gap
overprint stroke
boolean
read/write
Whether to overprint the stroke
overridden
boolean
read only
True if this page item originated on a master spread and was later overridden. It is
still linked to the page item on the master
overridden master
page item
page item
read only
The overridden master page item
parent
object
read only
The button’s parent. Can return: spread,
master spread, group, text frame, story,
text, character, word, line, text column,
paragraph, text style range, cell, table,
page, document, layer or insertion point.
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
right line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the
right end of an open path
rotation angle
fixed
read/write
Angle of rotation
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The blend mode to use for drawing the
shadow
shadow blur radius
fixed
read/write
The radius of the blur to apply to the
shadow
shadow color
swatch
read/write
The color to apply to the shadow
shadow mode
none, drop
read/write
The shadow mode
shadow opacity
fixed
read/write
The opacity of the shadow
shadow x offset
fixed
read/write
The horizontal offset of the shadow
shadow y offset
fixed
read/write
The vertical offset of the shadow
shear angle
fixed
read/write
The shear angle of the page item relative to
the spread
stroke alignment
center alignment, inside alignment, outside alignment
read/write
The stroke alignment for the page item
stroke color
swatch
read/write
The stroke color of the object. Can also
accept: string.
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The adjustment to add to the corners of a
dashed line
stroke dash and
gap
list of fixed or measurement strings {dash, gap, ...}
read/write
The dash and gap settings of a dashed line.
A list of up to 6 values
stroke tint
fixed
read/write
The object’s stroke tint percentage (-1
indicates no override)
stroke type
stroke style
read/write
The stroke type
stroke weight
fixed
read/write
The weight (in points) to apply to the
stroke of the object
text wrap preferences
text wrap preferences
read only
The text wrap preferences
InDesign CS Scripting Guide
AppleScript Reference
67
Property:
Type:
Access:
Description:
vertical scale
fixed
read/write
The vertical scaling percentage.
visibility in pdf
visible in pdf, hidden in pdf, visible but does not print in pdf, hidden but
printable in pdf
read/write
Visibility of the item in the output pdf
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width, in the format (top, left,
bottom, right)
Methods
Method:
add path
apply appearance
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
using
string
the appearance.
Return:
Description:
page item
Create a new shape by adding
the path(s) of this object with
the paths of other objects. This
method corresponds to the
Add path operation (Objects>
Pathfinder>Add).
nothing
Apply an appearance.
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
page item
Creates a new shape by excluding area of intersection of this
object with the other objects.
This method corresponds
to the Exclude Overlap path
operation (Objects>Pathfinder
>Exclude Overlap).
nothing
Export the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Fit content within a graphic
frame.
nothing
Sets the string associated with
the given key (label name).
exclude overlap
path
Name:
Type:
Description:
with
list of objects
The objects to
exclude.
export
Name:
Type:
Description:
format
string (name of export format as it appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
extract label
fit
insert label
68
AppleScript Reference
InDesign CS Scripting Guide
Method:
intersect path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to intersect with.
Name:
Type:
Description:
[layer]
layer or layer name as string
The layer on which
to create the button
as layer.
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after this
button or at the beginning/end of this
document, spread,
Master spread,
page or layer as
document, spread,
master spread, page
or layer.
make compound
path
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
markup
Name:
Type:
Description:
using
XML element
The element to mark
up.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, layer, or master spread
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current location.
Name:
Type:
Description:
destination page
page
The page on which
to override the master page item.
make
minus back
move
override
Return:
Description:
page item
Create a new shape based on
the area of intersection of this
object and other objects. This
method corresponds to the
Intersect path operation (Objec
ts>Pathfinder>Intersect).
button
Create a new button.
page item
Create a compound path by
adding the paths of this object
to the paths of other objects.
This method corresponds
to the Object>Compound
paths>Make command.
nothing
Markup layout content with
XML preserving the existing
content.
page item
Create a new shape by reverse
subtracting this object from
other objects. This method
corresponds to the Minus Back
path operation (Objects>Pathfi
nder>Minus Back).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
page item
Overrides an item from the
master page and places it on
the page.
InDesign CS Scripting Guide
AppleScript Reference
69
Method:
place
place xml
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list of fixed or measurement strings {x, y}
The point at which
to place the file.
[destination layer]
layer or layer name as string
The layer on which
to place the file.
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
If true, convert
straight quotes
to typographer’s
quotes.
Name:
Type:
Description:
using
XML element
The element to place
into.
Return:
Description:
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
release compound
path
None
objects
release compound path.
remove override
None
nothing
Removes a locally overriden
master page item
reset scaling
None
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
resize
70
Name:
Type:
Description:
[horizontal scale]
fixed
The horizontal scaling percentage.
[vertical scale]
fixed
The vertical scaling
percentage.
[around]
list or fixed or measurement strings {x, y}
or bottom center anchor, bottom left anchor, bottom right anchor, center anchor,
left center anchor, right center anchor,
top left anchor, top center anchor, top
right anchor
The point to scale
around.
[considering
current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering
parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
AppleScript Reference
InDesign CS Scripting Guide
Method:
rotate
select
Parameters:
Name:
Type:
Description:
by
number
Angle by which to
rotate the page item.
[around]
list of fixed or measurement strings {x, y}
or bottom center anchor, bottom left anchor, bottom right anchor, center anchor,
left center anchor, right center anchor,
top left anchor, top center anchor, top
right anchor
The point to rotate
around.
[considering current rotation]
boolean
If true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
If true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
If true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
nothing
Rotate the page item.
nothing
Select this button.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
nothing
Shear the page item.
shear
Name:
Type:
Description:
by
number
Angle by which to
shear the object.
[around]
list of fixed or measurement strings {x, y}
or bottom center anchor, bottom left anchor, bottom right anchor, center anchor,
left center anchor, right center anchor,
top left anchor, top center anchor, top
right anchor
The point to shear
around.
[considering current shear]
boolean
If true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
If true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
InDesign CS Scripting Guide
AppleScript Reference
71
Method:
store
subtract path
unlink
72
Parameters:
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
asset
Store a page item in a library.
page item
Create a new shape by subtracting the area of intersection of
this object and other objects
from the other objects. This
method corresponds to the
Subtract path operation (Objec
ts>Pathfinder>Subtract).
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
button preference
Properties
Property:
Type:
Access:
Description:
appearance name
string
read/write
Name of any appearance of field
class
type
read only
The class descriptor type
name
string
read/write
The name of the button preference
object reference
button preference
read only
An object reference for this button preference
parent
object
read only
The button preference’s parent. Can
return: application or document.
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
InDesign CS Scripting Guide
AppleScript Reference
73
cell
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
cell
index, name, range, relative, test, id
character
index, name, range, relative, test
column
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
row
index, name, range, relative, test
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items contained by this
object, regardless of their location in the
object hierarchy (i.e., including objects
nested within other objects, such as
groups).
auto grow
boolean
read/write
If true, the cell will expand to display its
content.
bottom edge stroke
color
swatch
read/write
The stroke color of the bottom edge of the
cell.
bottom edge stroke
gap color
swatch
read/write
The gap color of the stroke applied to the
bottom edge of the cell.
bottom edge stroke
gap overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the bottom edge of
the cell.
bottom edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the bottom edge of the
cell (-1 indicates 100%, or no tint override).
bottom edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
bottom edge of the cell.
bottom edge stroke
priority
integer
read/write
The stroke priority of the bottom edge
74
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
bottom edge stroke
tint
fixed
read/write
The tint applied to the stroke of the bottom edge of the cell (-1 indicates 100%, or
no tint override).
bottom edge stroke
type
stroke style
read/write
The type of stroke applied to the bottom
edge of the cell.
bottom edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
bottom edge of the cell.
bottom inset
fixed or measurement string
read/write
The bottom inset the cell.
class
type
read only
The class of the object.
clip content to cell
boolean
read/write
If true, clip the content of the cell to the
boundaries of the cell.
column span
integer
read only
The number of columns that this cell
spans
contents
text or page item
read/write
The text contents of the cell.
diagonal line in
front
boolean
read/write
If true, the diagonal line will draw in front
of the contents of the cell.
diagonal line
stroke color
swatch
read/write
The stroke color of the diagonal line(s)
applied to the cell.
diagonal line
stroke gap color
swatch
read/write
The gap color of the diagonal line(s).
diagonal line
stroke gap overprint
boolean
read/write
If true, overprint the color of the gap of
the diagonal line(s).
diagonal line
stroke gap tint
fixed
read/write
The tint applied to the gap color of the
stroke of the diagonal line(s) of the cell (-1
indicates 100%, or no tint override).
diagonal line
stroke overprint
boolean
read/write
If true, overprint the diagonal line(s) applied to the cell.
diagonal line
stroke tint
fixed
read/write
The tint applied to the stroke of the diagonal line(s) of the cell (-1 indicates 100%, or
no tint override).
diagonal line
stroke type
stroke style
read/write
The type of stroke applied to the diagonal
line(s) of the cell.
diagonal line
stroke weight
fixed or measurement string
read/write
The stroke weight of the diagonal line(s)
of the cell.
fill color
swatch
read/write
The swatch, color, gradient, tint, or mixed
ink applied to the fill of the cell.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the cell (-1 indicates 100%, or no tint
override).
first baseline offset
ascent offset, cap height, leading offset, embox height, x height, fixed height
read/write
The method used to calculate the distance
from the first baseline of text in the cell
and the top inset of the cell.
gradient fill angle
fixed
read/write
Angle of a linear gradient on the fill
gradient fill length
fixed
read/write
Length of ramp for a linear gradient or
radius of a radial gradient on the fill
gradient fill start
list of fixed or measurement strings {x, y}
read/write
Center point for a radial gradient or starting point for a linear gradient on the fill
height
fixed or measurement string
read/write
The height of the cell.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the cell within its parent table.
inner column
stroke color
swatch
read/write
The stroke color of the inner column of
the cell.
inner column
stroke gap color
swatch
read/write
The gap color of the stroke applied to the
inner column of the cell.
InDesign CS Scripting Guide
AppleScript Reference
75
Property:
Type:
Access:
Description:
inner column
stroke gap overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the inner column of
the cell.
inner column
stroke gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the inner column of the
cell (-1 indicates 100%, or no tint override).
inner column
stroke overprint
boolean
read/write
If true, overprint the stroke applied to the
inner column of the cell.
inner column
stroke tint
fixed
read/write
The tint applied to the stroke of the inner
column of the cell (-1 indicates 100%, or
no tint override).
inner column
stroke type
stroke style
read/write
The type of stroke applied to the inner
column of the cell.
inner column
stroke weight
fixed or measurement string
read/write
The width of the stroke applied to the the
inner column of the cell.
inner row stroke
color
swatch
read/write
The stroke color of the inner row of the
cell.
inner row stroke
gap color
swatch
read/write
The gap color of the stroke applied to the
inner row of the cell.
inner row stroke
gap overprint
boolean
read/write
Whether to overprint the gap of the inner
row
inner row stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the inner row of the cell
(-1 indicates 100%, or no tint override).
inner row stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
inner row of the cell.
inner row stroke
tint
fixed
read/write
The tint applied to the stroke of the inner
row of the cell (-1 indicates 100%, or no
tint override).
inner row stroke
type
stroke style
read/write
The type of stroke applied to the inner row
of the cell.
inner row stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
inner row of the cell.
keep with next row
boolean
read/write
If true, keep this row with the next row
when the rows break between pages, text
frames, or text columns.
left edge stroke
color
swatch
read/write
The stroke color of the left edge of the cell.
left edge stroke gap
color
swatch
read/write
The gap color of the stroke applied to the
left edge of the cell.
left edge stroke gap
overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the left edge of the cell.
left edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the left edge of the cell
(-1 indicates 100%, or no tint override).
left edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
left edge of the cell.
left edge stroke
priority
integer
read/write
The stroke priority of the left edge
left edge stroke tint
fixed
read/write
The tint of the color of the left edge
left edge stroke
type
stroke style
read/write
The type of stroke applied to the left edge
of the cell.
left edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
left edge of the cell.
left inset
fixed or measurement string
read/write
The left inset of the cell.
maximum height
fixed or measurement string
read/write
Specifies the maximum height of the row
containing the cell.
76
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
minimum first
baseline offset
fixed or measurement string
read/write
The minimum distance (in points) between the first baseline of the text in the
cell and the top inset of the frame or cell.
minimum height
fixed or measurement string
read/write
Constrains the row height to an amount
no smaller than this value. The row may
be larger than this amount, however,
as the row height will continue to grow
automatically as text is added.
name
string
read only
The name of the cell, in the form row
number; column number. The third cell of
the fourth row, for example, would have
the name “R4:C3”.
object reference
cell
read only
An object reference to the object.
overflows
boolean
read only
If true, the cell contains overset (i.e.,
uncomposed) text.
overprint fill
boolean
read/write
If true, overprint the fill of the cell.
paragraph spacing
limit
fixed or measurement string
read/write
When the vertical justification of the
cell is set to justified, this is the maximum amount of space that will be added
between paragraphs. Increase this value
to encourage spacing between paragraphs
of vertically justified text; decrease it to
increase the leading between lines of text
in vertically justified text.
parent
object
read only
The parent of the object.
parent column
column
read only
The parent column of the cell.
parent row
row
read only
The parent row of the cell.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right edge stroke
color
swatch
read/write
The stroke color of the right edge of the
cell.
right edge stroke
gap color
swatch
read/write
The gap color of the stroke applied to the
right edge of the cell.
right edge stroke
gap overprint
boolean
read/write
If true, overprint the color assigned to
the gap of the stroke of the right edge of
the cell.
right edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the right edge of the cell
(-1 indicates 100%, or no tint override).
right edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
right edge of the cell.
right edge stroke
priority
integer
read/write
The stroke priority of the right edge
right edge stroke
tint
fixed
read/write
The tint applied to the stroke of the right
edge of the cell (-1 indicates 100%, or no
tint override).
right edge stroke
type
stroke style
read/write
The type of stroke applied to the right
edge of the cell.
right edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
right edge of the cell.
right inset
fixed or measurement string
read/write
The right inset the cell.
rotation angle
fixed
read/write
The rotation angle of the cell.
row span
integer
read only
The number of rows that this cell spans
row type
body row, header row, footer row, mixed state
read/write
The type of the row containing the cell.
start row
anywhere, next column, next frame, next page, next odd page, next even page
read/write
Where to start the row
text cell rotation
follows story direction
boolean
read/write
Whether text cell direction matches the
story direction
InDesign CS Scripting Guide
AppleScript Reference
77
Property:
Type:
Access:
Description:
top edge stroke
color
swatch
read/write
The stroke color of the top edge of the cell.
top edge stroke gap
color
swatch
read/write
The gap color of the stroke applied to the
top edge of the cell.
top edge stroke gap
overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the top edge of the cell.
top edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the top edge of the cell
(-1 indicates 100%, or no tint override).
top edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
top edge of the cell.
top edge stroke
priority
integer
read/write
The stroke priority of the top edge
top edge stroke tint
fixed
read/write
The tint applied to the stroke of the top
edge of the cell (-1 indicates 100%, or no
tint override).
top edge stroke
type
stroke style
read/write
The type of stroke applied to the right
edge of the cell.
top edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
top edge of the cell.
top inset
fixed or measurement string
read/write
The top inset the cell.
top left diagonal
line
boolean
read/write
If true, draw a diagonal line from the top
left corner to the bottom right corner of
the cell .
top right diagonal
line
boolean
read/write
If true, draw a diagonal line from the top
right corner to the bottom left corner of
the cell .
vertical justification
top align, center align, bottom align, justify align
read/write
The vertical justification applied to the
text in the cell.
width
fixed or measurement string
read/write
The width of the cell.
Methods
Method:
create outlines
delete
merge
78
Parameters:
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original object.
None
Name:
Type:
Description:
with
Cell
The cell or range of
cells to merge with.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
objects
Creates outlines from the text.
nothing
Deletes the object.
cell
Merges cells together.
Method:
search
select
split
unmerge
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Name:
Type:
Description:
using
horizontal, vertical
Sets the direction
in which to split the
cell.
None
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
Selects the cell.
nothing
Splits the cell horizontally or
vertically.
objects
Unmerges the cells.
InDesign CS Scripting Guide
AppleScript Reference
79
change preference
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
applied character
style
string
read/write
The character style applied to the text.
applied font
font object or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
string
read/write
The paragraph style applied to the text.
auto leading
fixed
read/write
Percentage for calculating auto leading
balance ragged
lines
boolean
read/write
Whether to balance ragged lines
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
change text
string
read/write
The replacement text. This property corresponds to the string in the Change To
field of the Find/Change panel.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
fill color
string
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The text override of the fill’s tint percentage (-1 indicates no override)
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
80
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed or measurement string or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
change preference
read only
An object reference to the object.
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
InDesign CS Scripting Guide
AppleScript Reference
81
Property:
Type:
Access:
Description:
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines with only one word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
Where to start the paragraph
strike through
color
swatch or string
read/write
The color of the strike through. Can
return: swatch or string.
strike through gap
color
swatch or string
read/write
The gap color of the strike through. Can
return: swatch or string.
strike through gap
overprint
boolean
read/write
Whether to overprint the gap of the strike
through
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through
strike through
overprint
boolean
read/write
Whether to overprint the strike through
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strike through
strike through
weight
fixed
read/write
The line weight of the strike through
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
string
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The text override of the stroke’s tint percentage (-1 indicates no override)
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color of the underline. Can return:
swatch or string.
underline gap color
swatch or string
read/write
The gap color of the underline. Can
return: swatch or string.
82
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
underline gap
overprint
boolean
read/write
Whether to overprint the gap of the
underline
underline gap tint
fixed
read/write
The gap tint of the underline
underline offset
fixed or measurement string
read/write
The offset of the underline
underline overprint
boolean
read/write
Whether to overprint the underline
underline tint
fixed
read/write
The tint of the underline
underline type
stroke style
read/write
The stroke type of the underline
underline weight
fixed
read/write
The line weight of the underline
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
InDesign CS Scripting Guide
AppleScript Reference
83
character
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
character
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
nested style
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
tab stop
index, name, range, relative, test
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All page item objects contained by this
text object, including any nested page
items or page items inside groups.
applied character
style
character style
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
paragraph style
read/write
The paragraph style applied to the text.
84
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
ascent
fixed
read only
The maximum ascent of any character in
the text object (in points, relative to the
baseline of the line containing the text).
associated XML
elements
list of XML elements
read only
The XML elements associated with this
text object (if any).
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
baseline
fixed
read only
The vertical location of the baseline of the
text, in the current vertical measurement
units, relative to the ruler zero point.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
contents
string or auto page number, next page number, previous page number, section
marker, bullet character, copyright symbol, degree symbol, ellipsis character,
forced line break, paragraph symbol, registered trademark, section symbol,
trademark symbol, right indent tab, indent here tab, em dash, en dash, discretionary hyphen, nonbreaking hyphen, end nested style, double left quote,
double right quote, single left quote, single right quote, em space, en space,
flush space, hair space, nonbreaking space, thin space, figure space, punctuation space, column break, frame break, page break, odd page break, even page
break
read/write
The contents of the text object. If the text
object is a single character, this property
might contain either a special character
constant or a string; for text objects containing multiple characters, this property
will contain a string.
descent
fixed
read only
The maximum descent of any character in
the text, in points, relative to the baseline
of the line containing the text object.
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
InDesign CS Scripting Guide
AppleScript Reference
85
Property:
Type:
Access:
Description:
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
gradient fill angle
fixed
read/write
The angle of the gradient applied to the fill
of the text (if any).
gradient fill length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the fill of
the text.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to the fill of the text, or the center
point of a radial gradient applied to the fill
of the text.
gradient stroke
angle
fixed
read/write
The angle of the gradient applied to the
stroke of the text.
gradient stroke
length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the stroke
of the text.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to stroke of the text, or the center
point of a radial gradient applied to the
stroke of the text.
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal offset
fixed
read only
The horizontal location of the left edge
of the first character in the text, in page
coordinates, relative to the current zero
point.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
86
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
index
integer
read only
index of the object within its parent
object.
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed or measurement string or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
length
integer
read only
The number of characters in the text
object.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
InDesign CS Scripting Guide
AppleScript Reference
87
Property:
Type:
Access:
Description:
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
character
read only
An object reference to the object.
open type features
list of long
read/write
open type features
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
parent story
story
read only
The story containing the text object.
parent text frame
text frame
read only
The text frame containing the text object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
swatch or string
read/write
The gap color of the paragraph rule above.
88
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
InDesign CS Scripting Guide
AppleScript Reference
89
Property:
Type:
Access:
Description:
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list of objects
read/write
A list of all of the properties of all of the
tab stops on this character. Can return:
list of record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
90
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
Methods
Method:
apply style
changecase
convert to table
create outlines
delete
Parameters:
Name:
Type:
Description:
using
character style or paragraph style
The paragraph style
or character style to
apply.
[clearing overrides]
boolean
If true, clear any local formatting in the
text object before
applying the style.
Name:
Type:
Description:
using
uppercase, lowercase, titlecase, sentencecase
Case option to use.
Name:
Type:
Description:
[column separator]
string
The character to
interpret as the
column separator.
[row separator]
string
The character to
interpret as the row
separator.
[number of
columns]
integer
The number of
columns in the table
(only used if the
column and row
separators are the
same).
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original text.
None
Return:
Description:
nothing
Apply a paragraph or character
style to the text object.
nothing
Change the case of text.
table
Convert the text to a table. The
parameters for this command
correspond to the options
in the Convert text to table
dialog box (select some text
and choose table>Convert text
to table to display this dialog
box).
objects
Create outlines from the text.
If you set the delete original
parameter to true, InDesign
will delete the original text and
insert the character outlines as
an inline graphic; if the delete
original parameter is false, InDesign creates an independent
graphic and places it above the
text.
nothing
Deletes the object.
InDesign CS Scripting Guide
AppleScript Reference
91
Method:
export
markup
move
place
92
Parameters:
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The full path to the
exported file.
[showing options]
boolean
If true, display the
Export dialog box.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
using
XML element
The XML element
to associate with the
text.
Name:
Type:
Description:
to
before, after, at beginning, at end
Where to move the
text, relative to the
reference object
(before/after).
[reference]
object
A text object that
specifies the destination of the text
you’re moving.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The location (in
page coordinates) at
which to place the
incoming file.
[destination layer]
layer or layer name as string
The layer on which
to place the incoming file.
[showing options]
boolean
If true, display the
import options
dialog box for the
file type being
placed.
[autoflowing]
boolean
If true, autoflow the
incoming text.
[retaining formatting]
boolean
If true, retain the
formatting of the incoming text. If false,
place the text using
the document’s default text formatting
attributes.
[converting
quotes]
boolean
If true, convert typewriter
(“straight”) quotation marks to typographic (“curly”)
quotation marks.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Export the object to a file.
nothing
Associate the text with an XML
element while preserving the
existing text content.
nothing
Moves the text.
object
Place a file.
Method:
search
select
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
InDesign CS Scripting Guide
Selects text.
AppleScript Reference
93
character style
Properties
Property:
Type:
Access:
Description:
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
based on
character style, character style name as string, or nothing
read/write
The character style this style is based on.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
id
integer
read only
A unique number identifying the object.
imported
boolean
read only
Whether this style was imported from
another document
index
integer
read only
index of the character style within its parent document or application
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
label
string
read/write
A label that can be set to any string
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
name
string
read/write
The name of the character style
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
94
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
object reference
character style
read only
An object reference to the object.
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
InDesign CS Scripting Guide
AppleScript Reference
95
Property:
Type:
Access:
Description:
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
character style
Create a new character style.
extract label
insert label
make
96
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
AppleScript Reference
InDesign CS Scripting Guide
checkbox control
Properties
Property:
Type:
Access:
Description:
checked state
boolean
read/write
If true, the checkbox control is checked.
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the checkbox control within
its parent dialog column, dialog row,
enabling group or border panel
min width
fixed
read/write
The minimum width of the control.
object reference
checkbox control
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
static label
string
read/write
The static text label of the checkbox
control.
Methods
Method:
Parameters:
Return:
Description:
make
None
checkbox
control
Create a new checkbox control.
InDesign CS Scripting Guide
AppleScript Reference
97
clipboard preference
Properties
Property:
Type:
Access:
class
type
read only
The class descriptor type
copy PDF to clipboard
boolean
read/write
Whether to copy pdf to clipboard
object reference
clipboard preference
read only
An object reference for this clipboard
preference
parent
object
read only
The clipboard preference’s parent
paste remembers
layers
boolean
read/write
Whether objects cut or copied from different layers retain their layer assignment
when pasted
prefer PDF when
pasting
boolean
read/write
Whether to paste pdf if available
prefer styled text
when pasting
boolean
read/write
Whether to include text attributes if available when pasting text
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
98
AppleScript Reference
InDesign CS Scripting Guide
Description:
clipping path settings
Elements
Element:
Refer to by:
path
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
alpha channel path
names
list of strings
read only
A list of the path names of alpha channels
associated with an imported graphic.
applied path name
string
read/write
The name of the currently-applied clipping path.
class
type
read only
The class of the object.
clipping type
none, detect edges, alpha channel, photoshop path, user modified path
read/write
The clipping path type.
include inside
edges
boolean
read/write
If true, include inside edges of the clipping
path.
inset frame
fixed or measurement string
read/write
The inset width of the frame.
invert path
boolean
read/write
If true, invert the path of the clipping
path.
object reference
clipping path settings
read only
An object reference to the object.
parent
object
read only
The parent of the object.
photoshop path
names
list of strings
read only
A list of path names of a Photoshop path.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
restrict to frame
boolean
read/write
If true, restrict the imported graphic to
its frame.
threshold
integer
read/write
Sets the threshold for detect edges or
alpha channel.
tolerance
integer
read/write
Sets the accuracy of the Find Edges
method of generating a clipping path.
Higher values produce a clipping path
that’s closer to the shape of the objects in
the imported graphic, but tend to be more
jagged. Lower values produce smoother
clipping paths, but tend to be less accurate.
use high resolution
image
boolean
read/write
If true, use a high resolution version of the
imported graphic when creating a clipping
path using the Find Edges method.
Methods
Method:
Parameters:
Return:
Description:
convert to frame
None
page item
Convert to Frame.
InDesign CS Scripting Guide
AppleScript Reference
99
close window behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the close window behavior within
its parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the behavior.
object reference
close window behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
close window
behavior
Create a new close window
behavior.
extract label
insert label
make
100
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
AppleScript Reference
InDesign CS Scripting Guide
Description:
color
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
color value
list of fixed
read/write
The values of the color
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the color within its parent
application or document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
model
spot, process, registration, mixedinkmodel
read/write
The color model of the color.
name
string
read/write
The name of the color.
object reference
color
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
space
RGB, CMYK, LAB, mixed ink
read/write
The color space of the color.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
color
Create a new color.
nothing
Merge one or more other
swatches into this one.
InDesign CS Scripting Guide
AppleScript Reference
extract label
insert label
make
merge
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
Name:
Type:
Description:
with
color
The swatches to
merge.
101
color setting
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
CMS settings
string
read/write
The name of the current color settings
configuration.
CMS settings list
list of strings
read only
The list of available color settings configurations.
CMS settings path
file reference or file name as string
read/write
The path to the color settings file.
CMYK policy
color policy off, preserve embedded profiles, convert to working space
read/write
The policy for handling mismatched
CMYK configurations.
enable color management
boolean
read/write
If true, enable color management.
engine
string
read/write
The name of the color engine to use.
engine list
list of strings
read only
The list of available color engines.
intent
use color settings, perceptual, saturation, relative colorimetric, absolute
colorimetric
read/write
The rendering intent
mismatch ask
when opening
boolean
read/write
If true, ask the user what to do when
opening a file with a mismatched color
configuration.
mismatch ask
when pasting
boolean
read/write
If true, ask the user what to do when
pasting an object with a mismatched color
configuration.
missing ask when
opening
boolean
read/write
If true, ask the user what to do when
opening an object with a missing color
configuration.
object reference
color setting
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
RGB policy
color policy off, preserve embedded profiles, convert to working space
read/write
The policy for handling mismatched rgb
configurations.
use BPC
boolean
read/write
If true, compensate for differences in black
point.
working space
CMYK
string
read/write
The name of the current CMYK configuration.
working space
CMYK list
list of strings
read only
The list of valid CMYK color profiles.
working space
RGB
string
read/write
The name of the current rgb configuration.
working space
RGB list
list of strings
read only
The list of valid RGB color profiles.
102
AppleScript Reference
InDesign CS Scripting Guide
column
Elements
Element:
Refer to by:
cell
index, name, range, relative, test, id
column
index, name, range, relative, test
row
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
auto grow
boolean
read/write
If true, the cell will expand to display its
content.
bottom edge stroke
color
swatch
read/write
The stroke color of the bottom edge of the
cell.
bottom edge stroke
gap color
swatch
read/write
The gap color of the stroke applied to the
bottom edge of the cell.
bottom edge stroke
gap overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the bottom edge of
the cell.
bottom edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the bottom edge of the
cell (-1 indicates 100%, or no tint override).
bottom edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
bottom edge of the cell.
bottom edge stroke
priority
integer
read/write
The stroke priority of the bottom edge
bottom edge stroke
tint
fixed
read/write
The tint applied to the stroke of the bottom edge of the cell (-1 indicates 100%, or
no tint override).
bottom edge stroke
type
stroke style
read/write
The type of stroke applied to the bottom
edge of the cell.
bottom edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
bottom edge of the cell.
bottom inset
fixed or measurement string
read/write
The bottom inset the cell.
class
type
read only
The class of the object.
clip content to cell
boolean
read/write
If true, clip the content of the cell to the
boundaries of the cell.
column span
integer
read only
The number of columns that this cell
spans
contents
text or object
read/write
The text contents of the cell.
diagonal line in
front
boolean
read/write
If true, the diagonal line will draw in front
of the contents of the cell.
diagonal line
stroke color
swatch
read/write
The stroke color of the diagonal line(s)
applied to the cell.
diagonal line
stroke gap color
swatch
read/write
The gap color of the diagonal line(s).
diagonal line
stroke gap overprint
boolean
read/write
If true, overprint the color of the gap of
the diagonal line(s).
diagonal line
stroke gap tint
fixed
read/write
The tint applied to the gap color of the
stroke of the diagonal line(s) of the cell (-1
indicates 100%, or no tint override).
diagonal line
stroke overprint
boolean
read/write
If true, overprint the diagonal line(s) applied to the cell.
InDesign CS Scripting Guide
AppleScript Reference
103
Property:
Type:
Access:
Description:
diagonal line
stroke tint
fixed
read/write
The tint applied to the stroke of the diagonal line(s) of the cell (-1 indicates 100%, or
no tint override).
diagonal line
stroke type
stroke style
read/write
The type of stroke applied to the diagonal
line(s) of the cell.
diagonal line
stroke weight
fixed or measurement string
read/write
The stroke weight of the diagonal line(s)
of the cell.
fill color
swatch
read/write
The swatch, color, gradient, tint, or mixed
ink applied to the fill of the cell.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the cell (-1 indicates 100%, or no tint
override).
first baseline offset
ascent offset, cap height, leading offset, embox height, x height, fixed height
read/write
The method used to calculate the distance
from the first baseline of text in the cell
and the top inset of the cell.
gradient fill angle
fixed
read/write
Angle of a linear gradient on the fill
gradient fill length
fixed
read/write
Length of ramp for a linear gradient or
radius of a radial gradient on the fill
gradient fill start
list of fixed or measurement strings {x, y}
read/write
Center point for a radial gradient or starting point for a linear gradient on the fill
height
fixed or measurement string
read/write
The height of the cell.
index
integer
read only
index of the cell within its parent table.
inner column
stroke color
swatch
read/write
The stroke color of the inner column of
the cell.
inner column
stroke gap color
swatch
read/write
The gap color of the stroke applied to the
inner column of the cell.
inner column
stroke gap overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the inner column of
the cell.
inner column
stroke gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the inner column of the
cell (-1 indicates 100%, or no tint override).
inner column
stroke overprint
boolean
read/write
If true, overprint the stroke applied to the
inner column of the cell.
inner column
stroke tint
fixed
read/write
The tint applied to the stroke of the inner
column of the cell (-1 indicates 100%, or
no tint override).
inner column
stroke type
stroke style
read/write
The type of stroke applied to the inner
column of the cell.
inner column
stroke weight
fixed or measurement string
read/write
The width of the stroke applied to the the
inner column of the cell.
inner row stroke
color
swatch
read/write
The stroke color of the inner row of the
cell.
inner row stroke
gap color
swatch
read/write
The gap color of the stroke applied to the
inner row of the cell.
inner row stroke
gap overprint
boolean
read/write
Whether to overprint the gap of the inner
row
inner row stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the inner row of the cell
(-1 indicates 100%, or no tint override).
inner row stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
inner row of the cell.
inner row stroke
tint
fixed
read/write
The tint applied to the stroke of the inner
row of the cell (-1 indicates 100%, or no
tint override).
inner row stroke
type
stroke style
read/write
The type of stroke applied to the inner row
of the cell.
104
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
inner row stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
inner row of the cell.
keep with next row
boolean
read/write
If true, keep this row with the next row
when the rows break between pages, text
frames, or text columns.
left edge stroke
color
swatch
read/write
The stroke color of the left edge of the cell.
left edge stroke gap
color
swatch
read/write
The gap color of the stroke applied to the
left edge of the cell.
left edge stroke gap
overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the left edge of the cell.
left edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the left edge of the cell
(-1 indicates 100%, or no tint override).
left edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
left edge of the cell.
left edge stroke
priority
integer
read/write
The stroke priority of the left edge
left edge stroke tint
fixed
read/write
The tint of the color of the left edge
left edge stroke
type
stroke style
read/write
The type of stroke applied to the left edge
of the cell.
left edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
left edge of the cell.
left inset
fixed or measurement string
read/write
The left inset of the cell.
maximum height
fixed or measurement string
read/write
Specifies the maximum height of the row
containing the cell.
minimum first
baseline offset
fixed or measurement string
read/write
The minimum distance (in points) between the first baseline of the text in the
cell and the top inset of the frame or cell.
minimum height
fixed or measurement string
read/write
Constrains the row height to an amount
no smaller than this value. The row may
be larger than this amount, however,
as the row height will continue to grow
automatically as text is added.
name
string
read only
The name of the cell, in the form row
number; column number. The third cell of
the fourth row, for example, would have
the name “R4:C3”.
object reference
column
read only
An object reference to the object.
overflows
boolean
read only
If true, the cell contains overset (i.e.,
uncomposed) text.
overprint fill
boolean
read/write
If true, overprint the fill of the cell.
paragraph spacing
limit
fixed or measurement string
read/write
When the vertical justification of the
cell is set to justified, this is the maximum amount of space that will be added
between paragraphs. Increase this value
to encourage spacing between paragraphs
of vertically justified text; decrease it to
increase the leading between lines of text
in vertically justified text.
parent
object
read only
The parent of the object.
parent column
column
read only
The parent column of the cell.
parent row
row
read only
The parent row of the cell.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right edge stroke
color
swatch
read/write
The stroke color of the right edge of the
cell.
InDesign CS Scripting Guide
AppleScript Reference
105
Property:
Type:
Access:
Description:
right edge stroke
gap color
swatch
read/write
The gap color of the stroke applied to the
right edge of the cell.
right edge stroke
gap overprint
boolean
read/write
If true, overprint the color assigned to
the gap of the stroke of the right edge of
the cell.
right edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the right edge of the cell
(-1 indicates 100%, or no tint override).
right edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
right edge of the cell.
right edge stroke
priority
integer
read/write
The stroke priority of the right edge
right edge stroke
tint
fixed
read/write
The tint applied to the stroke of the right
edge of the cell (-1 indicates 100%, or no
tint override).
right edge stroke
type
stroke style
read/write
The type of stroke applied to the right
edge of the cell.
right edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
right edge of the cell.
right inset
fixed or measurement string
read/write
The right inset the cell.
rotation angle
fixed
read/write
The rotation angle of the cell.
row span
integer
read only
The number of rows that this cell spans
row type
body row, header row, footer row, mixed state
read/write
The type of the row containing the cell.
start row
anywhere, next column, next frame, next page, next odd page, next even page
read/write
Where to start the row
text cell rotation
follows story direction
boolean
read/write
Whether text cell direction matches the
story direction
top edge stroke
color
swatch
read/write
The stroke color of the top edge of the cell.
top edge stroke gap
color
swatch
read/write
The gap color of the stroke applied to the
top edge of the cell.
top edge stroke gap
overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the top edge of the cell.
top edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the top edge of the cell
(-1 indicates 100%, or no tint override).
top edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
top edge of the cell.
top edge stroke
priority
integer
read/write
The stroke priority of the top edge
top edge stroke tint
fixed
read/write
The tint applied to the stroke of the top
edge of the cell (-1 indicates 100%, or no
tint override).
top edge stroke
type
stroke style
read/write
The type of stroke applied to the right
edge of the cell.
top edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
top edge of the cell.
top inset
fixed or measurement string
read/write
The top inset the cell.
top left diagonal
line
boolean
read/write
If true, draw a diagonal line from the top
left corner to the bottom right corner of
the cell .
top right diagonal
line
boolean
read/write
If true, draw a diagonal line from the top
right corner to the bottom left corner of
the cell .
vertical justification
top align, center align, bottom align, justify align
read/write
The vertical justification applied to the
text in the cell.
width
fixed or measurement string
read/write
The width of the cell.
106
AppleScript Reference
InDesign CS Scripting Guide
Methods
Method:
create outlines
delete
make
merge
redistribute
search
select
split
unmerge
Parameters:
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original object.
None
Name:
Type:
Description:
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after an
existing column or
at the beginning/
end of a parent as
column or table.
Name:
Type:
Description:
with
cell
The cell to merge
with.
Name:
Type:
Description:
using
horizontal, vertical
which direction to
redistribute.
[thru]
cell
redistribute till this
object.
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Name:
Type:
Description:
using
horizontal, vertical
Which direction to
split.
None
Return:
Description:
objects
Create outlines from the text.
nothing
Deletes the object.
column
Create a new column.
cell
Merge cells together.
nothing
Redistribute columns or rows.
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
Select this column.
nothing
Split the cell either horizontally
or vertically.
objects
Unmerge the cells.
InDesign CS Scripting Guide
AppleScript Reference
107
contour option
Properties
Property:
Type:
Access:
Description:
alpha channel path
names
list of strings
read only
A list of the alpha channel path names in
an imported graphic.
class
type
read only
The class of the object.
contour path name
string
read/write
The name of the current contour option
applied to an imported graphic.
contour type
bounding box, photoshop path, detect edges, alpha channel, graphic frame,
same as clipping
read/write
The contour options type applied to an
imported graphic.
include inside
edges
boolean
read/write
If true, include the inside edges of a
contour path.
object reference
contour option
read only
An object reference to the object.
parent
text wrap preference
read only
The parent of the object.
photoshop path
names
list of strings
read only
A list of the photoshop path names in an
imported graphic.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
108
AppleScript Reference
InDesign CS Scripting Guide
cross reference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
cross reference
type
see or also bracket, see, see also, see herein, see also herein, custom cross
reference, custom cross reference before, custom cross reference after
read/write
The cross reference type.
custom type string
string
read/write
The string if a custom cross reference.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the cross reference within its
parent topic
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
object reference
cross reference
read only
An object reference to the object.
parent
topic
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
referenced topic
topic
read/write
The index topic that the cross reference
refers to.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
cross reference
Create a new cross reference.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
referenced topic
topic
The referenced
topic.
cross reference
type
lete, pitalize, me, rent, dex, btopics, oss
references, ge references, see or also
bracket, see, see also, see herein, see also
herein, custom cross reference, custom
cross reference before, custom cross
reference after
The type of reference.
[custom type
string]
string
A custom reference
as string.
InDesign CS Scripting Guide
Description:
AppleScript Reference
109
dashed stroke style
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
dash array
list of fixed
read/write
The position of the dashes and gaps in the
the dashed stroke style.
end cap
butt end cap, round end cap, projecting end cap
read/write
The appearance of the end points of each
dash.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the dashed stroke style within its
parent document or application
name
string
read/write
The name of the dashed stroke style.
object reference
dashed stroke style
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The method used to adjust the position
of dashes and gaps on a dashed stroke
around corner points on a path. This
property corresponds to the Corners popup menu in the Stroke palette (only visible
when a dashed stroke is selected).
stroke style type
string
read only
The type of the dashed stroke style.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
make
None
dashed stroke
style
Create a new dashed stroke
style.
110
AppleScript Reference
InDesign CS Scripting Guide
dialog
Elements
Element:
Refer to by:
dialog column
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
can cancel
boolean
read/write
If true, the dialog contains a Cancel
button.
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the dialog within its parent
application
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the dialog.
object reference
dialog
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
destroy
None
nothing
Destroy dialog
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
extract label
insert label
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Description:
make
None
dialog
Create a new dialog.
show
None
boolean
Show dialog.
InDesign CS Scripting Guide
AppleScript Reference
111
dialog column
Elements
Element:
Refer to by:
angle combobox
index, name, range, relative, test, id
angle editbox
index, name, range, relative, test, id
border panel
index, name, range, relative, test, id
checkbox control
index, name, range, relative, test, id
dialog row
index, name, range, relative, test, id
dropdown
index, name, range, relative, test, id
enabling group
index, name, range, relative, test, id
integer combobox
index, name, range, relative, test, id
integer editbox
index, name, range, relative, test, id
measurement combobox
index, name, range, relative, test, id
measurement editbox
index, name, range, relative, test, id
percent combobox
index, name, range, relative, test, id
percent editbox
index, name, range, relative, test, id
radiobutton group
index, name, range, relative, test, id
real combobox
index, name, range, relative, test, id
real editbox
index, name, range, relative, test, id
static text
index, name, range, relative, test, id
text editbox
index, name, range, relative, test, id
widget
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the dialog column within its parent dialog, dialog row, enabling group or
border panel
object reference
dialog column
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
make
None
dialog column
Create a new dialog column.
112
AppleScript Reference
InDesign CS Scripting Guide
dialog row
Elements
Element:
Refer to by:
angle combobox
index, name, range, relative, test, id
angle editbox
index, name, range, relative, test, id
border panel
index, name, range, relative, test, id
checkbox control
index, name, range, relative, test, id
dialog column
index, name, range, relative, test, id
dropdown
index, name, range, relative, test, id
enabling group
index, name, range, relative, test, id
integer combobox
index, name, range, relative, test, id
integer editbox
index, name, range, relative, test, id
measurement combobox
index, name, range, relative, test, id
measurement editbox
index, name, range, relative, test, id
percent combobox
index, name, range, relative, test, id
percent editbox
index, name, range, relative, test, id
radiobutton group
index, name, range, relative, test, id
real combobox
index, name, range, relative, test, id
real editbox
index, name, range, relative, test, id
static text
index, name, range, relative, test, id
text editbox
index, name, range, relative, test, id
widget
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the dialog row within its parent
dialog column, enabling group or border
panel
object reference
dialog row
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
make
None
dialog row
Create a new dialog row.
InDesign CS Scripting Guide
AppleScript Reference
113
dictionary preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
composition
use user dictionary, use document, both
read/write
Tells the document which hyphenation
source to use when composing text.
merge user dictionary
boolean
read/write
If true, merge the user dictionary files into
the document.
object reference
dictionary preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
recompose
boolean
read/write
If true, recompose every time the composition source has changed.
114
AppleScript Reference
InDesign CS Scripting Guide
display performance preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
default display
settings
high quality, typical, optimized
read/write
The default display setting for new windows.
ignore local settings
boolean
read/write
If true, ignore local settings for all windows.
object reference
display performance preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
persist local settings
boolean
read/write
Whether or not to local settings are saved
to and read from the document
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
InDesign CS Scripting Guide
AppleScript Reference
115
display setting
Properties
Property:
Type:
Access:
Description:
antialiasing
boolean
read/write
If true, anti-alias objects. (This setting
affects the display only, and has no effect
on printing.)
class
type
read only
The class of the object.
greek below
fixed
read/write
Display text below this size (in points) as a
gray rectangle (“greeking”).
index
integer
read only
index of the display setting within its parent application
object reference
display setting
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
raster
gray out, proxy, high resolution, default
read/write
The method used to display raster images.
transparency
off, low quality, medium quality, high quality, default
read/write
The method used to display transparency.
vector
gray out, proxy, high resolution, default
read/write
The method used to display vector objects.
116
AppleScript Reference
InDesign CS Scripting Guide
document
Elements
Element:
Refer to by:
bookmark
index, name, range, relative, test, id
button
index, name, range, relative, test, id
character style
index, name, range, relative, test, id
color
index, name, range, relative, test, id
dashed stroke style
index, name, range, relative, test, id
dotted stroke style
index, name, range, relative, test, id
DTD
index, name, range, relative, test, id
font
index, name, range, relative, test
form field
index, name, range, relative, test, id
gradient
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
guide
index, name, range, relative, test, id
hyperlink
index, name, range, relative, test, id
hyperlink external page destination
index, name, range, relative, test, id
hyperlink page destination
index, name, range, relative, test, id
hyperlink page item source
index, name, range, relative, test, id
hyperlink text destination
index, name, range, relative, test, id
hyperlink text source
index, name, range, relative, test, id
hyperlink URL destination
index, name, range, relative, test, id
hyphenation exception
index, name, range, relative, test
index
index, name, range, relative, test, id
ink
index, name, range, relative, test, id
language
index, name, range, relative, test, id
layer
index, name, range, relative, test, id
layout window
index, name, range, relative, test
link
index, name, range, relative, test, id
master spread
index, name, range, relative, test, id
mixed ink
index, name, range, relative, test, id
mixed ink group
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph style
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
section
index, name, range, relative, test, id
spread
index, name, range, relative, test, id
story
index, name, range, relative, test, id
story window
index, name, range, relative, test
striped stroke style
index, name, range, relative, test, id
stroke style
index, name, range, relative, test, id
swatch
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
tint
index, name, range, relative, test, id
InDesign CS Scripting Guide
AppleScript Reference
117
Element:
Refer to by:
TOC style
index, name, range, relative, test, id
trap preset
index, name, range, relative, test, id
validation error
index, name, range, relative, test
window
index, name, range, relative, test
XML comment
index, name, range, relative, test, id
XML element
index, name, range, relative, test, id
XML export map
index, name, range, relative, test
XML import map
index, name, range, relative, test
XML instruction
index, name, range, relative, test, id
XML item
index, name, range, relative, test, id
XML tag
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
after blending
intent
use color settings, perceptual, saturation, relative colorimetric, absolute
colorimetric
read/write
The rendering intent for transparent
objects. Corresponds to the After-Blending Intent pop-up menu in the Assign
Profiles dialog box.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items on the document
pages of the document, egardless of their
position in the object hierarchy (i.e., page
items inside groups or inside other page
items will be included).
associated XML
element
XML element
read only
The XML element associated with the
document.
button preferences
button preferences
read only
button preferences
class
type
read only
The class of the object.
CMYK profile
string
read/write
The name of the current CMYK profile.
CMYK profile list
list of strings
read only
A list of the names of the available CMYK
profiles.
default image
intent
use color settings, perceptual, saturation, relative colorimetric, absolute
colorimetric
read/write
The default color management intent for
bitmap images in the document. This
property corresponds to the Default image
Intent pop-up menu in the Assign Profiles
dialog box.
dictionary preferences
dictionary preferences
read only
The user dictionary preferences for the
document. This object corresponds to the
Dictionary panel of the Preferences dialog
box.
document preferences
document preferences
read only
The document preferences for the
document. This object corresponds to the
document panel of the Preferences dialog
box.
file path
file reference or file name as string
read only
The file path to the folder containing
the document (does not include the file
name).
full name
file reference or file name as string
read only
The file path to the document file, including the file name.
galley preferences
galley preferences
read only
The story Editor preferences of the
document. This object corresponds to the
story Editor Display panel of the Preferences dialog box.
118
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
grid preferences
grid preferences
read only
The document grid preferences. This
object corresponds to the Grids panel of
the Preferences dialog box.
guide preferences
guide preferences
read only
The guide preferences for the document.
This object corresponds to the guides and
Pasteboard panel of the Preferences dialog
box.
index
integer
read only
index of the document within its parent
application
index generation
options
index options
read only
The options controlling index generation
for the document. This object corresponds
to the Generate index dialog box (to
display this dialog box, choose Generate
index from the index palette menu).
label
string
read/write
A label that can be set to any string
layout adjustment
preferences
layout adjustment preferences
read only
The document layout adjustment preferences. The properties in this object
correspond to the options shown in the
Layout Adjustment dialog box (choose
Layout Adjustment from the Layout menu
to display this dialog box).
margin preferences
margin preferences
read only
Margin preferences
metadata preferences
metadata preferences
read only
The document metadata preferences.
modified
boolean
read only
If true, the document has been modified
since it was last saved.
name
string
read only
The name of the document.
object reference
document
read only
An object reference to the object.
package for GoLive
preferences
package for GoLive preferences
read only
The default Package For GoLive preferences
parent
object
read only
The parent of the object.
pasteboard preferences
pasteboard preferences
read only
The pasteboard preferences for the
document.
polygon preferences
polygon preferences
read only
The polygon preferences for the document.
print preferences
print preferences
read only
The print preferences of the document.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
redo name
string
read only
Name of the action on the top of the redo
stack.
RGB profile
string
read/write
The name of the current RGB profile.
RGB profile list
list of string
read only
The list of the names of available RGB
profiles.
saved
boolean
read only
If true, the document has been saved since
it was opened.
selection
list
read/write
The current selection of the active window.
solid color intent
use color settings, perceptual, saturation, relative colorimetric, absolute
colorimetric
read/write
The rendering intent to use for solid
colors. This property corresponds to the
Solid color Intent pop-up menu in the Assign Profiles dialog box.
story preferences
story preferences
read only
The document default story preferences.
text defaults
text default
read only
The document default text formatting.
Changing the default text formatting sets
the default formatting for all new text
frames, but has no effect on the text in
existing text frames.
InDesign CS Scripting Guide
AppleScript Reference
119
Property:
Type:
Access:
Description:
text frame preferences
text frame preferences
read only
The document default text frame preferences. Changing the default text frame
preferences sets the default formatting for
all new text frames, but has no effect on
existing text frames.
text preferences
text preferences
read only
The document’s text preferences. This
object corresponds to the text panel of the
Preferences dialog box.
transparency
preferences
transparency preferences
read only
The document transparency preferences.
This object corresponds to the setting of
the Transparency Blend Space submenu of
the Edit menu.
undo name
string
read only
The name of the action on the top of the
undo stack.
unused swatches
list of swatch
read only
The unused swatches in the document.
view preferences
view preferences
read only
The view preferences of the document. The
properties of this object correspond to the
options in the Units and Increments panel
of the Preferences dialog box.
visible
boolean
read only
If true, the document is visible.
XML export preferences
XML export preferences
read only
The XML export preferences of the
document.
XML import preferences
XML import preferences
read only
The XML import preferences of the
document.
XML view preferences
XML view preferences
read only
The XML view preferences of the
document. The properties of this object
correspond to the show/hide options on
the Structure View menu.
zero point
list of numbers or measurement strings {x, y}
read/write
The current zero point. The default location of the zero point is set by the ruler
origin property of the view preferences
object. Setting the zero point to (0,0)
returns the zero point to the default location.
Methods
Method:
Parameters:
Return:
Description:
auto style
None
nothing
Auto style the document based
on the tag to style map
auto tag
None
nothing
Auto tag the document based
on the style to tag map
nothing
Close the document.
close
120
Name:
Type:
Description:
[saving]
no, ask, yes
If true, save changes
before closing the
document.
[saving in]
file reference or file name as string
The file in which to
save the document.
AppleScript Reference
InDesign CS Scripting Guide
Method:
create toc
delete unused tags
export
extract label
import dtdd
import styles
import xml
insert label
load xml tags
Parameters:
Return:
Description:
text frame
Create table of Content for a
document or book.
nothing
Delete unused XML markup
tags
nothing
Exports the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Import a dtdd to use for validation.
nothing
Import styles or presets.
nothing
Import a XML file into an
InDesign document.
nothing
Sets the string associated with
the given key (label name).
nothing
Load a set of tags from an
external file.
InDesign CS Scripting Guide
AppleScript Reference
Name:
Type:
Description:
using
TOCStyle
The table of content
style to create with.
[replacing]
boolean
If true, replace
existing TOC.
[from book]
book
The book object
where TOC is created from.
[place point]
list of numbers or measurement strings
{x, y}
The point where to
place the object.
[include overset]
boolean
If true, include TOC
in overset.
[destination layer]
layer or layer name as string
The layer on which
to place the TOC as
layer.
None
Name:
Type:
Description:
format
string (name of export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
from
string
What to import
from.
Name:
Type:
Description:
format
character styles format, paragraph styles
format, text styles format, toc styles
format
the format.
from
string
an InDesign file to
import from.
Name:
Type:
Description:
from
string
What to import
from.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
from
string
What to import
from.
121
Method:
make
package
package for go live
print out
redo
Name:
Type:
Description:
[showing window]
boolean
If true, open the
document in a
window.
[document preset]
document preset or document preset
name as string
document preset to
use as documentPreset.
Name:
Type:
Description:
to
string
A folder, alias or
path as string in
which to place the
packaged files.
copying fonts
boolean
If true, copy required fonts.
copying linked
graphics
boolean
If true, copy linked
graphics file.
copying profiles
boolean
If true, copy profiles.
updating graphics
boolean
If true, update
graphics links before packaging.
including hidden
layers
boolean
If true, include
objects on hidden
layers.
ignore preflight
errors
boolean
If true, ignore
preflight errors and
package anyways.
creating report
boolean
If true, create package report.
Name:
Type:
Description:
location
string
File location for
package.
Name:
Type:
Description:
[print dialog]
boolean
If true, display the
Print dialog box.
[using]
printer preset or printer preset name as
string
The printer preset.
None
save
save xml tags
122
Parameters:
Name:
Type:
Description:
[to]
file reference or file name as string
Where to save the
document. If the
document is already
saved, a copy is
saved at this path,
the original file is
closed the new copy
is opened.
[stationery]
boolean
If true, save the file
as stationery.
Name:
Type:
Description:
to
string
The file to export to.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
document
Create a new document.
boolean
Packages the document.
boolean
Packages for GoLive.
nothing
Prints the document.
nothing
Redo the last action
nothing
Save the document.
nothing
Save a set of tags to an external
file.
Method:
search
select
undo
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
selectable items
object, list of objects, or nothing (to
deselect all)
The object(s) to
select.
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
None
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
Selects an object or objects.
If the object is a text object
(e.g., characters, words, lines,
paragraphs), any other selected
objects are deselected (the AppendSelection parameter has
no effect).
nothing
Undo the last action
InDesign CS Scripting Guide
AppleScript Reference
123
document preference
Properties
Property:
Type:
Access:
Description:
allow page shuffle
boolean
read/write
If false, adding a page to a spread always
adds it to that spread (up to a maximum
of 10 pages). If true, pages added to the
spread can be moved (“shuffled”) to a different spread.
class
type
read only
The class of the object.
column guide color list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of column guides.
document bleed
bottom offset
fixed or measurement string
read/write
The height of the bottom document bleed
offset.
document bleed
inside or left offset
fixed or measurement string
read/write
The width of the inside (or left) document
bleed offset.
document bleed
outside or right
offset
fixed or measurement string
read/write
The width of the outside (or right)
document bleed offset.
document bleed
top offset
fixed or measurement string
read/write
The height of the top document bleed
offset.
document bleed
uniform size
boolean
read/write
The bleed uniform size flag
document slug
uniform size
boolean
read/write
The slug uniform size flag
facing pages
boolean
read/write
If true, the document uses facing pages.
margin guide color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of margin guides.
object reference
document preference
read only
An object reference to the object.
overprint black
boolean
read/write
If true, overprint black when printing the
document.
page height
fixed or measurement string
read/write
The height of the pages in the document.
page orientation
landscape, portrait
read/write
The orientation of the pages in the
document.
page width
fixed or measurement string
read/write
The width of the pages in the document.
pages per
document
integer
read/write
The number of pages in a document.
parent
object
read only
The parent of the object.
preserve layout
when shuffling
boolean
read/write
If true, then when setting ‘allow page shuffle’ and the document has spreads with a
number of pages greater than the default,
this layout is preserved. If false then the
pages on these spreads get shuffled.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
slug bottom offset
fixed or measurement string
read/write
The height of the bottom slug offset.
slug inside or left
offset
fixed or measurement string
read/write
The width of the inside (or left) slug offset.
slug right or outside offset
fixed or measurement string
read/write
The width of the outside (or right) slug
offset.
slug top offset
fixed or measurement string
read/write
The height of the top slug offset.
124
AppleScript Reference
InDesign CS Scripting Guide
document preset
Properties
Property:
Type:
Access:
Description:
bottom
fixed or measurement string
read/write
Bottom edge of the document preset
class
type
read only
The class descriptor type
column count
integer
read/write
The number of columns
column gutter
fixed or measurement string
read/write
The distance between columns in a text
frame
document bleed
bottom offset
fixed or measurement string
read/write
The bottom document bleed offset
document bleed
inside or left offset
fixed or measurement string
read/write
The left or inside document bleed offset
document bleed
outside or right
offset
fixed or measurement string
read/write
The outside or right document bleed offset
document bleed
top offset
fixed or measurement string
read/write
The top document bleed offset
facing pages
boolean
read/write
Whether the document has facing page.
id
integer
read only
The document preset’s unique id
index
integer
read only
index of the document preset within its
parent application
label
string
read/write
A label that can be set to any string
left
fixed or measurement string
read/write
Left edge of the document preset
name
string
read/write
The name of the document preset
object reference
document preset or document preset name as string
read only
An object reference for this document
preset
page height
fixed or measurement string
read/write
The height of the page
page orientation
landscape, portrait
read/write
The orientation of the page
page width
fixed or measurement string
read/write
The width of the page
pages per
document
integer
read/write
The number of pages in a document
parent
object
read only
The document preset’s parent
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
right
fixed or measurement string
read/write
Right edge of the document preset
slug bottom offset
fixed or measurement string
read/write
The bottom slug offset
slug inside or left
offset
fixed or measurement string
read/write
The inside or left slug offset
slug right or outside offset
fixed or measurement string
read/write
The right or outside slug offset
slug top offset
fixed or measurement string
read/write
The top slug offset
top
fixed or measurement string
read/write
Top edge of the document preset
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
document
preset
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
extract label
Name:
Type:
Description:
key
string
The key.
InDesign CS Scripting Guide
AppleScript Reference
125
Method:
insert label
make
126
Parameters:
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Sets the string associated with
the given key (label name).
document
preset
Create a new document preset.
dotted stroke style
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
dot array
list of fixed
read/write
The position of the dots in the the dotted
stroke style.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the dotted stroke style within its
parent document or application
name
string
read/write
The name of the XML tag
object reference
dotted stroke style
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The method used to adjust the position
of dashes and gaps on a dashed stroke
around corner points on a path. This
property corresponds to the Corners popup menu in the Stroke palette (only visible
when a dashed stroke is selected).
stroke style type
string
read only
Stroke style type
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
make
None
dotted stroke
style
Create a new dotted stroke
style.
InDesign CS Scripting Guide
AppleScript Reference
127
dropdown
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the dropdown within its parent
dialog column, dialog row, enabling group
or border panel
min width
fixed
read/write
The minimum width of the control.
object reference
dropdown
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
selected index
integer
read/write
index of the selected string in the
dropdown
string list
list of strings
read/write
A list of the strings that appear on the
menu of the control.
Methods
Method:
Parameters:
Return:
Description:
make
None
dropdown
Create a new dropdown.
128
AppleScript Reference
InDesign CS Scripting Guide
DTD
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
contents
fixed or measurement string
read only
The contents of the dtdd.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the dtdd within its parent
document, XML element or XML item
object reference
DTD
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
public id
string
read only
The public id of the dtdd’S DOCTYPE
declaration. Only valid if the dtdd an an
external subset.
root tag
XML tag
read/write
The XML tag of the document’s root
object.
system id
string
read only
The system id of the dtdd’S DOCTYPE
declaration. Only valid if the dtdd is an
external subset.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
xml element
Move element before/after
another element or text object,
or to beginning/end.
nothing
Select this dtdd.
move
select
Name:
Type:
Description:
to
before, after, at beginning, at end
Location.
[reference]
object
Before/after this
object as xml item
or text.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
InDesign CS Scripting Guide
AppleScript Reference
129
enabling group
Elements
Element:
Refer to by:
angle combobox
index, name, range, relative, test, id
angle editbox
index, name, range, relative, test, id
border panel
index, name, range, relative, test, id
checkbox control
index, name, range, relative, test, id
dialog column
index, name, range, relative, test, id
dialog row
index, name, range, relative, test, id
dropdown
index, name, range, relative, test, id
enabling group
index, name, range, relative, test, id
integer combobox
index, name, range, relative, test, id
integer editbox
index, name, range, relative, test, id
measurement combobox
index, name, range, relative, test, id
measurement editbox
index, name, range, relative, test, id
percent combobox
index, name, range, relative, test, id
percent editbox
index, name, range, relative, test, id
radiobutton group
index, name, range, relative, test, id
real combobox
index, name, range, relative, test, id
real editbox
index, name, range, relative, test, id
static text
index, name, range, relative, test, id
text editbox
index, name, range, relative, test, id
widget
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
checked state
boolean
read/write
True if this item is checked
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the enabling group within its parent dialog column, dialog row, enabling
group or border panel
min width
fixed
read/write
The minimum width of the control.
object reference
enabling group
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
static label
string
read/write
static text label for the widget
Methods
Method:
Parameters:
Return:
Description:
make
None
enabling
group
Create a new enabling group.
130
AppleScript Reference
InDesign CS Scripting Guide
EPS
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
actual ppi
list of fixed
read only
The resolution of the native graphic file
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
clipping path
clipping path settings
read only
The clipping path settings
effective ppi
list of fixed
read only
The resolution of the graphic after it has
been resized
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
image type name
string
read only
The type of image
index
integer
read only
index of the epss within its parent XML
element, page item, oval, rectangle, polygon, graphic line, state, group or button
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item link
link
read only
link to a placed file
InDesign CS Scripting Guide
AppleScript Reference
131
Property:
Type:
Access:
Description:
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
nonprinting
boolean
read/write
Whether the page item is non-printing
object reference
EPS
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
space
string
read only
The color space
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
132
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
nothing
Export the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
nothing
Markup layout content with
XML preserving the existing
content.
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
export
extract label
insert label
markup
move
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
using
XML Element
The element to mark
up.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current location.
InDesign CS Scripting Guide
Description:
AppleScript Reference
133
Method:
place
place xml
resize
134
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point at which
to place the file.
[destination layer]
layer or layer name as string
The layer on which
to place the file.
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
If true, convert
straight quotes
to typographer’s
quotes.
Name:
Type:
Description:
using
XML element
The element to place
into.
Name:
Type:
Description:
[horizontal scale]
fiuxed
The horizontal scaling percentage.
[vertical scale]
fixed
The vertical scaling
percentage.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
Method:
rotate
shear
store
Parameters:
Name:
Type:
Description:
by
number
Angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to rotate
around.
[considering current rotation]
boolean
If true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
If true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
If true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Name:
Type:
Description:
by
number
Angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to shear
around.
[considering current shear]
boolean
If true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
If true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
Return:
Description:
nothing
Rotate the page item.
nothing
Shear the page item.
asset
Store a page item in a library.
InDesign CS Scripting Guide
AppleScript Reference
135
Method:
unlink
136
Parameters:
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
EPS export preference
Properties
Property:
Type:
Access:
Description:
applied flattener
preset
flattener preset
read/write
The flattener preset
bleed bottom
fixed or measurement string
read/write
Bleed amount to add at the bottom of the
page.
bleed inside
fixed or measurement string
read/write
Bleed amount to add at the inside of the
page.
bleed outside
fixed or measurement string
read/write
Bleed amount to add at the outside of the
page.
bleed top
fixed or measurement string
read/write
Bleed amount to add at the top of the page.
class
type
read only
The class of the object.
data format
ASCII, binary
read/write
The data format (binary or ASCII) to use
when exporting an epss.
EPS color
RGB, CMYK, gray, unchanged color space
read/write
The color space to use when exporting
the epss.
EPS spreads
boolean
read/write
If true, export the pages in the page range
as spreads.
font embedding
none, complete, subset
read/write
The method used to embed fonts in the
exported epss.
ignore spread overrides
boolean
read/write
If true, ignore flattener spread overrides
for the exported epss.
image data
all image data, proxy image data
read/write
Control how much image data is exported
to the epss
object reference
EPS export preference
read only
An object reference to the object.
omit bitmaps
boolean
read/write
If true, omit bitmap images from the
exported epss. (If you choose to omit
images, InDesign still includes OPI link
information for the omitted images in the
epss.)
omit EPS
boolean
read/write
If true, omit epss graphics from the exported epss. (If you choose to omit epsss,
InDesign still includes OPI link information for the omitted graphics in the epss.)
omit PDF
boolean
read/write
If true, omit pdf graphics from the exported epss. (If you choose to omit pdfs,
InDesign still includes OPI link information for the omitted graphics in the epss.)
OPI image replacement
boolean
read/write
If true, use OPI image replacement.
page range
string or ‘all’
read/write
The range of pages to export.
parent
object
read only
The parent of the object.
PostScript level
level 2, level 3
read/write
The level of PostScript to send to the
printer.
preview
none, TIFF preview, PICT preview
read/write
The type of preview to save with the
exported epss.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
InDesign CS Scripting Guide
AppleScript Reference
137
EPS import preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
EPS frames
boolean
read/write
If true, create a frame from the epss clipping path as you import the epss.
EPS proxy
as needed, always
read/write
The type of proxy (preview image) created
when importing an epss graphic.
object reference
EPS import preference
read only
An object reference to the object.
OPI comments
boolean
read/write
If true, read OPI image link information
when importing an epss graphic.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
138
AppleScript Reference
InDesign CS Scripting Guide
excel import preference
Properties
Property:
Type:
Access:
Description:
alignment style
spreadsheet, left align, right align, center align
read/write
The alignment of text in the cells of the
imported Excel spreadsheet.
class
type
read only
The class of the object.
decimal places
integer
read/write
The number of decimal places.
error code
integer
read/write
The error code associated with the Excel
spreadsheet import. (0-Success 1-Empty
Sheet 2-Invalid sheet 3-Invalid range 4-Invalid View 5-Misc. Error).
object reference
excel import preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
range name
string
read/write
The name of selected range.
sheet index
integer
read/write
index of the selected sheet.
sheet name
string
read/write
The name of the selected sheet.
show hidden cells
boolean
read/write
If true, show hidden cells in the imported
spreadsheet.
table formatting
excel formatted table, excel unformatted table, excel unformatted tabbed text
read/write
Options for table Formatting
view name
string
read/write
The name of selected view.
InDesign CS Scripting Guide
AppleScript Reference
139
find preference
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
applied character
style
string
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
string
read/write
The paragraph style applied to the text.
auto leading
fixed
read/write
Percentage for calculating auto leading
balance ragged
lines
boolean
read/write
Whether to balance ragged lines
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
case sensitive
boolean
read/write
If true, then search only for text that
matches case
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
fill color
string
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The text override of the fill’s tint percentage (-1 indicates no override)
find text
string
read/write
The text to find
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
140
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed or measurement string or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
find preference
read only
An object reference to the object.
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
InDesign CS Scripting Guide
AppleScript Reference
141
Property:
Type:
Access:
Description:
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines with only one word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
Where to start the paragraph
strike through
color
swatch or string
read/write
The color of the strike through. Can
return: swatch or string.
strike through gap
color
swatch or string
read/write
The gap color of the strike through. Can
return: swatch or string.
strike through gap
overprint
boolean
read/write
Whether to overprint the gap of the strike
through
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through
strike through
overprint
boolean
read/write
Whether to overprint the strike through
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strike through
strike through
weight
fixed
read/write
The line weight of the strike through
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
string
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The text override of the stroke’s tint percentage (-1 indicates no override)
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color of the underline. Can return:
swatch or string.
underline gap color
swatch or string
read/write
The gap color of the underline. Can
return: swatch or string.
142
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
underline gap
overprint
boolean
read/write
Whether to overprint the gap of the
underline
underline gap tint
fixed
read/write
The gap tint of the underline
underline offset
fixed or measurement string
read/write
The offset of the underline
underline overprint
boolean
read/write
Whether to overprint the underline
underline tint
fixed
read/write
The tint of the underline
underline type
stroke style
read/write
The stroke type of the underline
underline weight
fixed
read/write
The line weight of the underline
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
whole word
boolean
read/write
If true, then disregard text embedded
within a larger word
InDesign CS Scripting Guide
AppleScript Reference
143
flattener preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
clip complex
regions
boolean
read/write
If true, clip rasterized areas of the page to
the objects which are actually rasterized.
convert all strokes
to outlines
boolean
read/write
Convert all strokes to outlines, not just
those involved with transparency
convert all text to
outlines
boolean
read/write
Convert all text to outlines, not just the
text involved with transparency
gradient and mesh
resolution
fixed
read/write
Resolution at which gradient and mesh are
rasterized, when necessary
line art and text
resolution
fixed
read/write
Resolution of transparency effects for line
art and text (drop shadows and feathering)
object reference
flattener preference
read only
An object reference to the object.
parent
spread
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
raster vector
balance
high, medium high, medium, medium low, or low
read/write
raster vector balance. Can return: low/medium low/medium/medium high/high or
fixed.
144
AppleScript Reference
InDesign CS Scripting Guide
flattener preset
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class descriptor type
clip complex
regions
boolean
read/write
Clip rasterized areas of the page to the
objects which are actually rasterized
convert all strokes
to outlines
boolean
read/write
Convert all strokes to outlines, not just
those involved with transparency
convert all text to
outlines
boolean
read/write
Convert all text to outlines, not just the
text involved with transparency
gradient and mesh
resolution
fixed
read/write
Resolution at which gradient and mesh are
rasterized, when necessary
id
integer
read only
The flattener preset’s unique id
index
integer
read only
index of the flattener preset within its parent application
label
string
read/write
A label that can be set to any string
line art and text
resolution
fixed
read/write
Resolution of transparency effects for line
art and text (drop shadows and feathering)
name
string
read/write
The name of the flattener preset
object reference
flattener preset
read only
An object reference for this flattener preset
parent
object
read only
The flattener preset’s parent
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
raster vector balance
high, medium high, medium, medium low, or low
read/write
raster vector balance. Can return: low/medium low/medium/medium high/high or
fixed.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
flattener
preset
Create a new flattener preset.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
AppleScript Reference
145
font
Properties
Property:
Type:
Access:
Description:
allow embedding
boolean
read only
If true, the font can be embedded.
allow outlines
boolean
read only
If true, the font allows the creation of
outlines from its character data.
allow PDF embedding
boolean
read only
If true, the font can be embedded in an
exported pdf.
allow printing
boolean
read only
If true, the font can be printed.
class
type
read only
The class of the object.
font family
string
read only
The name of the font family.
font style name
string
read only
The name of the font style.
font type
type 1, TrueType, CID, ATC, bitmap, OCF, OpenType CFF, OpenType CID,
OpenType TT
read only
The type of the font (TrueType, Type1,
etc.).
index
integer
read only
index of the font within its parent
document or application
location
string
read only
The location of the font file on disk, including the file name.
name
string
read only
The name of the font.
object reference
font
read only
An object reference to the object.
parent
object
read only
The parent of the object.
PostScript name
string
read only
The PostScript name of the font.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
restricted printing
boolean
read only
If true, printing of the font is restricted.
status
installed, not available, fauxed, substituted, unknown
read only
The status of the font.
Methods
Method:
check open type
feature
146
Parameters:
Name:
Type:
Description:
using
low, discretionary ligatures feature,
fractions feature, ordinal feature, swash
feature, titling feature, contextual
alternates feature, all small caps feature,
superscript feature, subscript feature,
numerator feature, denominator feature,
tabular linin
Which OpenType
feature to use.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
boolean
Check whether a font object
supports a specific open
type feature. Pass in either
one of the OpenTypeFeature
enumeration values or a string
with the 4 character code of the
feature.
form field
Elements
Element:
Refer to by:
behavior
index, name, range, relative, test, id
close window behavior
index, name, range, relative, test, id
goto anchor behavior
index, name, range, relative, test, id
goto first page behavior
index, name, range, relative, test, id
goto last page behavior
index, name, range, relative, test, id
goto next page behavior
index, name, range, relative, test, id
goto next view behavior
index, name, range, relative, test, id
goto previous page behavior
index, name, range, relative, test, id
goto previous view behavior
index, name, range, relative, test, id
goto URL behavior
index, name, range, relative, test, id
movie behavior
index, name, range, relative, test, id
open file behavior
index, name, range, relative, test, id
quit behavior
index, name, range, relative, test, id
show hide fields behavior
index, name, range, relative, test, id
sound behavior
index, name, range, relative, test, id
view zoom behavior
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items within this page
item, regardless of their position in the
object hierarchy (i.e., page items inside
groups or inside other page items will be
included).
appearance name
string
read only
Name of any appearance of field
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
corner effect
none, rounded corner, inverse rounded corner, inset corner, bevel corner,
fancy corner
read/write
The corner effect applied to the page item.
This property corresponds to the Effect
pop-up menu in the Corner Effects dialog
box.
InDesign CS Scripting Guide
AppleScript Reference
147
Property:
Type:
Access:
Description:
corner radius
fixed
read/write
The radius of the corner effect applied to
the page item. This property corresponds
to the Size field in the Corner Effects
dialog box.
description
string
read/write
Description
end cap
butt end cap, round end cap, projecting end cap
read/write
The appearance of the end points of an
open path. This property corresponds to
the End Cap options in the Stroke palette.
end join
miter end join, round end join, bevel end join
read/write
The appearance of the stroke at corner
points. This property corresponds to the
End Join options in the Stroke palette.
This property has no effect on smooth (or
“curve”) points on a path.
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the page item.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the page item (-1 indicates 100%, or no
override).
gap color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the gap of the stroke of the
page item.
gap tint
fixed
read/write
The tint percentage applied to the gap of
the stroke of the page item (-1 indicates
100%, or no override).
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
gradient fill angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient fill length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the fill of the page
item.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied to the fill of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
gradient stroke
angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient stroke
length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the stroke of the page
item.
148
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied
to the stroke of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the form field within its parent
spread, master spread, group, text frame,
story, text, character, word, line, text
column, paragraph, text style range, cell,
table, page, document, layer or insertion
point
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item layer
layer
read/write
The layer containing the page item.
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
left line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the first
(or “left) point of an open path.
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
locked
boolean
read/write
If true, the page item is locked.
miter limit
fixed
read/write
Defines the point at which a corner point
switches from a mitered (pointed) join to
a beveled (squared-off) join. If the width
of the stroke at a corner point would be
wider than this value times the stroke
weight, InDesign applies a beveled join to
the corner.
name
string
read/write
The name of the behavior.
nonprinting
boolean
read/write
If true, the page item is non-printing.
object reference
form field
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
overprint fill
boolean
read/write
If true, the fill of the page item will
overprint.
overprint gap
boolean
read/write
If true, overprint the gap color applied to
the stroke of the page item.
overprint stroke
boolean
read/write
If true, overprint the stroke of the page
item.
overridden
boolean
read only
If true, this page item originated on a
master spread and was later overridden
(i.e., copied to the document page). It is
still linked to the page item on the master
spread.
InDesign CS Scripting Guide
AppleScript Reference
149
Property:
Type:
Access:
Description:
overridden master
page item
page item
read only
A reference to the master page item linked
to the page item (if any).
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the last
(“right”) point of an open path.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
stroke alignment
center alignment, inside alignment, outside alignment
read/write
This property controls the way that the
stroke of a path is drawn relative to the
path, and corresponds to the Stroke Alginment options in the Stroke palette.
stroke color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the stroke of the page item.
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The method used to adjust the position
of dashes and gaps on a dashed stroke
around corner points on a path. This
property corresponds to the Corners popup menu in the Stroke palette (only visible
when a dashed stroke is selected).
stroke dash and
gap
list of fixed or measurement strings {dash, gap, ...}
read/write
The dash and gap settings of a dashed line.
A list of up to 6 values.
150
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
stroke tint
fixed
read/write
The tint percentage applied to the stroke
of the page item (-1 indicates 100%, or no
override).
stroke type
stroke style
read/write
The stroke type applied to the page item-either one of the default stroke types, or
the name of a custom stroke style.
stroke weight
fixed
read/write
The weight (in points) of the stroke applied to the page item.
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visibility in pdf
visible in pdf, hidden in pdf, visible but does not print in pdf, hidden but
printable in pdf
read/write
visibility of the item in the output pdf
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
add path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Return:
Description:
page item
Create a new shape by adding
the path(s) of this object with
the paths of other objects. This
method corresponds to the
Add path operation (Objects>P
athfinder>Add).
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
delete
None
nothing
Deletes the object.
duplicate
None
form field
Duplicates the object.
page item
Creates a new shape by excluding area of intersection of this
object with the other objects.
This method corresponds
to the Exclude Overlap path
operation (Objects>Pathfinder
>Exclude Overlap).
nothing
Exports the object to file.
string
Gets the label value associated with the given key (label
name).
exclude overlap
path
Name:
Type:
Description:
with
list of objects
The objects to
exclude.
export
Name:
Type:
Description:
format
string (name of export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
extract label
InDesign CS Scripting Guide
AppleScript Reference
151
Method:
fit
Parameters:
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
with
list of objects
The objects to intersect with.
make compound
path
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
markup
Name:
Type:
Description:
using
XML element
The element to mark
up.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
Name:
Type:
Description:
destination page
page
The page on which
to override the master page item.
insert label
intersect path
minus back
move
override
152
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Fit content within a graphic
frame.
nothing
Sets the string associated with
the given key (label name).
page item
Create a new shape based on
the area of intersection of this
object and other objects. This
method corresponds to the
Intersect path operation (Objec
ts>Pathfinder>Intersect).
page item
Create a compound path by
adding the paths of this object
to the paths of other objects.
This method corresponds
to the Object>Compound
paths>Make command.
nothing
Markup layout content with
XML preserving the existing
content.
page item
Create a new shape by reverse
subtracting this object from
other objects. This method
corresponds to the Minus Back
path operation (Objects>Pathfi
nder>Minus Back).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
page item
Overrides an item from the
master page and places it on
the page.
Method:
place
place xml
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
Name:
Type:
Description:
using
XML element
The element to place
into.
Return:
Description:
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
release compound
path
None
objects
release compound path.
remove override
None
nothing
Removes a locally overriden
master page item
reset scaling
None
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
InDesign CS Scripting Guide
AppleScript Reference
153
Method:
resize
rotate
select
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to rotate
around, either one
of the enums or an
x,y value.
[considering current rotation]
boolean
if true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
if true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
if true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
nothing
Select this form field.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
154
AppleScript Reference
InDesign CS Scripting Guide
Method:
shear
store
subtract path
unlink
Parameters:
Name:
Type:
Description:
by
number
angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to shear
around, either one
of the enums or an
x,y value.
[considering current shear]
boolean
if true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
if true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
if true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
Return:
Description:
nothing
Shear the page item.
asset
Store a page item in a library.
page item
Create a new shape by subtracting the area of intersection of
this object and other objects
from the other objects. This
method corresponds to the
Subtract path operation (Objec
ts>Pathfinder>Subtract).
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
InDesign CS Scripting Guide
AppleScript Reference
155
galley preference
Properties
Property:
Type:
Access:
Description:
background color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The background color of the story Editor.
This property corresponds to the Background pop-up menu in the story Editor
Display panel of the Preferences dialog
box.
blink cursor
boolean
read/write
If true, the story Editor cursor will blink.
This property corresponds to the Blink
option in the story Editor Display panel of
the Preferences dialog box.
class
type
read only
The class of the object.
cursor type
standard cursor, thick cursor, barbell cursor, block cursor
read/write
Sets the type of cursor should be used in
galley and story views.
object reference
galley preference
read only
An object reference to the object.
override preview
font
string
read/write
The font to use for displaying text in the
story Editor.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
smooth text
boolean
read/write
If true, antialias text displayed in the story
Editor. this property corresponds to the
Enable Anti-Aliasing option in the story
Editor Display panel of the Preferences
dialog box.
text color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of text displayed in the story
Editor. This property corresponds to the
text color pop-up menu in the story Editor
Display panel of the Preferences dialog
box.
use override preview font
boolean
read/write
If true, use the font specified in the override preview font property.
156
AppleScript Reference
InDesign CS Scripting Guide
general preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
complete font
download glyph
limit
integer
read/write
Complete font download glyph limit
include preview
boolean
read/write
Whether to include a preview when saving
the document
object reference
general preference
read only
An object reference to the object.
page numbering
section, absolute
read/write
How to number pages
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
temporary folder
file reference or file name as string
read/write
Where temporary files should be stored
tool tips
normal, none, fast
read/write
Controls the appearance of tool tips
tools palette
single column, double column, single row
read/write
Controls the appearance of the tools
palette
InDesign CS Scripting Guide
AppleScript Reference
157
goto anchor behavior
Properties
Property:
Type:
Access:
Description:
anchor item
hyperlink
read/write
The anchor item
anchor name
string
read only
The anchor name
class
type
read only
The class descriptor type
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
file path
file reference or file name as string
read/write
The file path
id
integer
read only
The goto anchor behavior’s unique id
index
integer
read only
index of the goto anchor behavior within
its parent form field or button
label
string
read/write
A label that can be set to any string
name
string
read only
The name of the goto anchor behavior
object reference
goto anchor behavior
read only
An object reference for this goto anchor
behavior
parent
object
read only
The goto anchor behavior’s parent. Can
return: form field or button.
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
zoom setting
inherit zoom, fit window, fit width, fit visible, actual size
read/write
The zoom setting
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
goto anchor
behavior
Create a new goto anchor
behavior.
extract label
insert label
make
158
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
AppleScript Reference
InDesign CS Scripting Guide
Description:
goto first page behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the goto first page behavior
within its parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the behavior.
object reference
goto first page behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
zoom setting
inherit zoom, fit window, fit width, fit visible, actual size
read/write
The zoom setting
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
goto first page
behavior
Create a new goto first page
behavior.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
Description:
AppleScript Reference
159
goto last page behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the goto last page behavior within
its parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the behavior.
object reference
goto last page behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
zoom setting
inherit zoom, fit window, fit width, fit visible, actual size
read/write
The zoom setting
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
goto last page
behavior
Create a new goto last page
behavior.
extract label
insert label
make
160
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
AppleScript Reference
InDesign CS Scripting Guide
Description:
goto next page behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the goto next page behavior
within its parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the behavior.
object reference
goto next page behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
zoom setting
inherit zoom, fit window, fit width, fit visible, actual size
read/write
The zoom setting
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
goto next page
behavior
Create a new goto next page
behavior.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
Description:
AppleScript Reference
161
goto next view behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the goto next view behavior
within its parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the behavior.
object reference
goto next view behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
zoom setting
inherit zoom, fit window, fit width, fit visible, actual size
read/write
The zoom setting
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
goto next view
behavior
Create a new goto next view
behavior.
extract label
insert label
make
162
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
AppleScript Reference
InDesign CS Scripting Guide
Description:
goto previous page behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the goto previous page behavior
within its parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the behavior.
object reference
goto previous page behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
zoom setting
inherit zoom, fit window, fit width, fit visible, actual size
read/write
The zoom setting
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
goto previous
page behavior
Create a new goto previous
page behavior.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
Description:
AppleScript Reference
163
goto previous view behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the goto previous view behavior
within its parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the behavior.
object reference
goto previous view behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
zoom setting
inherit zoom, fit window, fit width, fit visible, actual size
read/write
The zoom setting
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
goto previous
view behavior
Create a new goto previous
view behavior.
extract label
insert label
make
164
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
AppleScript Reference
InDesign CS Scripting Guide
Description:
goto URL behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the goto URL behavior within its
parent form field or button
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read only
The name of the XML tag
object reference
goto URL behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
URL
string
read/write
The URL
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
goto url
behavior
Create a new goto url behavior.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
Description:
AppleScript Reference
165
gradient
Elements
Element:
Refer to by:
gradient stop
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the gradient within its parent
application or document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the gradient swatch.
object reference
gradient
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
type
linear, radial
read/write
The type of the gradient.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
gradient
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
gradient
Create a new gradient.
nothing
Merge one or more other
swatches into this one.
extract label
insert label
make
merge
166
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
Name:
Type:
Description:
with
gradient
The swatches to
merge.
AppleScript Reference
InDesign CS Scripting Guide
gradient stop
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
index
integer
read only
index of the gradient stop within its parent gradient
location
fixed
read/write
The location of the gradient stop, as a percentage of the length of the gradient ramp.
midpoint
fixed
read/write
The mid-point of the gradient stop, as
a percentage of the distance from the
gradient stop to the next gradient stop.
object reference
gradient stop
read only
An object reference to the object.
parent
gradient
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
stop color
color
read/write
The color of the gradient stop.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
make
None
gradient stop
Create a new gradient stop.
InDesign CS Scripting Guide
AppleScript Reference
167
graphic
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scale of the page item relative to its containing page item
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item
absolute vertical
scale
fixed
read/write
The vertical scale of the page item relative
to its containing page item
class
type
read only
The class descriptor type
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding
the stroke width, in the format (top, left,
bottom, right)
horizontal scale
fixed
read/write
The horizontal scaling percentage.
id
integer
read only
The graphic’s unique id
image type name
string
read only
The type of image
index
integer
read only
index of the graphic within its parent page
item, oval, rectangle, polygon, graphic
line, state, group or button
item link
link
read only
link to a placed file
label
string
read/write
A label that can be set to any string
local display setting
high quality, typical, optimized, default
read/write
The display settings for this page item
object reference
graphic
read only
An object reference for this graphic
parent
object
read only
The graphic’s parent. Can return: page
item, oval, rectangle, polygon, graphic
line, state, group or button.
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
rotation angle
fixed
read/write
Angle of rotation
shear angle
fixed
read/write
The shear angle of the page item relative to
the spread
vertical scale
fixed
read/write
The vertical scaling percentage.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width, in the format (top, left,
bottom, right)
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
168
AppleScript Reference
InDesign CS Scripting Guide
Method:
export
extract label
insert label
move
place
Parameters:
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current location.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point at which
to place the file.
[destination layer]
layer or layer name as string
The layer on which
to place the file.
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
If true, convert
straight quotes
to typographer’s
quotes.
Return:
Description:
nothing
Export the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
object
Place a file.
InDesign CS Scripting Guide
AppleScript Reference
169
Method:
resize
rotate
170
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The horizontal scaling percentage.
[vertical scale]
fixed
The vertical scaling
percentage.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
Angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to rotate
around.
[considering current rotation]
boolean
If true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
If true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
If true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
Method:
shear
unlink
Parameters:
Name:
Type:
Description:
by
number
Angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to shear
around.
[considering current shear]
boolean
If true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
If true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
Return:
Description:
nothing
Shear the page item.
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
InDesign CS Scripting Guide
AppleScript Reference
171
graphic line
Elements
Element:
Refer to by:
EPS
index, name, range, relative, test, id
graphic
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
image
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
path
index, name, range, relative, test
PDF
index, name, range, relative, test, id
PICT
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
text path
index, name, range, relative, test, id
WMF
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items within this page
item, regardless of their position in the
object hierarchy (i.e., page items inside
groups or inside other page items will be
included).
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
content type
unassigned, graphic type, text type
read/write
The type of content
corner effect
none, rounded corner, inverse rounded corner, inset corner, bevel corner,
fancy corner
read/write
The corner effect applied to the page item.
This property corresponds to the Effect
pop-up menu in the Corner Effects dialog
box.
corner radius
fixed
read/write
The radius of the corner effect applied to
the page item. This property corresponds
to the Size field in the Corner Effects
dialog box.
172
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
end cap
butt end cap, round end cap, projecting end cap
read/write
The appearance of the end points of an
open path. This property corresponds to
the End Cap options in the Stroke palette.
end join
miter end join, round end join, bevel end join
read/write
The appearance of the stroke at corner
points. This property corresponds to the
End Join options in the Stroke palette.
This property has no effect on smooth (or
“curve”) points on a path.
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the page item.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the page item (-1 indicates 100%, or no
override).
gap color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the gap of the stroke of the
page item.
gap tint
fixed
read/write
The tint percentage applied to the gap of
the stroke of the page item (-1 indicates
100%, or no override).
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
gradient fill angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient fill length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the fill of the page
item.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied to the fill of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
gradient stroke
angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient stroke
length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the stroke of the page
item.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied
to the stroke of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
InDesign CS Scripting Guide
AppleScript Reference
173
Property:
Type:
Access:
Description:
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the graphic line within its parent
spread, master spread, page item, oval,
rectangle, polygon, graphic line, group,
state, document, layer, page, button, text
frame, story, text, character, word, line,
text column, paragraph, text style range,...
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item layer
layer
read/write
The layer containing the page item.
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
left line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the first
(or “left) point of an open path.
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
locked
boolean
read/write
If true, the page item is locked.
miter limit
fixed
read/write
Defines the point at which a corner point
switches from a mitered (pointed) join to
a beveled (squared-off) join. If the width
of the stroke at a corner point would be
wider than this value times the stroke
weight, InDesign applies a beveled join to
the corner.
nonprinting
boolean
read/write
If true, the page item is non-printing.
object reference
graphic line
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
overprint fill
boolean
read/write
If true, the fill of the page item will
overprint.
overprint gap
boolean
read/write
If true, overprint the gap color applied to
the stroke of the page item.
overprint stroke
boolean
read/write
If true, overprint the stroke of the page
item.
overridden
boolean
read only
If true, this page item originated on a
master spread and was later overridden
(i.e., copied to the document page). It is
still linked to the page item on the master
spread.
overridden master
page item
page item
read only
A reference to the master page item linked
to the page item (if any).
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
174
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
right line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the last
(“right”) point of an open path.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
stroke alignment
center alignment, inside alignment, outside alignment
read/write
This property controls the way that the
stroke of a path is drawn relative to the
path, and corresponds to the Stroke Alginment options in the Stroke palette.
stroke color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the stroke of the page item.
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The method used to adjust the position
of dashes and gaps on a dashed stroke
around corner points on a path. This
property corresponds to the Corners popup menu in the Stroke palette (only visible
when a dashed stroke is selected).
stroke dash and
gap
list of fixed or measurement strings {dash, gap, ...}
read/write
The dash and gap settings of a dashed line.
A list of up to 6 values.
stroke tint
fixed
read/write
The tint percentage applied to the stroke
of the page item (-1 indicates 100%, or no
override).
stroke type
stroke style
read/write
The stroke type applied to the page item-either one of the default stroke types, or
the name of a custom stroke style.
InDesign CS Scripting Guide
AppleScript Reference
175
Property:
Type:
Access:
Description:
stroke weight
fixed
read/write
The weight (in points) of the stroke applied to the page item.
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
add path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Return:
Description:
page item
Create a new shape by adding
the path(s) of this object with
the paths of other objects. This
method corresponds to the
Add path operation (Objects>P
athfinder>Add).
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
delete
None
nothing
Deletes the object.
duplicate
None
graphic line
Duplicates the object.
page item
Creates a new shape by excluding area of intersection of this
object with the other objects.
This method corresponds
to the Exclude Overlap path
operation (Objects>Pathfinder
>Exclude Overlap).
nothing
Exports the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Fit content within a graphic
frame.
nothing
Sets the string associated with
the given key (label name).
exclude overlap
path
Name:
Type:
Description:
with
list of objects
The objects to
exclude.
export
Name:
Type:
Description:
format
string (name of export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
extract label
fit
insert label
176
AppleScript Reference
InDesign CS Scripting Guide
Method:
intersect path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to intersect with.
Name:
Type:
Description:
[layer]
layer or layer name as string
The layer on which
to create the
graphicline as layer.
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after this
graphicline or at
the beginning/end
of this document,
spread, Master
spread, page or
layer as document,
spread, master
spread, page or
layer.
make compound
path
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
markup
Name:
Type:
Description:
using
XML element
The element to mark
up.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
Name:
Type:
Description:
destination page
page
The page on which
to override the master page item.
make
minus back
move
override
Return:
Description:
page item
Create a new shape based on
the area of intersection of this
object and other objects. This
method corresponds to the
Intersect path operation (Objec
ts>Pathfinder>Intersect).
graphic line
Create a new graphic line.
page item
Create a compound path by
adding the paths of this object
to the paths of other objects.
This method corresponds
to the Object>Compound
paths>Make command.
nothing
Markup layout content with
XML preserving the existing
content.
page item
Create a new shape by reverse
subtracting this object from
other objects. This method
corresponds to the Minus Back
path operation (Objects>Pathfi
nder>Minus Back).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
page item
Overrides an item from the
master page and places it on
the page.
InDesign CS Scripting Guide
AppleScript Reference
177
Method:
place
place xml
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
Name:
Type:
Description:
using
XML element
The element to place
into.
Return:
Description:
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
release compound
path
None
objects
release compound path.
remove override
None
nothing
Removes a locally overriden
master page item
reset scaling
None
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
178
AppleScript Reference
InDesign CS Scripting Guide
Method:
resize
rotate
select
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to rotate
around, either one
of the enums or an
x,y value.
[considering current rotation]
boolean
if true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
if true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
if true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
nothing
Select this graphic line.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
InDesign CS Scripting Guide
AppleScript Reference
179
Method:
shear
store
subtract path
unlink
180
Parameters:
Name:
Type:
Description:
by
number
angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to shear
around, either one
of the enums or an
x,y value.
[considering current shear]
boolean
if true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
if true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
if true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Shear the page item.
asset
Store a page item in a library.
page item
Create a new shape by subtracting the area of intersection of
this object and other objects
from the other objects. This
method corresponds to the
Subtract path operation (Objec
ts>Pathfinder>Subtract).
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
grid preference
Properties
Property:
Type:
Access:
Description:
baseline color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of the baseline grid.
baseline division
fixed
read/write
The distance between baseline grid lines.
baseline grid
shown
boolean
read/write
If true, display the baseline grid.
baseline start
fixed
read/write
The distance from the top of the page to
the first increment of the baseline grid.
baseline view
threshold
fixed
read/write
Sets the threshold (as a magnification
percentage) at which the baseline grid will
appear. If this property is set to 75%, the
baseline grid will appear at all magnifications greater than or equal to 75% (100%,
200%, etc.), but will not be visible at
magnifications less than 75%.
class
type
read only
The class of the object.
document grid
shown
boolean
read/write
If true, display the document grid.
document grid
snapto
boolean
read/write
If true, object edges snap to the nearest
document grid intersection when drawing, moving or resizing objects on a page.
grid color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of the document grid.
grids in back
boolean
read/write
If true, to display grids behind all other
objects.
horizontal grid
subdivision
integer
read/write
The number of evenly spaced minor horizontal document grid lines between major
horizontal document grid lines.
horizontal gridline
division
fixed
read/write
A spacing value between major horizontal
document grid lines.
object reference
grid preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
vertical grid subdivision
integer
read/write
The number of evenly spaced minor vertical document grid lines between major
vertical document grid lines.
vertical gridline
division
fixed
read/write
The distance between major vertical
document grid lines.
InDesign CS Scripting Guide
AppleScript Reference
181
group
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
EPS
index, name, range, relative, test, id
form field
index, name, range, relative, test, id
graphic
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
image
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
PDF
index, name, range, relative, test, id
PICT
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
WMF
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items within this page
item, regardless of their position in the
object hierarchy (i.e., page items inside
groups or inside other page items will be
included).
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
corner effect
none, rounded corner, inverse rounded corner, inset corner, bevel corner,
fancy corner
read/write
The corner effect applied to the page item.
This property corresponds to the Effect
pop-up menu in the Corner Effects dialog
box.
corner radius
fixed
read/write
The radius of the corner effect applied to
the page item. This property corresponds
to the Size field in the Corner Effects
dialog box.
182
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
end cap
butt end cap, round end cap, projecting end cap
read/write
The appearance of the end points of an
open path. This property corresponds to
the End Cap options in the Stroke palette.
end join
miter end join, round end join, bevel end join
read/write
The appearance of the stroke at corner
points. This property corresponds to the
End Join options in the Stroke palette.
This property has no effect on smooth (or
“curve”) points on a path.
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the page item.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the page item (-1 indicates 100%, or no
override).
gap color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the gap of the stroke of the
page item.
gap tint
fixed
read/write
The tint percentage applied to the gap of
the stroke of the page item (-1 indicates
100%, or no override).
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
gradient fill angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient fill length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the fill of the page
item.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied to the fill of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
gradient stroke
angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient stroke
length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the stroke of the page
item.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied
to the stroke of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
InDesign CS Scripting Guide
AppleScript Reference
183
Property:
Type:
Access:
Description:
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the group within its parent
spread, master spread, page item, oval,
rectangle, polygon, graphic line, group,
state, document, layer, page, button, text
frame, story, text, character, word, line,
text column, paragraph, text style range,
cell, ...
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item layer
layer
read/write
The layer containing the page item.
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
left line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the first
(or “left) point of an open path.
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
locked
boolean
read/write
If true, the page item is locked.
miter limit
fixed
read/write
Defines the point at which a corner point
switches from a mitered (pointed) join to
a beveled (squared-off) join. If the width
of the stroke at a corner point would be
wider than this value times the stroke
weight, InDesign applies a beveled join to
the corner.
nonprinting
boolean
read/write
If true, the page item is non-printing.
object reference
group
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
overprint fill
boolean
read/write
If true, the fill of the page item will
overprint.
overprint gap
boolean
read/write
If true, overprint the gap color applied to
the stroke of the page item.
overprint stroke
boolean
read/write
If true, overprint the stroke of the page
item.
overridden
boolean
read only
If true, this page item originated on a
master spread and was later overridden
(i.e., copied to the document page). It is
still linked to the page item on the master
spread.
overridden master
page item
page item
read only
A reference to the master page item linked
to the page item (if any).
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
184
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
right line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the last
(“right”) point of an open path.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
stroke alignment
center alignment, inside alignment, outside alignment
read/write
This property controls the way that the
stroke of a path is drawn relative to the
path, and corresponds to the Stroke Alginment options in the Stroke palette.
stroke color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the stroke of the page item.
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The method used to adjust the position
of dashes and gaps on a dashed stroke
around corner points on a path. This
property corresponds to the Corners popup menu in the Stroke palette (only visible
when a dashed stroke is selected).
stroke dash and
gap
list of fixed or measurement strings {dash, gap, ...}
read/write
The dash and gap settings of a dashed line.
A list of up to 6 values.
stroke tint
fixed
read/write
The tint percentage applied to the stroke
of the page item (-1 indicates 100%, or no
override).
stroke type
stroke style
read/write
The stroke type applied to the page item-either one of the default stroke types, or
the name of a custom stroke style.
InDesign CS Scripting Guide
AppleScript Reference
185
Property:
Type:
Access:
Description:
stroke weight
fixed
read/write
The weight (in points) of the stroke applied to the page item.
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
add path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Return:
Description:
page item
Create a new shape by adding
the path(s) of this object with
the paths of other objects. This
method corresponds to the
Add path operation (Objects>P
athfinder>Add).
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
page item
Creates a new shape by excluding area of intersection of this
object with the other objects.
This method corresponds
to the Exclude Overlap path
operation (Objects>Pathfinder
>Exclude Overlap).
nothing
Exports the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Fit content within a graphic
frame.
nothing
Sets the string associated with
the given key (label name).
exclude overlap
path
Name:
Type:
Description:
with
list of objects
The objects to
exclude.
export
Name:
Type:
Description:
format
string (name of export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
extract label
fit
insert label
186
AppleScript Reference
InDesign CS Scripting Guide
Method:
intersect path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to intersect with.
Name:
Type:
Description:
group items
list of objects
A list of page items
to group.
[layer]
layer or layer name as string
The layer on which
to create the group
as layer.
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after this
group or at the beginning/end of this
document, spread,
Master spread,
page or layer as
document, spread,
master spread, page
or layer.
make compound
path
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
markup
Name:
Type:
Description:
using
XML element
The element to mark
up.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
Name:
Type:
Description:
destination page
page
The page on which
to override the master page item.
make
minus back
move
override
Return:
Description:
page item
Create a new shape based on
the area of intersection of this
object and other objects. This
method corresponds to the
Intersect path operation (Objec
ts>Pathfinder>Intersect).
group
Create a new group.
Group items are added in a
“with properties” statement, as
in (“myRectangle” and “myOval” are references to existing
objects):
set myGroup to make group
with properties{group
items:{myRectangle, myOval}}
page item
Create a compound path by
adding the paths of this object
to the paths of other objects.
This method corresponds
to the Object>Compound
paths>Make command.
nothing
Markup layout content with
XML preserving the existing
content.
page item
Create a new shape by reverse
subtracting this object from
other objects. This method
corresponds to the Minus Back
path operation (Objects>Pathfi
nder>Minus Back).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
page item
Overrides an item from the
master page and places it on
the page.
InDesign CS Scripting Guide
AppleScript Reference
187
Method:
place
place xml
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
Name:
Type:
Description:
using
XML element
The element to place
into.
Return:
Description:
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
release compound
path
None
objects
release compound path.
remove override
None
nothing
Removes a locally overriden
master page item
reset scaling
None
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
188
AppleScript Reference
InDesign CS Scripting Guide
Method:
resize
rotate
select
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to rotate
around, either one
of the enums or an
x,y value.
[considering current rotation]
boolean
if true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
if true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
if true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
nothing
Select this group.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
InDesign CS Scripting Guide
AppleScript Reference
189
Method:
shear
store
subtract path
Parameters:
Name:
Type:
Description:
by
number
angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to shear
around, either one
of the enums or an
x,y value.
[considering current shear]
boolean
if true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
if true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
if true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Return:
Description:
nothing
Shear the page item.
asset
Store a page item in a library.
page item
Create a new shape by subtracting the area of intersection of
this object and other objects
from the other objects. This
method corresponds to the
Subtract path operation (Objec
ts>Pathfinder>Subtract).
Move a group’s transform to its
children
transform group
contents
None
nothing
ungroup
None
nothing
Ungroups a grouped page item
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
unlink
190
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
guide
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
fit to page
boolean
read/write
If true, the guide is limited to the page, if
false, the guide extends across the spread.
guide color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of the guide.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the guide within its parent
spread, master spread, document, layer
or page
item layer
layer
read/write
The layer containing the guide.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
location
fixed or measurement string
read/write
The location of the guide, in current page
coordinates.
locked
boolean
read/write
If true, the guide is locked.
object reference
guide
read only
An object reference to the object.
orientation
horizontal, vertical
read/write
The orientation of the guide.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
view threshold
fixed
read/write
Sets the threshold (as a magnification percentage) at which the guide will appear. If
this property is set to 75%, the guide will
appear at all magnifications greater than
or equal to 75% (100%, 200%, etc.), but
will not be visible at magnifications less
than 75%.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
guide
Create a new guide.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[layer]
layer or layer name as string
The layer on which
to create the guide
as layer.
InDesign CS Scripting Guide
Description:
AppleScript Reference
191
Method:
override
remove override
select
192
Parameters:
Name:
Type:
Description:
destination page
page
The page on which
to override the master page item.
None
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
page item
Overrides an item from the
master page and places it on
the page.
nothing
Removes a locally overriden
master page item
nothing
Select this guide.
guide preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
guides in back
boolean
read/write
If true, display guides behind all other
objects.
guides locked
boolean
read/write
If true, guides are locked.
guides shown
boolean
read/write
If true, all types of guides are displayed.
guides snapto
boolean
read/write
If true, object edges snap to the nearest
guide when drawing, moving or resizing
an object.
object reference
guide preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
ruler guides color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of ruler guides.
ruler guides view
threshold
fixed
read/write
Sets the default threshold (as a magnification percentage) at which the guides will
appear. If this property is set to 75%, the
guides will appear at all magnifications
greater than or equal to 75% (100%, 200%,
etc.), but will not be visible at magnifications less than 75%. This property can be
changed for individual guides.
InDesign CS Scripting Guide
AppleScript Reference
193
hyperlink
Properties
Property:
Type:
Access:
Description:
border color
list of numbers {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The border color of the hyperlink.
border style
solid, dashed
read/write
The border style of the hyperlink.
class
type
read only
The class of the object.
destination
object
read/write
The destination of the hyperlink.
hidden
boolean
read only
If true, the hyperlink will be hidden in the
exported version of the document.
highlight
none, invert, outline, inset
read/write
The appearance of the hyperlink’s highlight.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the hyperlink within its parent
document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the hyperlink.
object reference
hyperlink
read only
An object reference to the object.
parent
document
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
source
object
read/write
The source of this hyperlink.
visible
boolean
read/write
If true, the hyperlink is visible.
width
thin, medium, thick
read/write
The border width of the hyperlink.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
hyperlink
Create a new hyperlink.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
hyperlink source
hyperlink source
The hyperlink
source.
[hyperlink destination]
hyperlink destination
The hyperlink destination.
show destination
None
nothing
Go to Hyperlink destination
show source
None
nothing
Go to Hyperlink source
194
AppleScript Reference
InDesign CS Scripting Guide
hyperlink external page destination
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
destination page
index
integer
read/write
The index of the page this destination
points to.
document path
string
read/write
The path to the document this destination
points to.
hidden
boolean
read only
If true, the hyperlink external page
destination will be hidden in the exported
version of the document.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the hyperlink external page destination within its parent document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read only
The name of the hyperlink external page
destination.
object reference
hyperlink external page destination
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
view bounds
list of fixed or measurement strings {top, left, bottom, right}
read/write
The view rectangle (ignored unless view
setting is fixed) of the hyperlink external
page destination.
view percentage
fixed
read/write
The zoom percentage (ignored unless view
setting is fixed).
view setting
fixed, fit view, fit window, fit width, fit height, fit visible, inherit zoom
read/write
The view setting for the target page.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
hyperlink
external page
destination
Create a new hyperlink external page destination.
nothing
Go to Hyperlink destination
extract label
insert label
make
show destination
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[destination]
hyperlink destination
The destination page
as page.
None
InDesign CS Scripting Guide
AppleScript Reference
195
hyperlink page destination
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
destination page
page
read/write
The page this destination points to.
hidden
boolean
read only
If true, the hyperlink page destination will
be hidden in the exported version of the
document.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the hyperlink page destination
within its parent document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the hyperlink page destination.
name manually
boolean
read/write
If true, use a user supplied name for the
destination.
object reference
hyperlink page destination
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
view bounds
list of fixed or measurement strings as {top, left, bottom, right}
read/write
The view rectangle (ignored unless view
setting is fixed) of the hyperlink page
destination.
view percentage
fixed
read/write
The zoom percentage (ignored unless view
setting is fixed).
view setting
fixed, fit view, fit window, fit width, fit height, fit visible, inherit zoom
read/write
The view setting for the target page.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
hyperlink
page destination
Create a new hyperlink page
destination.
nothing
Go to Hyperlink destination
extract label
insert label
make
show destination
196
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[destination]
page
The destination page
as page.
None
AppleScript Reference
InDesign CS Scripting Guide
Description:
hyperlink page item source
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
hidden
boolean
read only
If true, the hyperlink page item source
will be hidden in the exported version of
the document.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the hyperlink page item source
within its parent document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the hyperlink page item
source.
object reference
hyperlink page item source
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
source page item
page item
read/write
The page item this source resides on
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
hyperlink
page item
source
Create a new hyperlink page
item source.
nothing
Go to Hyperlink source
extract label
insert label
make
show source
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
source
page item
The source page
item.
None
InDesign CS Scripting Guide
AppleScript Reference
197
hyperlink text destination
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
destination text
insertion point
read/write
The insertion point this destination points
to.
hidden
boolean
read only
If true, the hyperlink text destination will
be hidden in the exported version of the
document.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the hyperlink text destination
within its parent document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the hyperlink text destination.
object reference
hyperlink text destination
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
hyperlink text
destination
Create a new hyperlink text
destination.
nothing
Go to Hyperlink destination
extract label
insert label
make
show destination
198
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
destination
text
The destination text.
None
AppleScript Reference
InDesign CS Scripting Guide
Description:
hyperlink text source
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
hidden
boolean
read only
If true, the hyperlink text source will be
hidden in the exported version of the
document.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the hyperlink text source within
its parent document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the hyperlink text source.
object reference
hyperlink text source
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
source text
text
read/write
The text in which this hyperlink text
source is located.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
hyperlink text
source
Create a new hyperlink text
source.
nothing
Go to hyperlink source
extract label
insert label
make
show source
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
source
text
The source text.
None
InDesign CS Scripting Guide
AppleScript Reference
199
hyperlink URL destination
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
destination URL
string
read/write
The URL this destination points to.
hidden
boolean
read only
If true, the hyperlink url destination will
be hidden in the exported version of the
document.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the hyperlink URL destination
within its parent document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the hyperlink url destination.
object reference
hyperlink URL destination
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
hyperlink url
destination
Create a new hyperlink text
destination.
nothing
Go to Hyperlink destination
extract label
insert label
make
show destination
200
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[destination]
string
The destination
URL as string.
None
AppleScript Reference
InDesign CS Scripting Guide
Description:
hyphenation exception
Properties
Property:
Type:
Access:
Description:
added exceptions
list of string
read/write
Hyphenation exceptions in the document.
class
type
read only
The class of the object.
index
integer
read only
index of the hyphenation exception within
its parent document
name
string
read only
The name of the object.
object reference
hyphenation exception
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
removed exceptions
list of strings
read/write
Excluded words in the document.
Methods
Method:
add exception
remove exception
Parameters:
Name:
Type:
Description:
added exceptions
list of strings
The list of exceptions to add to the
document.
[removed list]
boolean
If true, modify the
‘removed exceptions’ list, the ‘added
exceptions’ list is
modified by default.
Name:
Type:
Description:
removed exceptions
list of strings
The list of exceptions to remove
from document.
[removed list]
boolean
If true, modify the
‘removed exceptions’ list, the ‘added
exceptions’ list is
modified by default.
Return:
Description:
nothing
Add an exception to the
document.
nothing
Remove an exception from the
document.
InDesign CS Scripting Guide
AppleScript Reference
201
image
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
actual ppi
list of fixed {horizontal ppi, vertical ppi}
read only
The resolution of the native graphic file
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
clipping path
clipping path settings
read only
The clipping path settings
effective ppi
list of fixed {horizontal ppi, vertical ppi}
read only
The resolution of the graphic after it has
been resized
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the page item.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the page item (-1 indicates 100%, or no
override).
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
image IO preferences
image IO preference
read only
image IO preferences
image rendering
intent
use color settings, perceptual, saturation, relative colorimetric, absolute
colorimetric
read/write
The rendering intent applied to the image
image type name
string
read only
The type of image
202
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
index
integer
read only
index of the image within its parent XML
element, sound, movie, page item, oval,
rectangle, polygon, graphic line, state,
group or button
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item link
link
read only
link to a placed file
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
nonprinting
boolean
read/write
Whether the page item is non-printing
object reference
image
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
overprint fill
boolean
read/write
If true, the fill of the page item will
overprint.
parent
object
read only
The parent of the page item.
profile
string
read/write
The color profile to use. Either one the
idProfile enumerations or a profile name
profile list
list of string
read only
The list of available RGB profiles
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
InDesign CS Scripting Guide
AppleScript Reference
203
Property:
Type:
Access:
Description:
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
space
string
read only
The color space
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
Parameters:
delete
None
export
extract label
insert label
markup
move
204
Return:
Name:
Type:
Description:
format
string (name of export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
using
XML element
The element to mark
up.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
AppleScript Reference
InDesign CS Scripting Guide
Description:
nothing
Deletes the object.
nothing
Exports the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
nothing
Markup layout content with
XML preserving the existing
content.
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
Method:
place
place xml
resize
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
Name:
Type:
Description:
using
XML element
The element to place
into.
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Return:
Description:
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
InDesign CS Scripting Guide
AppleScript Reference
205
Method:
rotate
shear
store
206
Parameters:
Name:
Type:
Description:
by
number
angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to rotate
around, either one
of the enums or an
x,y value.
[considering current rotation]
boolean
if true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
if true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
if true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Name:
Type:
Description:
by
number
angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to shear
around, either one
of the enums or an
x,y value.
[considering current shear]
boolean
if true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
if true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
if true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Rotate the page item.
nothing
Shear the page item.
asset
Store a page item in a library.
Method:
unlink
Parameters:
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
Return:
Description:
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
InDesign CS Scripting Guide
AppleScript Reference
207
image IO preference
Properties
Property:
Type:
Access:
Description:
allow auto embedding
boolean
read/write
If true, allow automatic embedding.
alpha channel
name
string
read/write
Alpha channel name.
class
type
read only
The class of the object.
create clipping
frame
boolean
read/write
If true, create a frame from the image clipping path as you import the image.
object reference
image IO preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
preview resolution
integer
read only
The resolution of the image preview, in
pixels per inch.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
208
AppleScript Reference
InDesign CS Scripting Guide
IME preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
inline input
boolean
read/write
If true, use the inline text input methods;
if false, use the bottom window text input
method.
object reference
IME preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
InDesign CS Scripting Guide
AppleScript Reference
209
index
Elements
Element:
Refer to by:
topic
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the index within its parent
document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the XML tag
object reference
index
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
capitalize
extract label
generate
import topics
insert label
210
Parameters:
Name:
Type:
Description:
[capitalization
option]
selected entry, include subentries, all
level1 entries, all entries
What to capitalize.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
[on]
spread or page
The spread or page
on which to place
the index story.
[place point]
list of fixed or measurement strings {x, y}
The location at
which to place the
index story.
[destination layer]
layer
The layer on which
to place the index
story.
[autoflowing]
boolean
If true, autoflow the
placed index story.
[include overset]
boolean
If true, include
index in overset.
Name:
Type:
Description:
from
string
The file to import
topics from.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Applies capitalization options
to the index entries.
string
Gets the label value associated with the given key (label
name).
object
Generate a new index story.
nothing
Imports a list of topics.
nothing
Sets the string associated with
the given key (label name).
Method:
Parameters:
Return:
Description:
remove unused
topics
None
nothing
Removes all unused index
entries
update
None
nothing
Update the page numbers in
the index
InDesign CS Scripting Guide
AppleScript Reference
211
index options
Properties
Property:
Type:
Access:
Description:
before cross reference separator
string
read/write
The string following each index topic.
between entries
separator
string
read/write
The string between each index entry.
between page
numbers separator
string
read/write
The string between page numbers or page
ranges.
class
type
read only
The class of the object.
cross reference
style
character style
read/write
The style to apply to cross references.
cross reference
topic style
character style
read/write
The style to apply to cross reference topics.
entry end separator
string
read/write
The string to insert at the end of each
index entry.
following topic
separator
string
read/write
The string following each index topic.
include book
documents
boolean
read/write
If true, include all documents of a book
publication.
include empty
index sections
boolean
read/write
If true, and if include index section headings is true, include headings for empty
index sections.
include hidden
entries
boolean
read/write
If true, include text on hidden layers.
include section
headings
boolean
read/write
If true, include index section headings
(“A,” “B,” etc.).
index format
runin format, nested format
read/write
The index format to use in the generated
index.
level 1 style
paragraph style
read/write
The paragraph style to apply to level 1 topics of each page reference.
level 2 style
paragraph style
read/write
The paragraph style to apply to level 2 topics of each page reference.
level 3 style
paragraph style
read/write
The paragraph style to apply to level 3 topics of each page reference.
level 4 style
paragraph style
read/write
The paragraph style to apply to level 4 topics of each page reference.
object reference
index options
read only
An object reference to the object.
page number style
character style
read/write
The character style to apply to page
numbers.
page range separator
string
read/write
The string entered between page numbers
to indicate a page range.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
replace existing
index
boolean
read/write
If true, replace the existing index instance.
section heading
style
paragraph style
read/write
The paragraph style to apply to index
section headings.
title
string
read/write
The title of the generated index.
title style
paragraph style
read/write
The paragraph style to apply to the index
title.
212
AppleScript Reference
InDesign CS Scripting Guide
ink
Properties
Property:
Type:
Access:
Description:
alias ink name
string
read/write
The name of the alias ink.
angle
fixed
read/write
The screen angle at which to print the ink.
class
type
read only
The class of the object.
convert to process
boolean
read/write
If true, convert a spot ink to a process
color simulation.
frequency
fixed
read/write
The halftone screen frequency at which to
print the ink.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the ink within its parent
application or document
ink type
normal, opaque, transparent, opaque ignore
read/write
The type of the ink.
is process ink
boolean
read only
If true, the ink is a process ink.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read only
The name of the ink.
neutral density
fixed
read/write
The neutral density of the ink. This value
represents the relative darkness and/or
opacity of the ink, and is used by the trapping system. ink neutral densities range
from XXX (lightest/least opaque) to XXX
(darkest/most opaque).
object reference
ink
read only
An object reference to the object.
parent
object
read only
The parent of the object.
print ink
boolean
read/write
If true, print the ink.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
solidity
fixed
read only
The solidity value of the ink.
trap order
integer
read/write
The trapping order of the ink.
Methods
Method:
extract label
insert label
Parameters:
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Return:
Description:
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
InDesign CS Scripting Guide
AppleScript Reference
213
insertion point
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
character
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
nested style
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
tab stop
index, name, range, relative, test
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All page item objects contained by this
text object, including any nested page
items or page items inside groups.
applied character
style
character style
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
paragraph style
read/write
The paragraph style applied to the text.
214
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
ascent
fixed
read only
The maximum ascent of any character in
the text object (in points, relative to the
baseline of the line containing the text).
associated XML
elements
list of XML elements
read only
The XML elements associated with this
text object (if any).
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
baseline
fixed
read only
The vertical location of the baseline of the
text, in the current vertical measurement
units, relative to the ruler zero point.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
contents
string
read/write
The contents of the text object. If the text
object is a single character, this property
might contain either a special character
constant or a string; for text objects containing multiple characters, this property
will contain a string.
descent
fixed
read only
The maximum descent of any character in
the text, in points, relative to the baseline
of the line containing the text object.
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
InDesign CS Scripting Guide
AppleScript Reference
215
Property:
Type:
Access:
Description:
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
gradient fill angle
fixed
read/write
The angle of the gradient applied to the fill
of the text (if any).
gradient fill length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the fill of
the text.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to the fill of the text, or the center
point of a radial gradient applied to the fill
of the text.
gradient stroke
angle
fixed
read/write
The angle of the gradient applied to the
stroke of the text.
gradient stroke
length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the stroke
of the text.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to stroke of the text, or the center
point of a radial gradient applied to the
stroke of the text.
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal offset
fixed
read only
The horizontal location of the left edge
of the first character in the text, in page
coordinates, relative to the current zero
point.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
216
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
index
integer
read only
index of the object within its parent
object.
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
length
integer
read only
The number of characters in the text
object.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
InDesign CS Scripting Guide
AppleScript Reference
217
Property:
Type:
Access:
Description:
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
insertion point
read only
An object reference to the object.
open type features
list of long
read/write
open type features
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
parent story
story
read only
The story containing the text object.
parent text frame
text frame
read only
The text frame containing the text object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
swatch or string
read/write
The gap color of the paragraph rule above.
218
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
InDesign CS Scripting Guide
AppleScript Reference
219
Property:
Type:
Access:
Description:
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list of objects
read/write
A list of all of the properties of all of the
tab stops on this insertion point. Can
return: list of record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
220
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
Methods
Method:
apply style
changecase
convert to table
create outlines
delete
Parameters:
Name:
Type:
Description:
using
character style, paragraph style, or string
The paragraph style
or character style to
apply.
[clearing overrides]
boolean
If true, clear any local formatting in the
text object before
applying the style.
Name:
Type:
Description:
using
uppercase, lowercase, titlecase, sentencecase
Case option to use.
Name:
Type:
Description:
[column separator]
string
The character to
interpret as the
column separator.
[row separator]
string
The character to
interpret as the row
separator.
[number of
columns]
integer
The number of
columns in the table
(only used if the
column and row
separators are the
same).
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original text.
None
Return:
Description:
nothing
Apply a paragraph or character
style to the text object.
nothing
Change the case of text.
table
Convert the text to a table. The
parameters for this command
correspond to the options
in the Convert text to table
dialog box (select some text
and choose table>Convert text
to table to display this dialog
box).
objects
Create outlines from the text.
If you set the delete original
parameter to true, InDesign
will delete the original text and
insert the character outlines as
an inline graphic; if the delete
original parameter is false, InDesign creates an independent
graphic and places it above the
text.
nothing
Deletes the object.
InDesign CS Scripting Guide
AppleScript Reference
221
Method:
export
markup
move
place
222
Parameters:
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The full path to the
exported file.
[showing options]
boolean
If true, display the
Export dialog box.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
using
XML element
The XML element
to associate with the
text.
Name:
Type:
Description:
to
before, after, at beginning, at end
Where to move the
text, relative to the
reference object
(before/after).
[reference]
object
A text object that
specifies the destination of the text
you’re moving.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The location (in
page coordinates) at
which to place the
incoming file.
[destination layer]
layer or layer name as string
The layer on which
to place the incoming file.
[showing options]
boolean
If true, display the
import options
dialog box for the
file type being
placed.
[autoflowing]
boolean
If true, autoflow the
incoming text.
[retaining formatting]
boolean
If true, retain the
formatting of the incoming text. If false,
place the text using
the document’s default text formatting
attributes.
[converting
quotes]
boolean
If true, convert typewriter
(“straight”) quotation marks to typographic (“curly”)
quotation marks.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Export the object to a file.
nothing
Associate the text with an XML
element while preserving the
existing text content.
nothing
Moves the text.
object
Place a file.
Method:
search
select
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
InDesign CS Scripting Guide
Selects text.
AppleScript Reference
223
integer combobox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
edit value
fixed
read/write
Real number value of the editbox or combobox. For measurement controls, this
value is in points. For percentage controls,
a value of 100 equals 100%
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the integer combobox within
its parent dialog column, dialog row,
enabling group or border panel
large nudge
fixed
read/write
The amount that the value of the control
changes when you hold down Shift and
press the uo or down arrow keys (while
editing the value in the control). If you do
not set a value for this property, the value
of the control will not change when you
hold down Shift and press the up or down
arrow keys.
maximum value
fixed
read/write
The maximum value for this control.
min width
fixed
read/write
The minimum width of the control.
minimum value
fixed
read/write
The minimum value for this control.
object reference
integer combobox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
small nudge
fixed
read/write
The amount that the value of the control
changes when you press the up and down
arrow keys while editing the value in the
control. If you do not set a value for this
property, the value of the control will not
change when you press the up or down
arrow keys.
string list
list of strings
read/write
A list of the strings that appear on the
menu of the control.
Methods
Method:
Parameters:
Return:
Description:
make
None
integer combobox
Create a new integer combobox.
224
AppleScript Reference
InDesign CS Scripting Guide
integer editbox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
edit value
fixed
read/write
Real number value of the editbox or combobox. For measurement controls, this
value is in points. For percentage controls,
a value of 100 equals 100%
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the integer editbox within its parent dialog column, dialog row, enabling
group or border panel
large nudge
fixed
read/write
The amount that the value of the control
changes when you hold down Shift and
press the uo or down arrow keys (while
editing the value in the control). If you do
not set a value for this property, the value
of the control will not change when you
hold down Shift and press the up or down
arrow keys.
maximum value
fixed
read/write
The maximum value for this control.
min width
fixed
read/write
The minimum width of the control.
minimum value
fixed
read/write
The minimum value for this control.
object reference
integer editbox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
small nudge
fixed
read/write
The amount that the value of the control
changes when you press the up and down
arrow keys while editing the value in the
control. If you do not set a value for this
property, the value of the control will not
change when you press the up or down
arrow keys.
Methods
Method:
Parameters:
Return:
Description:
make
None
integer editbox
Create a new integer editbox.
InDesign CS Scripting Guide
AppleScript Reference
225
JPEG export preference
Properties
Property:
Type:
Access:
class
type
read only
The class of the object.
Exporting Selection
boolean
read/write
If true, export the selection.
Exporting Spread
boolean
read/write
If true, export the spread.
JPEG Quality
low, medium, high, maximum
read/write
Specifies the compression quality of output JPEG file.
JPEG Rendering
style
baseline encoding, progressive encoding
read/write
Specifies the rendering style of output
JPEG file.
object reference
JPEG export preference
read only
An object reference to the object.
Page String
string
read/write
The pages to export (if you are not exporting the selected object or object).
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
226
AppleScript Reference
InDesign CS Scripting Guide
Description:
language
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
double quotes
string
read/write
number quotes pair for the language.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the language within its parent
document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read only
The name of the language.
object reference
language
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
single quotes
string
read/write
Single quotes pair for the language.
Methods
Method:
extract label
insert label
Parameters:
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Return:
Description:
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
InDesign CS Scripting Guide
AppleScript Reference
227
language with vendors
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
double quotes
string
read/write
number quotes pair for the language with
vendors.
hyphenation
vendor
string
read/write
Hyphenation vendor of the language.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the language with vendors within
its parent application
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read only
The name of the language with vendors.
object reference
language with vendors
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
single quotes
string
read/write
Single quotes pair for the language with
vendors.
spelling vendor
string
read/write
Spelling vendor of the language.
thesaurus vendor
string
read/write
Thesaurus vendor of the language.
Methods
Method:
extract label
insert label
228
Parameters:
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
layer
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
guide
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items in the layer, regardless of their position in the object hierarchy (i.e., page items inside groups or inside
other page items will be included).
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
ignore wrap
boolean
read/write
If true, the text wrap on any items on this
layer will be ignored when the layer is
hidden.
index
integer
read only
index of the layer within its parent
document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
layer color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The layer highlight color.
lock guides
boolean
read/write
If true, lock the guides on the layer.
locked
boolean
read/write
If true, the layer is locked.
name
string
read/write
The name of the layer.
object reference
layer
read only
An object reference to the object.
parent
document
read only
The parent of the layer.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
show guides
boolean
read/write
If true, display the guides on this layer.
visible
boolean
read/write
If true, the layer is visible.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
layer
Duplicates the object.
InDesign CS Scripting Guide
AppleScript Reference
229
Method:
extract label
insert label
make
merge
move
230
Parameters:
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
Name:
Type:
Description:
with
list of objects
They layer(s) with
which to merge.
Name:
Type:
Description:
to
before, after, at beginning, at end
location.
[reference]
layer
Before/after this
layer.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
layer
Create a new layer.
layer
Merge with another layer.
layer
Move the layer before/after
another layer, or to beginning/end.
layout adjustment preference
Properties
Property:
Type:
Access:
Description:
allow graphics to
resize
boolean
read/write
If true, allow graphics to resize in response to layout changes.
allow ruler guides
to move
boolean
read/write
If true, allow ruler guides to move to
adjust to layout changes.
class
type
read only
The class of the object.
enable layout
adjustment
boolean
read/write
If true, enable layout adjustment. When
layout adjustment is active, objects and
guides can change position when page
margins change, or when page size or page
orientation changes.
ignore object or
layer locks
boolean
read/write
If true, ignore object or layer locks when
adjusting the layout.
ignore ruler guide
alignments
boolean
read/write
If true, ignore ruler guide alignments
when adjusting layout.
object reference
layout adjustment preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
snap zone
fixed
read/write
The range (distance, in current measurement units) within which an object
snaps to a guide or margin during layout
adjustment.
InDesign CS Scripting Guide
AppleScript Reference
231
layout window
Properties
Property:
Type:
Access:
Description:
active layer
layer
read/write
The active layer
active page
page
read/write
The active page
active spread
spread
read/write
The active spread
bounds
list of numbers or measurement strings {top, left, bottom, right}
read/write
The bounds of the layout window, in the
format (top, left, bottom, right)
class
type
read only
The class descriptor type
index
integer
read only
index of the layout window within its parent document or application
name
string
read only
The name of the layout window
object reference
layout window
read only
An object reference for this layout window
overprint preview
boolean
read/write
Whether to display a simulation of overprinting
parent
object
read only
The layout window’s parent. Can return:
document or application.
proofing profile
string
read/write
The profile used for proofing
proofing type
proof off, document CMYK, working CMYK, custom
read/write
The method of proofing
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
selection
list
read/write
The selection of the front-most window.
Can return: object, list of objects or nothing.
simulate ink black
boolean
read/write
Determine whether to adjust for the black
point
simulate paper
white
boolean
read/write
Determine whether to adjust for white
point
transform reference point
list or numbers or measurement strings {x, y} or bottom center anchor, bottom left anchor, bottom right anchor, center anchor, left center anchor, right
center anchor, top left anchor, top center anchor, top right anchor
read/write
The default anchor point to transform
objects around. Can return: top left anchor/top center anchor/top right anchor/
left center anchor/center anchor/right
center anchor/bottom left anchor/bottom
center anchor/bottom right anchor or list
of 2 numbers o...
view display setting
high quality, typical, optimized
read/write
The local Display Performance settings for
this view
zoom percentage
fixed
read/write
The current zoom
Methods
Method:
Parameters:
Return:
Description:
bring to front
None
nothing
Brings the object to the top
close
None
nothing
Close the LayoutWindow
maximize
None
nothing
Maximize the window
minimize
None
nothing
Minimize the window
restore
None
nothing
Restore the window
nothing
Select one or more objects.
select
232
Name:
Type:
Description:
selectable items
object or list of objects, or nothing to
deselect all
The object or objects
to select.
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
AppleScript Reference
InDesign CS Scripting Guide
Method:
zoom
Parameters:
Name:
Type:
Description:
given
zoom in, zoom out, fit spread, fit page,
show pasteboard, actual size
Zoom size.
Return:
Description:
nothing
Zoom the window.
InDesign CS Scripting Guide
AppleScript Reference
233
library
Elements
Element:
Refer to by:
asset
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
file path
file reference or file name as string
read only
The file path to the folder containing
the library file (does not include the file
name).
full name
file reference or file name as string
read only
The file path to the library file, including
the file name.
index
integer
read only
index of the library within its parent
application
name
string
read only
The name of the library file.
object reference
library
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
close
None
nothing
Close the library
library
Create a new libary.
asset
Store page item(s) in a library.
make
store
234
Name:
Type:
Description:
full name
string
The path and file
name.
Name:
Type:
Description:
using
object or list of objects
The page item(s) to
store.
AppleScript Reference
InDesign CS Scripting Guide
Description:
line
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
character
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
nested style
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
tab stop
index, name, range, relative, test
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All page item objects contained by this
text object, including any nested page
items or page items inside groups.
applied character
style
character style
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
paragraph style
read/write
The paragraph style applied to the text.
InDesign CS Scripting Guide
AppleScript Reference
235
Property:
Type:
Access:
Description:
ascent
fixed
read only
The maximum ascent of any character in
the text object (in points, relative to the
baseline of the line containing the text).
associated XML
elements
list of XML elements
read only
The XML elements associated with this
text object (if any).
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
baseline
fixed
read only
The vertical location of the baseline of the
text, in the current vertical measurement
units, relative to the ruler zero point.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
contents
string
read/write
The contents of the text object. If the text
object is a single character, this property
might contain either a special character
constant or a string; for text objects containing multiple characters, this property
will contain a string.
descent
fixed
read only
The maximum descent of any character in
the text, in points, relative to the baseline
of the line containing the text object.
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
236
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
gradient fill angle
fixed
read/write
The angle of the gradient applied to the fill
of the text (if any).
gradient fill length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the fill of
the text.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to the fill of the text, or the center
point of a radial gradient applied to the fill
of the text.
gradient stroke
angle
fixed
read/write
The angle of the gradient applied to the
stroke of the text.
gradient stroke
length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the stroke
of the text.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to stroke of the text, or the center
point of a radial gradient applied to the
stroke of the text.
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal offset
fixed
read only
The horizontal location of the left edge
of the first character in the text, in page
coordinates, relative to the current zero
point.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
InDesign CS Scripting Guide
AppleScript Reference
237
Property:
Type:
Access:
Description:
index
integer
read only
index of the object within its parent
object.
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
length
integer
read only
The number of characters in the text
object.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
238
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
line
read only
An object reference to the object.
open type features
list of long
read/write
open type features
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
parent story
story
read only
The story containing the text object.
parent text frame
text frame
read only
The text frame containing the text object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
fixed or measurement string
read/write
The gap color of the paragraph rule above.
InDesign CS Scripting Guide
AppleScript Reference
239
Property:
Type:
Access:
Description:
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
240
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list of objects
read/write
A list of all of the properties of all of the
tab stops on this line. Can return: list of
record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
InDesign CS Scripting Guide
AppleScript Reference
241
Property:
Type:
Access:
Description:
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
Methods
Method:
apply style
changecase
convert to table
create outlines
delete
242
Parameters:
Name:
Type:
Description:
using
character style, paragraph style, or string
The paragraph style
or character style to
apply.
[clearing overrides]
boolean
If true, clear any local formatting in the
text object before
applying the style.
Name:
Type:
Description:
using
uppercase, lowercase, titlecase, sentencecase
Case option to use.
Name:
Type:
Description:
[column separator]
string
The character to
interpret as the
column separator.
[row separator]
string
The character to
interpret as the row
separator.
[number of
columns]
integer
The number of
columns in the table
(only used if the
column and row
separators are the
same).
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original text.
None
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Apply a paragraph or character
style to the text object.
nothing
Change the case of text.
table
Convert the text to a table. The
parameters for this command
correspond to the options
in the Convert text to table
dialog box (select some text
and choose table>Convert text
to table to display this dialog
box).
objects
Create outlines from the text.
If you set the delete original
parameter to true, InDesign
will delete the original text and
insert the character outlines as
an inline graphic; if the delete
original parameter is false, InDesign creates an independent
graphic and places it above the
text.
nothing
Deletes the object.
Method:
export
markup
move
place
Parameters:
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The full path to the
exported file.
[showing options]
boolean
If true, display the
Export dialog box.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
using
XML element
The XML element
to associate with the
text.
Name:
Type:
Description:
to
before, after, at beginning, at end
Where to move the
text, relative to the
reference object
(before/after).
[reference]
object
A text object that
specifies the destination of the text
you’re moving.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The location (in
page coordinates) at
which to place the
incoming file.
[destination layer]
layer or layer name as string
The layer on which
to place the incoming file.
[showing options]
boolean
If true, display the
import options
dialog box for the
file type being
placed.
[autoflowing]
boolean
If true, autoflow the
incoming text.
[retaining formatting]
boolean
If true, retain the
formatting of the incoming text. If false,
place the text using
the document’s default text formatting
attributes.
[converting
quotes]
boolean
If true, convert typewriter
(“straight”) quotation marks to typographic (“curly”)
quotation marks.
Return:
Description:
nothing
Export the object to a file.
nothing
Associate the text with an XML
element while preserving the
existing text content.
nothing
Moves the text.
object
Place a file.
InDesign CS Scripting Guide
AppleScript Reference
243
Method:
search
select
244
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
Selects text.
link
Properties
Property:
Type:
Access:
Description:
asset etag
string
read only
The asset etag of the link.
asset ID
list of strings or fixed
read only
The asset ID of the link.
asset URL
string
read only
The asset URL of the link.
class
type
read only
The class of the object.
date
date
read only
The date and time the link was created.
edited
boolean
read only
If true, the link file has been modified
since it was last updated.
file path
file reference or file name as string
read only
The file path to the folder containing the
link file (does not include the file name).
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the link within its parent
document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
link type
string
read only
The type of the link.
name
string
read only
The name of the link file.
needed
boolean
read only
If true, the link is needed for printing or
export.
object reference
link
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
size
integer
read only
The size of the link file on disk.
status
normal, link out of date, link missing, link embedded
read only
The status of the link.
Methods
Method:
Parameters:
Return:
edit original
None
nothing
Edit original
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
nothing
Set the link.
nothing
Show link
nothing
Unembed data and link to new
file or link to original.
extract label
insert label
relink
show
unembed
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
to
string
to.
None
Name:
Type:
Description:
[to]
string
Folder where new
files are created.
Description:
unlink
None
nothing
Unlink text or embed images
update
None
link
Update Link.
InDesign CS Scripting Guide
AppleScript Reference
245
margin preference
Properties
Property:
Type:
Access:
Description:
bottom
fixed or measurement string
read/write
The height of the bottom margin.
class
type
read only
The class of the object.
column count
integer
read/write
The number of column guides on the page.
Note that these column guides have no effect on the number of columns in a single
text frame.
column gutter
fixed or measurement string
read/write
The distance between columns on the
page.
left
fixed or measurement string
read/write
The width of the left margin.
object reference
margin preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right
fixed or measurement string
read/write
The width of the right margin.
top
fixed or measurement string
read/write
The height of the top margin.
246
AppleScript Reference
InDesign CS Scripting Guide
master spread
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
guide
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items on the master spread,
regardless of their position in the object
hierarchy (i.e., page items inside groups or
inside other page items will be included).
applied master
master spread
read/write
The master spread applied to this master
spread (if any).
base name
string
read/write
The base name of the master spread.
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the master spread within its parent document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read only
The name of the master spread.
name prefix
string
read/write
The name prefix of the master spread.
object reference
master spread
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
show master items
boolean
read/write
If true, show page items from the master
spread applied to this master spread (if
any).
InDesign CS Scripting Guide
AppleScript Reference
247
Methods
Method:
create guides
Parameters:
Name:
Type:
Description:
[number of rows]
integer
Number of rows of
guides on a page.
[number of
columns]
integer
Number of columns
of guides on a page.
[row gutter]
fixed or measurement string
The amount of gutter between rows.
[column gutter]
fixed or measurement string
The amount of
gutter between
columns.
[guide color]
list of fixed {r, g, b} or light blue, red,
green, blue, yellow, magenta, cyan, gray,
black, orange, dark green, teal, tan,
brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach,
burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
The guideÕs color.
[fit margins]
boolean
Whether the guides
should fit to margins or fit to page.
[remove existing]
boolean
If true, remove
existing guides.
[layer]
layer
The layer on which
to create the master
spread as layer.
Return:
Description:
nothing
Create multiple guides on all
pages of a spread.
Deletes the object.
delete
None
nothing
duplicate
None
master spread
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
master spread
Create a new master spread.
extract label
insert label
make
248
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[pages per spread]
integer
Number of pages of
the master spread as
integer.
AppleScript Reference
InDesign CS Scripting Guide
Method:
place
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
Return:
Description:
object
Place a file.
InDesign CS Scripting Guide
AppleScript Reference
249
measurement combobox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
edit units
points, picas, inches, inches decimal, millimeters, centimeters, ciceros
read/write
The measurement unit to use for the editbox or combobox
edit value
fixed
read/write
Real number value of the editbox or combobox. For measurement controls, this
value is in points. For percentage controls,
a value of 100 equals 100%
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the measurement combobox
within its parent dialog column, dialog
row, enabling group or border panel
large nudge
fixed
read/write
The amount that the value of the control
changes when you hold down Shift and
press the uo or down arrow keys (while
editing the value in the control). If you do
not set a value for this property, the value
of the control will not change when you
hold down Shift and press the up or down
arrow keys.
maximum value
fixed
read/write
The maximum value for this control.
min width
fixed
read/write
The minimum width of the control.
minimum value
fixed
read/write
The minimum value for this control.
object reference
measurement combobox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
small nudge
fixed
read/write
The amount that the value of the control
changes when you press the up and down
arrow keys while editing the value in the
control. If you do not set a value for this
property, the value of the control will not
change when you press the up or down
arrow keys.
string list
list of strings
read/write
A list of the strings that appear on the
menu of the control.
Methods
Method:
Parameters:
Return:
Description:
make
None
measurement
combobox
Create a new measurement
combobox.
250
AppleScript Reference
InDesign CS Scripting Guide
measurement editbox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
edit units
points, picas, inches, inches decimal, millimeters, centimeters, ciceros
read/write
The measurement unit to use for the editbox or combobox
edit value
fixed
read/write
Real number value of the editbox or combobox. For measurement controls, this
value is in points. For percentage controls,
a value of 100 equals 100%
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the measurement editbox within
its parent dialog column, dialog row,
enabling group or border panel
large nudge
fixed
read/write
The amount that the value of the control
changes when you hold down Shift and
press the uo or down arrow keys (while
editing the value in the control). If you do
not set a value for this property, the value
of the control will not change when you
hold down Shift and press the up or down
arrow keys.
maximum value
fixed
read/write
The maximum value for this control.
min width
fixed
read/write
The minimum width of the control.
minimum value
fixed
read/write
The minimum value for this control.
object reference
measurement editbox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
small nudge
fixed
read/write
The amount that the value of the control
changes when you press the up and down
arrow keys while editing the value in the
control. If you do not set a value for this
property, the value of the control will not
change when you press the up or down
arrow keys.
Methods
Method:
Parameters:
Return:
Description:
make
None
measurement
editbox
Create a new measurement
editbox.
InDesign CS Scripting Guide
AppleScript Reference
251
metadata preference
Properties
Property:
Type:
Access:
Description:
author
string
read/write
document author
class
type
read only
The class of the object.
copyright info
URL
string
read/write
Copyright statement URL
copyright notice
string
read/write
Copyright text.
copyright status
unknown, yes, no
read/write
Copyright status of the document
creation date
date
read only
document creation date.
creator
string
read only
The application that created the document
description
string
read/write
A description of the document.
document title
string
read/write
The document title
format
string
read only
The document format
job name
string
read/write
Customer-assigned job name.
keywords
list of strings
read/write
The keywords associated with the
document.
modification date
date
read only
The most recent document modification
date.
object reference
metadata preference
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
server URL
string
read only
Location of the document on asset management server.
Methods
Method:
append
count container
create container
item
252
Parameters:
Name:
Type:
Description:
from
string
File from which to
append.
[affect all]
boolean
If true, treat all
properties as
external (defaults to
false).
Name:
Type:
Description:
namespace
string
The namespace.
path
string
The path.
Name:
Type:
Description:
namespace
string
The namespace.
path
string
The path.
[index]
integer
The index of the
item (starts from 1,
default is 0 meaning
append to the end).
[container]
bag, seq, alt
The container type
(only required if
the new item is
the first one in the
container).
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Append information from
external file.
integer
Count the number of items in
the container.
nothing
Create an empty container
item.
Method:
get property
replace
save
set property
Parameters:
Name:
Type:
Description:
namespace
string
The namespace.
path
string
The path.
Name:
Type:
Description:
from
string
File from which to
replace.
[affect all]
boolean
If true, treat all
properties as
external (defaults to
false).
Name:
Type:
Description:
to
string
Where to save.
Name:
Type:
Description:
namespace
string
The namespace.
path
string
The path.
value
string
The value of the
property, pass an
empty string to remove the property.
Return:
Description:
string
Get the XMP property value
associated with the given path.
nothing
Read information from external file and replace current
metadata.
nothing
Save information to file.
nothing
Set the XMP property associated with the given path.
InDesign CS Scripting Guide
AppleScript Reference
253
mixed ink
Properties
Property:
Type:
Access:
Description:
base color
mixed ink group
read only
The mixed ink group that a mixed ink
swatch is based on.
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the mixed ink within its parent
application or document
ink list
list of ink
read only
The inks used in the mixed ink.
ink percentages
list of fixed
read/write
The list of tint percentages for the mixed
ink.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
model
spot, process, registration, mixedinkmodel
read/write
The color model of the mixed ink.
name
string
read/write
The name of the mixed ink.
object reference
mixed ink
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
space
RGB, CMYK, LAB, mixed ink
read/write
The color space of the mixed ink.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
mixed ink
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
mixed ink
Create a new mixed ink.
nothing
Merge one or more other
swatches into this one.
extract label
insert label
make
merge
254
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
ink list
list of inks
The list of ink items
or the mixed ink
base swatch.
ink percentages
list of fixed
The list of ink contributions for the
ink items specified.
Name:
Type:
Description:
with
mixed ink
The swatches to
merge.
AppleScript Reference
InDesign CS Scripting Guide
mixed ink group
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the mixed ink group within its
parent application or document
ink list
list of inks
read only
The inks used in the mixed ink group.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
model
spot, process, registration, mixedinkmodel
read/write
The color model of the mixed ink group.
name
string
read/write
The name of the mixed ink group.
object reference
mixed ink group
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
mixed ink
group
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
mixed ink
group
Create a new mixed ink group.
nothing
Merge one or more other
swatches into this one.
InDesign CS Scripting Guide
AppleScript Reference
extract label
insert label
make
merge
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
ink list
list of inks
A list of ink items.
[ink percentages]
list of fixed
A list of initial
percentages for each
ink in the ink list.
[repeat values]
list of integers
A list specifying
the repeat amount
for each ink in the
ink list.
[increment values]
list of fixed
A list specifying the
increment percentages for each ink in
the ink list.
Name:
Type:
Description:
with
mixed ink group
The swatches to
merge.
255
movie
Elements
Element:
Refer to by:
image
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
class
type
read only
The class of the object.
description
string
read/write
Description
embed in PDF
boolean
read/write
Embed content in pdf
file path
file reference or file name as string
read/write
The file path
floating window
boolean
read/write
Floating window
floating window
position
upper left, upper middle, upper right, center left, center, center right, lower
left, lower middle, lower right
read/write
Floating window position
floating window
size
one fifth, one fourth, one half, full, double, triple, quadruple, max
read/write
Floating window size
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the movie within its parent page
item, oval, rectangle or polygon
item layer
layer
read/write
The layer containing the page item.
item link
link
read only
link to a placed file
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
locked
boolean
read/write
If true, the page item is locked.
movie poster type
none, standard, from movie, proxy image
read/write
The current poster type (‘proxy image’ is
read-only)
name
string
read/write
The name of the movie
object reference
movie
read only
An object reference to the object.
parent
object
read only
The parent of the page item.
play mode
once, stay open, repeat play
read/write
Play mode
play on page turn
boolean
read/write
Play on page turn
poster file
string
read/write
Poster file
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
show controls
boolean
read/write
Show controls
URL
string
read/write
The URL
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
256
AppleScript Reference
InDesign CS Scripting Guide
Methods
Method:
Parameters:
Return:
Description:
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
delete
None
nothing
Deletes the object.
duplicate
None
movie
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Fit content within a graphic
frame.
nothing
Sets the string associated with
the given key (label name).
movie
Create a new movie.
nothing
Markup layout content with
XML preserving the existing
content.
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
extract label
fit
insert label
make
markup
move
reset scaling
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[layer]
layer or layer name as string
The layer on which
to create the movie
as layer.
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after this
movie or at the beginning/end of this
document, spread,
Master spread,
page or layer as
document, spread,
master spread, page
or layer.
Name:
Type:
Description:
using
xml element
The element to mark
up.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
None
InDesign CS Scripting Guide
AppleScript Reference
257
Method:
resize
select
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Select this movie.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
asset
Store a page item in a library.
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
boolean
Verify movie URL.
store
unlink
verify urll
258
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
None
AppleScript Reference
InDesign CS Scripting Guide
movie behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the movie behavior within its
parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
movie item
movie
read/write
The movie page item.
name
string
read only
The name of the behavior.
object reference
movie behavior
read only
An object reference to the object.
operation
play, stop, pause, resume
read/write
The movie operation to perform.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
movie
behavior
Create a new movie behavior.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
AppleScript Reference
259
nested style
Properties
Property:
Type:
Access:
Description:
applied character
style
character style
read/write
The applied character style. Can also accept: string.
class
type
read only
The class descriptor type
delimiter
string or sentence, any word, any character, letters, digits, tabs, inline graphic, read/write
dropcap, forced line break, end nested style, indent here tab, Em space, En
space, nonbreaking space, auto page number, section marker
The delimiting expression. Can return: string or sentence/any word/any
character/letters/digits/tabs/inline
graphic/dropcap/forced line break/end
nested style/indent here tab/Em space/En
space/nonbreaking space/auto page number/section marker.
inclusive
boolean
read/write
Include the last delimiter
index
integer
read only
index of the nested style within its parent
text default, paragraph, paragraph style,
text, character, word, line, text column,
text style range, insertion point or story
object reference
nested style
read only
An object reference for this nested style
parent
object
read only
The nested style’s parent. Can return: text
default, paragraph, paragraph style, text,
character, word, line, text column, text
style range, insertion point or story.
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
repetition
integer
read/write
How many delimiters
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
make
None
nested style
Create a new nested style.
260
AppleScript Reference
InDesign CS Scripting Guide
open file behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
file path
file reference or file name as string
read/write
The file path to the file being opened.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the open file behavior within its
parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the behavior.
object reference
open file behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
open file
behavior
Create a new open file behavior.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
Description:
AppleScript Reference
261
oval
Elements
Element:
Refer to by:
EPS
index, name, range, relative, test, id
graphic
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
image
index, name, range, relative, test, id
movie
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
path
index, name, range, relative, test
PDF
index, name, range, relative, test, id
PICT
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
sound
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
text path
index, name, range, relative, test, id
WMF
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items within this page
item, regardless of their position in the
object hierarchy (i.e., page items inside
groups or inside other page items will be
included).
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
content type
unassigned, graphic type, text type
read/write
The type of content
corner effect
none, rounded corner, inverse rounded corner, inset corner, bevel corner,
fancy corner
read/write
The corner effect applied to the page item.
This property corresponds to the Effect
pop-up menu in the Corner Effects dialog
box.
262
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
corner radius
fixed
read/write
The radius of the corner effect applied to
the page item. This property corresponds
to the Size field in the Corner Effects
dialog box.
end cap
butt end cap, round end cap, projecting end cap
read/write
The appearance of the end points of an
open path. This property corresponds to
the End Cap options in the Stroke palette.
end join
miter end join, round end join, bevel end join
read/write
The appearance of the stroke at corner
points. This property corresponds to the
End Join options in the Stroke palette.
This property has no effect on smooth (or
“curve”) points on a path.
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the page item.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the page item (-1 indicates 100%, or no
override).
gap color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the gap of the stroke of the
page item.
gap tint
fixed
read/write
The tint percentage applied to the gap of
the stroke of the page item (-1 indicates
100%, or no override).
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
gradient fill angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient fill length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the fill of the page
item.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied to the fill of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
gradient stroke
angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient stroke
length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the stroke of the page
item.
InDesign CS Scripting Guide
AppleScript Reference
263
Property:
Type:
Access:
Description:
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied
to the stroke of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the oval within its parent
spread, master spread, page item, oval,
rectangle, polygon, graphic line, group,
state, document, layer, page, button, text
frame, story, text, character, word, line,
text column, paragraph, text style range,
cell, t...
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item layer
layer
read/write
The layer containing the page item.
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
left line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the first
(or “left) point of an open path.
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
locked
boolean
read/write
If true, the page item is locked.
miter limit
fixed
read/write
Defines the point at which a corner point
switches from a mitered (pointed) join to
a beveled (squared-off) join. If the width
of the stroke at a corner point would be
wider than this value times the stroke
weight, InDesign applies a beveled join to
the corner.
nonprinting
boolean
read/write
If true, the page item is non-printing.
object reference
oval
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
overprint fill
boolean
read/write
If true, the fill of the page item will
overprint.
overprint gap
boolean
read/write
If true, overprint the gap color applied to
the stroke of the page item.
overprint stroke
boolean
read/write
If true, overprint the stroke of the page
item.
overridden
boolean
read only
If true, this page item originated on a
master spread and was later overridden
(i.e., copied to the document page). It is
still linked to the page item on the master
spread.
264
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
overridden master
page item
page item
read only
A reference to the master page item linked
to the page item (if any).
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the last
(“right”) point of an open path.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
stroke alignment
center alignment, inside alignment, outside alignment
read/write
This property controls the way that the
stroke of a path is drawn relative to the
path, and corresponds to the Stroke Alginment options in the Stroke palette.
stroke color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the stroke of the page item.
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The method used to adjust the position
of dashes and gaps on a dashed stroke
around corner points on a path. This
property corresponds to the Corners popup menu in the Stroke palette (only visible
when a dashed stroke is selected).
stroke dash and
gap
list of fixed or measurement strings {dash, gap, ...}
read/write
The dash and gap settings of a dashed line.
A list of up to 6 values.
InDesign CS Scripting Guide
AppleScript Reference
265
Property:
Type:
Access:
Description:
stroke tint
fixed
read/write
The tint percentage applied to the stroke
of the page item (-1 indicates 100%, or no
override).
stroke type
stroke style
read/write
The stroke type applied to the page item-either one of the default stroke types, or
the name of a custom stroke style.
stroke weight
fixed
read/write
The weight (in points) of the stroke applied to the page item.
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
add path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Return:
Description:
page item
Create a new shape by adding
the path(s) of this object with
the paths of other objects. This
method corresponds to the
Add path operation (Objects>P
athfinder>Add).
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
delete
None
nothing
Deletes the object.
duplicate
None
oval
Duplicates the object.
page item
Creates a new shape by excluding area of intersection of this
object with the other objects.
This method corresponds
to the Exclude Overlap path
operation (Objects>Pathfinder
>Exclude Overlap).
nothing
Exports the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Fit content within a graphic
frame.
exclude overlap
path
Name:
Type:
Description:
with
list of objects
The objects to
exclude.
export
Name:
Type:
Description:
format
string (name of export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
extract label
fit
266
AppleScript Reference
InDesign CS Scripting Guide
Method:
insert label
Parameters:
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
with
list of objects
The objects to intersect with.
Name:
Type:
Description:
[layer]
layer or layer name as string
The layer on which
to create the oval as
layer.
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after this
oval or at the beginning/end of this
document, spread,
Master spread,
page or layer as
document, spread,
master spread, page
or layer.
make compound
path
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
markup
Name:
Type:
Description:
using
XML element
The element to mark
up.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
Name:
Type:
Description:
destination page
page
The page on which
to override the master page item.
intersect path
make
minus back
move
override
Return:
Description:
nothing
Sets the string associated with
the given key (label name).
page item
Create a new shape based on
the area of intersection of this
object and other objects. This
method corresponds to the
Intersect path operation (Objec
ts>Pathfinder>Intersect).
oval
Create a new oval.
page item
Create a compound path by
adding the paths of this object
to the paths of other objects.
This method corresponds
to the Object>Compound
paths>Make command.
nothing
Markup layout content with
XML preserving the existing
content.
page item
Create a new shape by reverse
subtracting this object from
other objects. This method
corresponds to the Minus Back
path operation (Objects>Pathfi
nder>Minus Back).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
page item
Overrides an item from the
master page and places it on
the page.
InDesign CS Scripting Guide
AppleScript Reference
267
Method:
place
place xml
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
Name:
Type:
Description:
using
XML element
The element to place
into.
Return:
Description:
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
release compound
path
None
objects
release compound path.
remove override
None
nothing
Removes a locally overriden
master page item
reset scaling
None
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
268
AppleScript Reference
InDesign CS Scripting Guide
Method:
resize
rotate
select
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to rotate
around, either one
of the enums or an
x,y value.
[considering current rotation]
boolean
if true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
if true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
if true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
nothing
Select this oval.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
InDesign CS Scripting Guide
AppleScript Reference
269
Method:
shear
store
subtract path
unlink
270
Parameters:
Name:
Type:
Description:
by
number
angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to shear
around, either one
of the enums or an
x,y value.
[considering current shear]
boolean
if true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
if true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
if true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Shear the page item.
asset
Store a page item in a library.
page item
Create a new shape by subtracting the area of intersection of
this object and other objects
from the other objects. This
method corresponds to the
Subtract path operation (Objec
ts>Pathfinder>Subtract).
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
package for GoLive preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class descriptor type
copy formatted
images
boolean
read/write
Whether to copy formatted images to
images sub folder
copy optimized
images
boolean
read/write
Whether to copy optimized images to
images sub folder
copy original
images
boolean
read/write
Whether to copy original images to
images sub folder
exclude dtd
boolean
read/write
Whether to exclude the dtdd from the
exported XML
export from
selected
boolean
read/write
Whether to export from a selected element
(otherwise export the entire document)
file encoding
UTF8, UTF16, shift JIS
read/write
File encoding to be used when exporting
GIF options interlaced
boolean
read/write
Generate interlaced GIFs
GIF options palette
adaptive palette, macintosh palette, web palette, windows palette
read/write
color palette to use for GIF conversion
image conversion
automatic, JPEG, GIF
read/write
Type of image to generate for optimized
and formatted images
JPEG options
format
baseline encoding, progressive encoding
read/write
Format of converted JPEG image
JPEG options
quality
low, medium, high, maximum
read/write
Quality of converted JPEG image
object reference
package for GoLive preference
read only
An object reference for this package for
GoLive preference
parent
object
read only
The package for GoLive preference’s parent. Can return: application or document.
preferred browser
file reference or file name as string
read/write
The preferred browser for viewing XML
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
ruby
boolean
read/write
Whether to include Ruby in the exported
XML
view after export
boolean
read/write
Whether to view exported XML in a
default viewer
InDesign CS Scripting Guide
AppleScript Reference
271
page
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
guide
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items on the page, regardless of their position in the object hierarchy (i.e., page items inside groups or inside
other page items will be included).
applied master
master spread
read/write
The master spread applied to the page.
applied section
section
read only
The section associated with this page.
applied trap preset
trap preset
read/write
The trap preset associated with this page.
Can also accept: string.
bounds
list of fixed or measurement strings {top, left, bottom, right}
read only
The bounds of the page.
class
type
read only
The class of the object.
document offset
integer
read only
Offset of the page in the document.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the object within its parent
spread.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
margin preferences
margin preference
read only
The margin preferences for the page.
master page items
list of page items
read only
All items on the applied master spread(s)
that have not been overridden.
name
string
read only
The name of the page.
object reference
page
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
tab order
list of form fields
read/write
The order of tabbing among the form
fields on the page.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
page
Duplicates the object.
272
AppleScript Reference
InDesign CS Scripting Guide
Method:
extract label
insert label
make
move
place
remove override
Parameters:
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after an
existing page or at
the beginning/end
of a parent as page,
spread, master
spread or document.
Name:
Type:
Description:
[to]
before, after, at beginning, at end
Location.
[reference]
object
A page or spread.
Before/after the
page or at the beginning/end of the
spread.
[binding]
before, after, at end, at beginning, unknown, right align, left align, default
Binding options.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
None
Return:
Description:
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
page
Create a new page.
page
Move page.
object
Place a file.
nothing
Removes a locally overriden
master page item
InDesign CS Scripting Guide
AppleScript Reference
273
page item
Elements
Element:
Refer to by:
EPS
index, name, range, relative, test, id
graphic
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
image
index, name, range, relative, test, id
movie
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
path
index, name, range, relative, test
PDF
index, name, range, relative, test, id
PICT
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
sound
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
text path
index, name, range, relative, test, id
WMF
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items within this page
item, regardless of their position in the
object hierarchy (i.e., page items inside
groups or inside other page items will be
included).
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
corner effect
none, rounded corner, inverse rounded corner, inset corner, bevel corner,
fancy corner
read/write
The corner effect applied to the page item.
This property corresponds to the Effect
pop-up menu in the Corner Effects dialog
box.
274
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
corner radius
fixed
read/write
The radius of the corner effect applied to
the page item. This property corresponds
to the Size field in the Corner Effects
dialog box.
end cap
butt end cap, round end cap, projecting end cap
read/write
The appearance of the end points of an
open path. This property corresponds to
the End Cap options in the Stroke palette.
end join
miter end join, round end join, bevel end join
read/write
The appearance of the stroke at corner
points. This property corresponds to the
End Join options in the Stroke palette.
This property has no effect on smooth (or
“curve”) points on a path.
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the page item.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the page item (-1 indicates 100%, or no
override).
gap color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the gap of the stroke of the
page item.
gap tint
fixed
read/write
The tint percentage applied to the gap of
the stroke of the page item (-1 indicates
100%, or no override).
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
gradient fill angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient fill length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the fill of the page
item.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied to the fill of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
gradient stroke
angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient stroke
length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the stroke of the page
item.
InDesign CS Scripting Guide
AppleScript Reference
275
Property:
Type:
Access:
Description:
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied
to the stroke of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the page item within its parent
XML element, spread, master spread, page
item, oval, rectangle, polygon, graphic
line, group, state, text frame, story,
text, character, word, line, text column,
paragraph, text style range, cell, table,
documen...
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item layer
layer
read/write
The layer containing the page item.
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
left line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the first
(or “left) point of an open path.
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
locked
boolean
read/write
If true, the page item is locked.
miter limit
fixed
read/write
Defines the point at which a corner point
switches from a mitered (pointed) join to
a beveled (squared-off) join. If the width
of the stroke at a corner point would be
wider than this value times the stroke
weight, InDesign applies a beveled join to
the corner.
nonprinting
boolean
read/write
If true, the page item is non-printing.
object reference
page item
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
overprint fill
boolean
read/write
If true, the fill of the page item will
overprint.
overprint gap
boolean
read/write
If true, overprint the gap color applied to
the stroke of the page item.
overprint stroke
boolean
read/write
If true, overprint the stroke of the page
item.
overridden
boolean
read only
If true, this page item originated on a
master spread and was later overridden
(i.e., copied to the document page). It is
still linked to the page item on the master
spread.
276
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
overridden master
page item
page item
read only
A reference to the master page item linked
to the page item (if any).
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the last
(“right”) point of an open path.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
stroke alignment
center alignment, inside alignment, outside alignment
read/write
This property controls the way that the
stroke of a path is drawn relative to the
path, and corresponds to the Stroke Alginment options in the Stroke palette.
stroke color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the stroke of the page item.
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The method used to adjust the position
of dashes and gaps on a dashed stroke
around corner points on a path. This
property corresponds to the Corners popup menu in the Stroke palette (only visible
when a dashed stroke is selected).
stroke dash and
gap
list of fixed or measurement strings {dash, gap, ...}
read/write
The dash and gap settings of a dashed line.
A list of up to 6 values.
InDesign CS Scripting Guide
AppleScript Reference
277
Property:
Type:
Access:
Description:
stroke tint
fixed
read/write
The tint percentage applied to the stroke
of the page item (-1 indicates 100%, or no
override).
stroke type
stroke style
read/write
The stroke type applied to the page item-either one of the default stroke types, or
the name of a custom stroke style.
stroke weight
fixed
read/write
The weight (in points) of the stroke applied to the page item.
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
add path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Return:
Description:
page item
Create a new shape by adding
the path(s) of this object with
the paths of other objects. This
method corresponds to the
Add path operation (Objects>P
athfinder>Add).
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
page item
Creates a new shape by excluding area of intersection of this
object with the other objects.
This method corresponds
to the Exclude Overlap path
operation (Objects>Pathfinder
>Exclude Overlap).
nothing
Exports the object to a file.
string
Gets the label value associated with the given key (label
name).
exclude overlap
path
Name:
Type:
Description:
with
list of objects
The objects to
exclude.
export
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The file type to
export to.
to
string
The file path to
the exported file,
including the file
name.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
extract label
278
AppleScript Reference
InDesign CS Scripting Guide
Method:
fit
Parameters:
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
with
list of objects
The objects to intersect with.
make compound
path
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
markup
Name:
Type:
Description:
using
XML element
The element to mark
up.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
Name:
Type:
Description:
destination page
page
The page on which
to override the master page item.
insert label
intersect path
minus back
move
override
Return:
Description:
nothing
Fit content within a graphic
frame.
nothing
Sets the string associated with
the given key (label name).
page item
Create a new shape based on
the area of intersection of this
object and other objects. This
method corresponds to the
Intersect path operation (Objec
ts>Pathfinder>Intersect).
page item
Create a compound path by
adding the paths of this object
to the paths of other objects.
This method corresponds
to the Object>Compound
paths>Make command.
nothing
Markup layout content with
XML preserving the existing
content.
page item
Create a new shape by reverse
subtracting this object from
other objects. This method
corresponds to the Minus Back
path operation (Objects>Pathfi
nder>Minus Back).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
page item
Overrides an item from the
master page and places it on
the page.
InDesign CS Scripting Guide
AppleScript Reference
279
Method:
place
place xml
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
Name:
Type:
Description:
using
XML element
The element in
which to insert the
incoming XML elements.
Return:
Description:
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
release compound
path
None
objects
release compound path.
remove override
None
nothing
Removes a locally overriden
master page item
reset scaling
None
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
280
AppleScript Reference
InDesign CS Scripting Guide
Method:
resize
rotate
select
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to rotate
around, either one
of the enums or an
x,y value.
[considering current rotation]
boolean
if true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
if true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
if true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
nothing
Select this page item.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
InDesign CS Scripting Guide
AppleScript Reference
281
Method:
shear
store
subtract path
unlink
282
Parameters:
Name:
Type:
Description:
by
number
angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to shear
around, either one
of the enums or an
x,y value.
[considering current shear]
boolean
if true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
if true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
if true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Shear the page item.
asset
Store a page item in a library.
page item
Create a new shape by subtracting the area of intersection of
this object and other objects
from the other objects. This
method corresponds to the
Subtract path operation (Objec
ts>Pathfinder>Subtract).
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
page reference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the page reference within its
parent topic
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
object reference
page reference
read only
An object reference to the object.
page number style
override
character style
read/write
The style override replacing the standard
generation option.
page reference
limit
paragraph style or integer
read/write
The page reference limit.
page reference type
current page, to next style change, to next use of style, to end of story, to end
of document, to end of section, for next n paragraphs, for next n pages, suppress page numbers
read/write
The page reference type.
parent
topic
read only
The parent of the object.
parent story
story
read only
The story containing the page reference.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
story offset
integer
read only
The location of the page reference from
the beginning of the story.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
page reference
Create a new page reference.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
parent story
story
The parent story.
story offset
insertion point or integer
Offset within the
story.
[page reference
type]
current page, to next style change, to
next use of style, to end of story, to end
of document, to end of section, for next
n paragraphs, for next n pages, suppress
page numbers
The type of page
reference.
[page reference
limit]
paragraph style or integer.
The page range
limit.
[page number style
override]
character style
The style override
for the page number.
InDesign CS Scripting Guide
Description:
AppleScript Reference
283
paragraph
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
character
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
nested style
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
tab stop
index, name, range, relative, test
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All page item objects contained by this
text object, including any nested page
items or page items inside groups.
applied character
style
character style
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
paragraph style
read/write
The paragraph style applied to the text.
284
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
ascent
fixed
read only
The maximum ascent of any character in
the text object (in points, relative to the
baseline of the line containing the text).
associated XML
elements
list of XML elements
read only
The XML elements associated with this
text object (if any).
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
baseline
fixed
read only
The vertical location of the baseline of the
text, in the current vertical measurement
units, relative to the ruler zero point.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
contents
string
read/write
The contents of the text object. If the text
object is a single character, this property
might contain either a special character
constant or a string; for text objects containing multiple characters, this property
will contain a string.
descent
fixed
read only
The maximum descent of any character in
the text, in points, relative to the baseline
of the line containing the text object.
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
InDesign CS Scripting Guide
AppleScript Reference
285
Property:
Type:
Access:
Description:
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
gradient fill angle
fixed
read/write
The angle of the gradient applied to the fill
of the text (if any).
gradient fill length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the fill of
the text.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to the fill of the text, or the center
point of a radial gradient applied to the fill
of the text.
gradient stroke
angle
fixed
read/write
The angle of the gradient applied to the
stroke of the text.
gradient stroke
length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the stroke
of the text.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to stroke of the text, or the center
point of a radial gradient applied to the
stroke of the text.
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal offset
fixed
read only
The horizontal location of the left edge
of the first character in the text, in page
coordinates, relative to the current zero
point.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
286
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
index
integer
read only
index of the object within its parent
object.
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
length
integer
read only
The number of characters in the text
object.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
InDesign CS Scripting Guide
AppleScript Reference
287
Property:
Type:
Access:
Description:
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
paragraph
read only
An object reference to the object.
open type features
list of long
read/write
open type features
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
parent story
story
read only
The story containing the text object.
parent text frame
text frame
read only
The text frame containing the text object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
swatch or string
read/write
The gap color of the paragraph rule above.
288
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
InDesign CS Scripting Guide
AppleScript Reference
289
Property:
Type:
Access:
Description:
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list of objects
read/write
A list of all of the properties of all of the
tab stops on this paragraph. Can return:
list of record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
290
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
Methods
Method:
apply style
changecase
convert to table
create outlines
delete
Parameters:
Name:
Type:
Description:
using
character style, paragraph style, or string
The paragraph style
or character style to
apply.
[clearing overrides]
boolean
If true, clear any local formatting in the
text object before
applying the style.
Name:
Type:
Description:
using
uppercase, lowercase, titlecase, sentencecase
Case option to use.
Name:
Type:
Description:
[column separator]
string
The character to
interpret as the
column separator.
[row separator]
string
The character to
interpret as the row
separator.
[number of
columns]
integer
The number of
columns in the table
(only used if the
column and row
separators are the
same).
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original text.
None
Return:
Description:
nothing
Apply a paragraph or character
style to the text object.
nothing
Change the case of text.
table
Convert the text to a table. The
parameters for this command
correspond to the options
in the Convert text to table
dialog box (select some text
and choose table>Convert text
to table to display this dialog
box).
objects
Create outlines from the text.
If you set the delete original
parameter to true, InDesign
will delete the original text and
insert the character outlines as
an inline graphic; if the delete
original parameter is false, InDesign creates an independent
graphic and places it above the
text.
nothing
Deletes the object.
InDesign CS Scripting Guide
AppleScript Reference
291
Method:
export
markup
move
place
292
Parameters:
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The full path to the
exported file.
[showing options]
boolean
If true, display the
Export dialog box.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
using
XML element
The XML element
to associate with the
text.
Name:
Type:
Description:
to
before, after, at beginning, at end
Where to move the
text, relative to the
reference object
(before/after).
[reference]
object
A text object that
specifies the destination of the text
you’re moving.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The location (in
page coordinates) at
which to place the
incoming file.
[destination layer]
layer or layer name as string
The layer on which
to place the incoming file.
[showing options]
boolean
If true, display the
import options
dialog box for the
file type being
placed.
[autoflowing]
boolean
If true, autoflow the
incoming text.
[retaining formatting]
boolean
If true, retain the
formatting of the incoming text. If false,
place the text using
the document’s default text formatting
attributes.
[converting
quotes]
boolean
If true, convert typewriter
(“straight”) quotation marks to typographic (“curly”)
quotation marks.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Export the object to a file.
nothing
Associate the text with an XML
element while preserving the
existing text content.
nothing
Moves the text.
object
Place a file.
Method:
search
select
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
InDesign CS Scripting Guide
Selects text.
AppleScript Reference
293
paragraph style
Elements
Element:
Refer to by:
nested style
index, name, range, relative, test
tab stop
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
based on
paragraph style or nothing
read/write
The paragraph style this style is based on.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
294
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
id
integer
read only
A unique number identifying the object.
imported
boolean
read only
Whether this style was imported from
another document
index
integer
read only
index of the paragraph style within its
parent document or application
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
InDesign CS Scripting Guide
AppleScript Reference
295
Property:
Type:
Access:
Description:
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
label
string
read/write
A label that can be set to any string
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
name
string
read/write
The name of the paragraph style.
296
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
next style
paragraph style
read/write
The style of the next paragraph. Note that
this property only applies when you are
entering text--if you are not entering text,
setting this property to a given paragraph
style will not affect the style applied to the
next paragraph.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
paragraph style
read only
An object reference to the object.
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
swatch or string
read/write
The gap color of the paragraph rule above.
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
InDesign CS Scripting Guide
AppleScript Reference
297
Property:
Type:
Access:
Description:
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
298
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list of objects
read/write
A list of all of the properties of all of the
tab stops on this paragraph style. Can
return: list of record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
InDesign CS Scripting Guide
AppleScript Reference
299
Property:
Type:
Access:
Description:
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
paragraph
style
Create a new paragraph style.
extract label
insert label
make
300
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
AppleScript Reference
InDesign CS Scripting Guide
pasteboard preference
Properties
Property:
Type:
Access:
Description:
bleed guide color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of bleed guides. Can return: list
of 3 fixed or light blue/red/green/blue/yellow/magenta/cyan/gray/black/orange/
dark green/teal/tan/brown/violet/gold/
dark blue/pink/lavender/brick red/olive
green/peach/burgundy/grass green/ochre/
purple/light ...
class
type
read only
The class of the object.
minimum space
above and below
fixed or measurement string
read/write
The minimum space above and below a
page.
object reference
pasteboard preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
pasteboard color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of the pasteboard.
preview background color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of the preview background. Can
return: list of 3 fixed or light blue/red/
green/blue/yellow/magenta/cyan/gray/
black/orange/dark green/teal/tan/brown/
violet/gold/dark blue/pink/lavender/brick
red/olive green/peach/burgundy/grass
green/ochre/pur...
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
slug guide color
list of fixed {r, g, b} or light blue, red, green, blue, yellow, magenta, cyan,
gray, black, orange, dark green, teal, tan, brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach, burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
read/write
The color of slug guides. Can return: list
of 3 fixed or light blue/red/green/blue/yellow/magenta/cyan/gray/black/orange/
dark green/teal/tan/brown/violet/gold/
dark blue/pink/lavender/brick red/olive
green/peach/burgundy/grass green/ochre/
purple/light g...
InDesign CS Scripting Guide
AppleScript Reference
301
path
Elements
Element:
Refer to by:
path point
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
entire path
list of fixed or measurement strings
read/write
The positions of all of the anchor points
on the path.
index
integer
read only
index of the path within its parent page
item, oval, rectangle, graphic line, text
frame, polygon, clipping path settings or
text wrap preference
object reference
path
read only
An object reference to the object.
parent
object
read only
The parent of the object.
path type
open path, closed path
read/write
The path type (open or closed).
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
make
None
path
Create a new path.
reverse
None
nothing
Reverse the path
302
AppleScript Reference
InDesign CS Scripting Guide
path point
Properties
Property:
Type:
Access:
Description:
anchor
list of fixed or measurement strings {x, y}
read/write
The location of the anchor point, in page
coordinates.
class
type
read only
The class of the object.
index
integer
read only
index of the path point within its parent
path
left direction
list of fixed or measurement strings {x, y}
read/write
The location of the incoming (left) direction point (or “control handle”).
object reference
path point
read only
An object reference to the object.
parent
path
read only
The parent of the object.
point type
line type, smooth, corner
read/write
The type of the point (corner/smooth).
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right direction
list of fixed or measurement strings {x, y}
read/write
The location of the outgoing (right) direction point (or “control handle”).
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
make
None
path point
Create a new path point.
InDesign CS Scripting Guide
AppleScript Reference
303
PDF
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
clipping path
clipping path settings
read only
The clipping path settings
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
image type name
string
read only
The type of image
index
integer
read only
index of the pdf within its parent XML element, page item, oval, rectangle, polygon,
graphic line, state, group or button
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item link
link
read only
link to a placed file
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
304
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
nonprinting
boolean
read/write
Whether the page item is non-printing
object reference
PDF
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
InDesign CS Scripting Guide
AppleScript Reference
305
Method:
export
extract label
insert label
markup
move
place
place xml
306
Parameters:
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
using
XML element
The element to mark
up.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current location.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point at which
to place the file.
[destination layer]
layer or layer name as string
The layer on which
to place the file.
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
If true, convert
straight quotes
to typographer’s
quotes.
Name:
Type:
Description:
using
XML element
The element to place
into.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Export the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
nothing
Markup layout content with
XML preserving the existing
content.
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
Method:
resize
rotate
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The horizontal scaling percentage.
[vertical scale]
fixed
The vertical scaling
percentage.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
Angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to rotate
around.
[considering current rotation]
boolean
If true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
If true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
If true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
InDesign CS Scripting Guide
AppleScript Reference
307
Method:
shear
store
unlink
308
Parameters:
Name:
Type:
Description:
by
number
Angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to shear
around.
[considering current shear]
boolean
If true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
If true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Shear the page item.
asset
Store a page item in a library.
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
PDF export preference
Properties
Property:
Type:
Access:
Description:
acrobat compatibility
acrobat 4, acrobat 5, acrobat 6
read/write
The version of Acrobat to use for the
exported pdf.
applied flattener
preset
flattener preset
read/write
The flattener preset
bleed bottom
fixed or measurement string
read/write
Bleed amount to add at the bottom of the
page.
bleed inside
fixed or measurement string
read/write
Bleed amount to add at the inside of the
page.
bleed marks
boolean
read/write
Adds fine rules that define the bleed area
outside the page size.
bleed outside
fixed or measurement string
read/write
Bleed amount to add at the outside of the
page.
bleed top
fixed or measurement string
read/write
Bleed amount to add at the top of the page.
change security
password
string
read/write
The password required to change the
security settings of the exported pdf. You
can only set this value. Getting the value
will always fail.
class
type
read only
The class of the object.
color bars
boolean
read/write
If true, print small squares of filled with
CMYK inks and tints of gray outside the
page area (in the bleed area).
color bitmap compression
none, auto compression, JPEG, zip, JPEG 2000
read/write
The type of compression (if any) to apply
to color bitimap images in the exported
pdf.
color bitmap
quality
minimum, low, medium, high, maximum, four bit, eight bit
read/write
The quality of the color bitmap images in
the exported pdf.
color bitmap
sampling
none, downsample, subsample, bicubic downsample
read/write
The type of resampling to apply to color
bitmap images (if any).
color bitmap sampling DPI
integer
read/write
The resolution for resampling color bitmap images, in dots (pixels) per inch.
color tile size
integer
read/write
color tile size for JPEG 2000 compression.
compress text and
line art
boolean
read/write
If true, compress text and line art using
ZIP compression.
compression type
Compress None, Compress Structure, Compress Objects
read/write
The type of compression to apply to the
pdf file.
content to embed
Use Object Settings, Link All, Embed All
read/write
The interactive content to embed in the
pdf file.
crop images to
frames
boolean
read/write
Export only image data that falls within
the visible portion of the frame.
crop marks
boolean
read/write
Adds fine horizontal and vertical rules
that define where the page should be
trimmed.
disallow changing
boolean
read/write
If true, the exported pdf will not be editable.
disallow copying
boolean
read/write
If true, objects in the exported pdf cannot
be copied.
disallow document
assembly
boolean
read/write
If true, disallow document assembly in the
exported pdf.
disallow extraction
for accessibility
boolean
read/write
If true, the user will not be able to extract
content for accessiblity in the exported
pdf.
disallow form
fill in
boolean
read/write
If true, do not allow the user to change
form fields in the exported pdf.
InDesign CS Scripting Guide
AppleScript Reference
309
Property:
Type:
Access:
Description:
disallow hi res
printing
boolean
read/write
If true, disable high resolution printing in
the exported pdf.
disallow notes
boolean
read/write
If true, the user will not be allowed to add
annotations to the exported pdf.
disallow plaintext
metadata
boolean
read/write
If true, the user will not be able to add
plain text metadata to the exported pdf.
disallow printing
boolean
read/write
If true, the user will not be able to print
the exported pdf.
export guides and
grids
boolean
read/write
If true, export the guides and grids to to
the pdf.
export layers
boolean
read/write
If true, export layers to the pdf.
export nonprinting
objects
boolean
read/write
If true, export non-printing objects to the
pdf.
export reader
spreads
boolean
read/write
If true, export pages together as if they
were bound on the same sheet.
generate thumbnails
boolean
read/write
If true, generate thumbnails for each page
or spread.
Gray tile size
integer
read/write
Gray tile size for JPEG 2000 compression.
grayscale bitmap
compression
none, auto compression, JPEG, zip, JPEG 2000
read/write
The type of compression applied to grayscale bitmap images.
grayscale bitmap
quality
minimum, low, medium, high, maximum, four bit, eight bit
read/write
The quality setting for grayscale bitmap
quality.
grayscale bitmap
sampling
none, downsample, subsample, bicubic downsample
read/write
The type of resampling to apply to grayscale bitmap images (if any).
grayscale bitmap
sampling DPI
integer
read/write
The resolution for resampling grayscale
bitmap images, in dots (pixels) per inch.
ignore spread overrides
boolean
read/write
If true, ignore flattener spread overrides.
include bookmarks
boolean
read/write
If true, to include bookmarks in the pdf.
include hyperlinks
boolean
read/write
If true, include hyperlinks in the pdf.
include ICC
profiles
boolean
read/write
If true, embed ICC profiles in the pdf.
include slug with
PDF
boolean
read/write
If true, include the slug area in the pdf.
include structure
boolean
read/write
If true, include the XML structure in the
pdf.
interactive elements
boolean
read/write
If true, include interactive elements (movies, sounds, push buttons) in the pdf.
monochrome bitmap compression
none, CCIT3, CCIT4, zip, run length
read/write
The type of compression to apply to
monochrome bitmap images.
monochrome bitmap sampling
none, downsample, subsample, bicubic downsample
read/write
The type of resampling to apply to monochrome bitmap images.
monochrome
bitmap sampling
DPI
integer
read/write
The resampling resolution to use for
monochrome bitmap images, in dots
(pixels) per inch.
object reference
PDF export preference
read only
An object reference to the object.
omit bitmaps
boolean
read/write
If true, omit bitmap images in the pdf (but
include OPI link information for the omitted images).
omit EPS
boolean
read/write
If true, omit epss graphics in the pdf (but
include OPI link information for the omitted graphics).
omit PDF
boolean
read/write
If true, omit pdf graphics in the pdf (but
include OPI link information for the omitted graphics).
310
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
open document
password
string
read/write
The password requested when the user
opens the exported pdf. You can only set
this value. Getting the value will always
fail.
optimize PDF
boolean
read/write
If true, optimize the exported pdf.
output condition
custom, CGATSTR001, or string
read/write
pdf/X output condition.
page information
marks
boolean
read/write
Prints the filename, page number, current
date and time and color separation name
in the bleed area of the pdf.
page marks offset
fixed or measurement string
read/write
The distance from the edge of the page at
which InDesign draws page marks.
page range
string or ‘all’
read/write
The range of pages to export.
parent
object
read only
The parent of the object.
PDF color space
RGB, CMYK, unchanged color space
read/write
Specifies how to represent the color information in the exported pdf.
PDF destination
profile
string
read/write
Destination color profile.
PDF mark type
default
read/write
The type of pdf printer’s mark to use.
PDF X profile
string
read/write
pdf X color profile, either idpdfProfileSelector or a string.
printer mark
weight
p125pt, p25pt, p50pt, p10mm, p15mm, p20mm, p30mm
read/write
The weight of the printer marks.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
registration marks
boolean
read/write
If true, add small ‘targets’ outside the page
area for aligning separations.
simulate overprint
boolean
read/write
If true, simulate overprinting in the pdf.
standards compliance
none, PDFX1a2001 standard, PDFX32002 standard
read/write
pdf/X Standards compliance.
subset fonts below
integer
read/write
The threshold at which InDesign embeds
all characters of a font (0% downloads all
of the characters in the font; 100% downloads only the characters actually used in
the document).
threshold to compress color
integer
read/write
Dots (pixels) per inch threshold at which
color bitmap images will be compressed.
threshold to compress gray
integer
read/write
Dots (pixels) per inch threshold at which
grayscale bitmap images will be compressed.
threshold to compress monochrome
integer
read/write
Dots (pixels) per inch threshold at which
monochrome bitmap images will be
compressed.
use document
bleed with PDF
boolean
read/write
If true, use the document bleed area in
the pdf.
use security
boolean
read/write
If true, use the security settings when
exporting a pdf.
view PDF
boolean
read/write
If true, open the pdf file after exporting.
InDesign CS Scripting Guide
AppleScript Reference
311
PDF export preset
Properties
Property:
Type:
Access:
Description:
acrobat compatibility
acrobat 4, acrobat 5, acrobat 6
read/write
What version of Acrobat the pdf is compatible with
applied flattener
preset
flattener preset
read/write
The flattener preset
bleed bottom
fixed or measurement string
read/write
Amount to image below the defined page
size
bleed inside
fixed or measurement string
read/write
Amount to image inside the defined page
size
bleed marks
boolean
read/write
Adds fine rules that define the amount
of extra area to image outside the define
page size
bleed outside
fixed or measurement string
read/write
Amount to image outside the defined page
size
bleed top
fixed or measurement string
read/write
Amount to image above the defined page
size
class
type
read only
The class descriptor type
color bars
boolean
read/write
Adds small squares of color representing
the CMYK inks and tints of gray in 10%
increments
color bitmap compression
none, auto compression, JPEG, zip, JPEG 2000
read/write
color bitmap compression
color bitmap
quality
minimum, low, medium, high, maximum, four bit, eight bit
read/write
color bitmap quality
color bitmap
sampling
none, downsample, subsample, bicubic downsample
read/write
The kind of resampling to apply to color
bitmap images
color bitmap sampling DPI
integer
read/write
The resolution for resampling
color tile size
integer
read/write
color tile size for JPEG 2000 compression.
compress text and
line art
boolean
read/write
Whether to compress text and line art
using ZIP compression
compression type
Compress None, Compress Structure, Compress Objects
read/write
The type of compression to apply to the
pdf file.
content to embed
Use Object Settings, Link All, Embed All
read/write
The interactive content to embed in the
pdf file.
crop images to
frames
boolean
read/write
Export only image data that falls within
the visible portion of the frame
crop marks
boolean
read/write
Adds fine horizontal and vertical rules
that define where the page should be
trimmed
export guides and
grids
boolean
read/write
Whether to include visible guides and
baseline grids in the pdf
export layers
boolean
read/write
Whether to include layers in the pdf.
export nonprinting
objects
boolean
read/write
Whether to include non-printing objects
in the pdf
export reader
spreads
boolean
read/write
Whether to export pages together as if
they were bound on the same sheet
generate thumbnails
boolean
read/write
Generate thumbnails for each page or
spread
Gray tile size
integer
read/write
Gray tile size for JPEG 2000 compression.
grayscale bitmap
compression
none, auto compression, JPEG, zip, JPEG 2000
read/write
Grayscale bitmap compression
312
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
grayscale bitmap
quality
minimum, low, medium, high, maximum, four bit, eight bit
read/write
Grayscale bitmap quality
grayscale bitmap
sampling
none, downsample, subsample, bicubic downsample
read/write
The kind of resampling to apply to grayscale bitmap images
grayscale bitmap
sampling DPI
integer
read/write
The resolution for resampling
ignore spread overrides
boolean
read/write
Whether to ignore flattener spread overrides
include bookmarks
boolean
read/write
Whether to include bookmarks in the pdf
include hyperlinks
boolean
read/write
Whether to include hyperlinks in the pdf
include ICC
profiles
boolean
read/write
Whether to embed ICC profiles in the
exported pdf
include slug with
PDF
boolean
read/write
Whether to include the slug area in the
pdf.
include structure
boolean
read/write
Whether to include structure in the pdf
index
integer
read only
index of the pdf export preset within its
parent application
interactive elements
boolean
read/write
Whether to include interactive elements
in the pdf
monochrome bitmap compression
none, CCIT3, CCIT4, zip, run length
read/write
Monochrome bitmap compression
monochrome bitmap sampling
none, downsample, subsample, bicubic downsample
read/write
The kind of resampling to apply to monochrome bitmap images
monochrome
bitmap sampling
DPI
integer
read/write
The resolution for resampling
name
string
read/write
The name of the pdf export preset
object reference
PDF export preset
read only
An object reference for this pdf export
preset
omit bitmaps
boolean
read/write
Replace bitmap images with OPI links
omit EPS
boolean
read/write
Replace epss images with OPI links
omit PDF
boolean
read/write
Replace pdf images with OPI links
optimize PDF
boolean
read/write
Whether to optimize the exported pdf
output condition
custom, CGATSTR001 or string
read/write
pdf/X output condition. Can return:
custom/CGATSTR001 or string.
page information
marks
boolean
read/write
Prints the filename, page number, current
date and time and color separation name
page marks offset
fixed or measurement string
read/write
How far from the edge of the page InDesign will draw page marks
parent
object
read only
The pdf export preset’s parent
PDF color space
RGB, CMYK, unchanged color space
read/write
Specifies how to represent the color information in the exported pdf
PDF destination
profile
string
read/write
Destination color profile
PDF mark type
default
read/write
The type of pdf printer’s mark to use
PDF X profile
string
read/write
pdf X color profile. Can return: use no
profile/use monitor profile/use composite
profile/use separation profile or string.
printer mark
weight
p125pt, p25pt, p50pt, p10mm, p15mm, p20mm, p30mm
read/write
The weight of the printer mark
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
registration marks
boolean
read/write
Adds small ‘targets’ outside the page area
for aligning the different separations
simulate overprint
boolean
read/write
Whether to simulate overprint
InDesign CS Scripting Guide
AppleScript Reference
313
Property:
Type:
Access:
Description:
standards compliance
none, PDFX1a2001 standard, PDFX32002 standard
read/write
pdf/X Standards compliance
subset fonts below
integer
read/write
The threshold point at which InDesign
embeds all characters of a font
threshold to compress color
integer
read/write
Dots per inch threshold which causes
color image compression.
threshold to compress gray
integer
read/write
Dots per inch threshold which causes gray
image compression.
threshold to compress monochrome
integer
read/write
Dots per inch threshold which causes
monochrome image compression.
use document
bleed with PDF
boolean
read/write
Whether to use the document bleed area
in the pdf.
view PDF
boolean
read/write
Whether to open the pdf file after exporting
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
make
None
pdf export
preset
Create a new pdf export preset.
314
AppleScript Reference
InDesign CS Scripting Guide
PDF place preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
object reference
PDF place preference
read only
An object reference to the object.
open document
password
string
read/write
The password required to open the pdf.
page number
integer
read/write
The page of the pdf to place.
parent
object
read only
The parent of the object.
PDF crop
crop content, crop art, crop PDF, crop trim, crop bleed, crop media
read/write
Specifies the bounding box of the pdf to
use when importing the pdf page.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
transparent background
boolean
read/write
If true, the background of the pdf is
transparent.
InDesign CS Scripting Guide
AppleScript Reference
315
percent combobox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
edit value
fixed
read/write
Real number value of the editbox or combobox. For measurement controls, this
value is in points. For percentage controls,
a value of 100 equals 100%
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the percent combobox within
its parent dialog column, dialog row,
enabling group or border panel
large nudge
fixed
read/write
The amount that the value of the control
changes when you hold down Shift and
press the uo or down arrow keys (while
editing the value in the control). If you do
not set a value for this property, the value
of the control will not change when you
hold down Shift and press the up or down
arrow keys.
maximum value
fixed
read/write
The maximum value for this control.
min width
fixed
read/write
The minimum width of the control.
minimum value
fixed
read/write
The minimum value for this control.
object reference
percent combobox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
small nudge
fixed
read/write
The amount that the value of the control
changes when you press the up and down
arrow keys while editing the value in the
control. If you do not set a value for this
property, the value of the control will not
change when you press the up or down
arrow keys.
string list
list of strings
read/write
A list of the strings that appear on the
menu of the control.
Methods
Method:
Parameters:
Return:
Description:
make
None
percent combobox
Create a new percent combobox.
316
AppleScript Reference
InDesign CS Scripting Guide
percent editbox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
edit value
fixed
read/write
Real number value of the editbox or combobox. For measurement controls, this
value is in points. For percentage controls,
a value of 100 equals 100%
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the percent editbox within its
parent dialog column, dialog row, enabling group or border panel
large nudge
fixed
read/write
The amount that the value of the control
changes when you hold down Shift and
press the uo or down arrow keys (while
editing the value in the control). If you do
not set a value for this property, the value
of the control will not change when you
hold down Shift and press the up or down
arrow keys.
maximum value
fixed
read/write
The maximum value for this control.
min width
fixed
read/write
The minimum width of the control.
minimum value
fixed
read/write
The minimum value for this control.
object reference
percent editbox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
small nudge
fixed
read/write
The amount that the value of the control
changes when you press the up and down
arrow keys while editing the value in the
control. If you do not set a value for this
property, the value of the control will not
change when you press the up or down
arrow keys.
Methods
Method:
Parameters:
Return:
Description:
make
None
percent editbox
Create a new percent editbox.
InDesign CS Scripting Guide
AppleScript Reference
317
PICT
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
clipping path
clipping path settings
read only
The clipping path settings
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
image type name
string
read only
The type of image
index
integer
read only
index of the pictt within its parent XML
element, page item, oval, rectangle, polygon, graphic line, state, group or button
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item link
link
read only
link to a placed file
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
318
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
nonprinting
boolean
read/write
Whether the page item is non-printing
object reference
PICT
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
InDesign CS Scripting Guide
AppleScript Reference
319
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
nothing
Export the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
object
Place a file.
export
extract label
insert label
move
place
320
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current location.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point at which
to place the file.
[destination layer]
layer or layer name as string
The layer on which
to place the file.
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
If true, convert
straight quotes
to typographer’s
quotes.
AppleScript Reference
InDesign CS Scripting Guide
Method:
resize
rotate
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The horizontal scaling percentage.
[vertical scale]
fixed
The vertical scaling
percentage.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
Angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to rotate
around.
[considering current rotation]
boolean
If true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
If true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
If true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
InDesign CS Scripting Guide
AppleScript Reference
321
Method:
shear
store
unlink
322
Parameters:
Name:
Type:
Description:
by
number
Angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to shear
around.
[considering current shear]
boolean
If true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
If true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
Library
The library in which
to store.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Shear the page item.
asset
Store a page item in a library.
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
polygon
Elements
Element:
Refer to by:
EPS
index, name, range, relative, test, id
graphic
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
image
index, name, range, relative, test, id
movie
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
path
index, name, range, relative, test
PDF
index, name, range, relative, test, id
PICT
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
sound
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
text path
index, name, range, relative, test, id
WMF
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items within this page
item, regardless of their position in the
object hierarchy (i.e., page items inside
groups or inside other page items will be
included).
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
content type
unassigned, graphic type, text type
read/write
The type of content
corner effect
none, rounded corner, inverse rounded corner, inset corner, bevel corner,
fancy corner
read/write
The corner effect applied to the page item.
This property corresponds to the Effect
pop-up menu in the Corner Effects dialog
box.
InDesign CS Scripting Guide
AppleScript Reference
323
Property:
Type:
Access:
Description:
corner radius
fixed
read/write
The radius of the corner effect applied to
the page item. This property corresponds
to the Size field in the Corner Effects
dialog box.
end cap
butt end cap, round end cap, projecting end cap
read/write
The appearance of the end points of an
open path. This property corresponds to
the End Cap options in the Stroke palette.
end join
miter end join, round end join, bevel end join
read/write
The appearance of the stroke at corner
points. This property corresponds to the
End Join options in the Stroke palette.
This property has no effect on smooth (or
“curve”) points on a path.
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the page item.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the page item (-1 indicates 100%, or no
override).
gap color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the gap of the stroke of the
page item.
gap tint
fixed
read/write
The tint percentage applied to the gap of
the stroke of the page item (-1 indicates
100%, or no override).
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
gradient fill angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient fill length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the fill of the page
item.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied to the fill of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
gradient stroke
angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient stroke
length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the stroke of the page
item.
324
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied
to the stroke of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the polygon within its parent
spread, master spread, page item, oval,
rectangle, polygon, graphic line, group,
state, document, layer, page, button, text
frame, story, text, character, word, line,
text column, paragraph, text style range,
cell...
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item layer
layer
read/write
The layer containing the page item.
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
left line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the first
(or “left) point of an open path.
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
locked
boolean
read/write
If true, the page item is locked.
miter limit
fixed
read/write
Defines the point at which a corner point
switches from a mitered (pointed) join to
a beveled (squared-off) join. If the width
of the stroke at a corner point would be
wider than this value times the stroke
weight, InDesign applies a beveled join to
the corner.
nonprinting
boolean
read/write
If true, the page item is non-printing.
object reference
polygon
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
overprint fill
boolean
read/write
If true, the fill of the page item will
overprint.
overprint gap
boolean
read/write
If true, overprint the gap color applied to
the stroke of the page item.
overprint stroke
boolean
read/write
If true, overprint the stroke of the page
item.
overridden
boolean
read only
If true, this page item originated on a
master spread and was later overridden
(i.e., copied to the document page). It is
still linked to the page item on the master
spread.
InDesign CS Scripting Guide
AppleScript Reference
325
Property:
Type:
Access:
Description:
overridden master
page item
page item
read only
A reference to the master page item linked
to the page item (if any).
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the last
(“right”) point of an open path.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
stroke alignment
center alignment, inside alignment, outside alignment
read/write
This property controls the way that the
stroke of a path is drawn relative to the
path, and corresponds to the Stroke Alginment options in the Stroke palette.
stroke color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the stroke of the page item.
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The method used to adjust the position
of dashes and gaps on a dashed stroke
around corner points on a path. This
property corresponds to the Corners popup menu in the Stroke palette (only visible
when a dashed stroke is selected).
stroke dash and
gap
list of fixed or measurement strings {dash, gap, ...}
read/write
The dash and gap settings of a dashed line.
A list of up to 6 values.
326
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
stroke tint
fixed
read/write
The tint percentage applied to the stroke
of the page item (-1 indicates 100%, or no
override).
stroke type
stroke style
read/write
The stroke type applied to the page item-either one of the default stroke types, or
the name of a custom stroke style.
stroke weight
fixed
read/write
The weight (in points) of the stroke applied to the page item.
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
add path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Return:
Description:
page item
Create a new shape by adding
the path(s) of this object with
the paths of other objects. This
method corresponds to the
Add path operation (Objects>P
athfinder>Add).
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
page item
Creates a new shape by excluding area of intersection of this
object with the other objects.
This method corresponds
to the Exclude Overlap path
operation (Objects>Pathfinder
>Exclude Overlap).
nothing
Exports the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Fit content within a graphic
frame.
exclude overlap
path
Name:
Type:
Description:
with
list of objects
The objects to
exclude.
export
Name:
Type:
Description:
format
string (name of export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
extract label
fit
InDesign CS Scripting Guide
AppleScript Reference
327
Method:
insert label
Parameters:
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
with
list of objects
The objects to intersect with.
Name:
Type:
Description:
[layer]
layer or layer name as string
The layer on which
to create the polygon as layer.
[number of sides]
integer
The number of sides
for the polygon as
integer.
[inset percentage]
fixed
The star inset
percentage for the
polygon as integer.
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after this
polygon or at the beginning/end of this
document, spread,
Master spread,
page or layer as
document, spread,
master spread, page
or layer.
make compound
path
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
markup
Name:
Type:
Description:
using
XML element
The element to mark
up.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
intersect path
make
minus back
move
328
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Sets the string associated with
the given key (label name).
page item
Create a new shape based on
the area of intersection of this
object and other objects. This
method corresponds to the
Intersect path operation (Objec
ts>Pathfinder>Intersect).
polygon
Create a new polygon.
page item
Create a compound path by
adding the paths of this object
to the paths of other objects.
This method corresponds
to the Object>Compound
paths>Make command.
nothing
Markup layout content with
XML preserving the existing
content.
page item
Create a new shape by reverse
subtracting this object from
other objects. This method
corresponds to the Minus Back
path operation (Objects>Pathfi
nder>Minus Back).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
Method:
override
place
place xml
Parameters:
Name:
Type:
Description:
destination page
page
The page on which
to override the master page item.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
Name:
Type:
Description:
using
XML element
The element to place
into.
Return:
Description:
page item
Overrides an item from the
master page and places it on
the page.
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
release compound
path
None
objects
release compound path.
remove override
None
nothing
Removes a locally overriden
master page item
reset scaling
None
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
InDesign CS Scripting Guide
AppleScript Reference
329
Method:
resize
rotate
select
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to rotate
around, either one
of the enums or an
x,y value.
[considering current rotation]
boolean
if true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
if true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
if true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
nothing
Select this polygon.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
330
AppleScript Reference
InDesign CS Scripting Guide
Method:
shear
store
subtract path
unlink
Parameters:
Name:
Type:
Description:
by
number
angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to shear
around, either one
of the enums or an
x,y value.
[considering current shear]
boolean
if true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
if true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
if true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
Return:
Description:
nothing
Shear the page item.
asset
Store a page item in a library.
page item
Create a new shape by subtracting the area of intersection of
this object and other objects
from the other objects. This
method corresponds to the
Subtract path operation (Objec
ts>Pathfinder>Subtract).
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
InDesign CS Scripting Guide
AppleScript Reference
331
polygon preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
inset percentage
integer
read/write
The default star inset percentage for new
polygons.
number of sides
integer
read/write
The default number of sides for new
polygons.
object reference
polygon preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
332
AppleScript Reference
InDesign CS Scripting Guide
print preference
Properties
Property:
Type:
Access:
Description:
active printer
preset
printer preset or printer preset name as string
read/write
Current preset. Can return: default/custom or printer preset.
all printer marks
boolean
read/write
If true, print all types of printer’s marks.
black angle
fixed
read/write
The halftone screen angle used to prin
black ink.
black frequency
fixed
read/write
The halftone screen frequency of the black
ink.
bleed bottom
fixed or measurement string
read/write
Bleed amount to add at the bottom of the
page.
bleed inside
fixed or measurement string
read/write
Bleed amount to add at the inside of the
page.
bleed marks
boolean
read/write
If true, add fine rules that define the bleed
area outside the page size.
bleed outside
fixed or measurement string
read/write
Bleed amount to add at the outside of the
page.
bleed top
fixed or measurement string
read/write
Bleed amount to add at the top of the page.
class
type
read only
The class of the object.
collating
boolean
read/write
If true, printed copies will be collated.
color bars
boolean
read/write
If true, print small squares of filled with
CMYK inks and tints of gray outside the
page area (in the bleed area).
color output
composite leave unchanged, composite gray, composite RGB, composite
CMYK, separations, inRIP separations
read/write
The color output mode used to print.
composite angle
fixed
read/write
The halftone screen angle used to print
composite gray ink.
composite frequency
fixed
read/write
The halftone screen frequency used to
print composite gray ink.
copies
integer
read/write
The number of copies to print.
CRD
string
read/write
The color-rendering dictionary to use.
Either one the CRD constants or a CRD
name.
crop marks
boolean
read/write
If true, InDesign prints fine horizontal
and vertical rules that indicate where the
page should be trimmed.
cyan angle
fixed
read/write
The halftone screen angle used to print
cyan ink.
cyan frequency
fixed
read/write
The halftone screen frequency of the cyan
ink.
data format
ASCII, binary
read/write
The format of data sent to the printer
(binary or ASCII).
download PPD
fonts
boolean
read/write
If true, download fonts listed in the
selected PPD.
flattener preset
name
string
read/write
The transparency flattener preset name
flip
none, horizontal, vertical, horizontal and vertical
read/write
The type of flip.
font downloading
none, complete, subset, subset large
read/write
The method used to download fonts to the
printer.
ignore spread overrides
boolean
read/write
If true, ignore flattener spread overrides.
include slug to
print
boolean
read/write
If true, print the slug area.
InDesign CS Scripting Guide
AppleScript Reference
333
Property:
Type:
Access:
Description:
intent
use color settings, perceptual, saturation, relative colorimetric, absolute
colorimetric
read/write
The rendering intent.
magenta angle
fixed
read/write
The halftone screen angle used to print
magenta ink.
magenta frequency
fixed
read/write
The halftone screen frequency of the
magenta ink.
mark line weight
p125pt, p25pt, p50pt, p05mm, p07mm, p10mm, p15mm, p20mm, p30mm
read/write
line weight of the printer’s marks.
mark offset
fixed
read/write
Amount to offset the page marks from the
edge of the defined page size.
mark type
default
read/write
The type of printer’s mark to use.
negative
boolean
read/write
If true, print as negative.
object reference
print preference
read only
An object reference to the object.
omit bitmaps
boolean
read/write
If true, omit bitmap images in the pdf (but
include OPI link information for the omitted images).
omit EPS
boolean
read/write
If true, omit epss graphics in the pdf (but
include OPI link information for the omitted graphics).
omit PDF
boolean
read/write
If true, omit pdf graphics in the pdf (but
include OPI link information for the omitted graphics).
OPI image replacement
boolean
read/write
If true, use OPI comments to print linked
graphics.
page information
marks
boolean
read/write
If true, print the filename, page number,
current date and time and color separation name in the bleed area.
page position
upper left, center horizontally, center vertically, centered
read/write
Where to position the page relative to the
paper dimensions.
page range
string or ‘all’
read/write
The range of pages to print.
paper gap
fixed
read/write
The amount of custom paper gap.
paper height
defined by driver or custom (constants) or fixed or measurement string
read/write
The custom paper height. Either one of the
paper size constants or a value.
paper offset
fixed
read/write
The amount of custom paper offset.
paper size
defined by driver or custom (constants) or ‘auto’ or name of page size as string read/write
The paper size. Either one of the paper size
constants or a paper size name.
paper size list
list of string
read only
A list of the names of the available paper
sizes.
paper transverse
boolean
read/write
If true, rotate the image of the page 90
degrees when printing.
paper width
defined by driver or custom (constants) or fixed or measurement string
read/write
The custom paper width. Either one of the
paper size constants or a value (in points).
parent
object
read only
The parent of the object.
PostScript level
level 2, level 3
read/write
The level of PostScript to send to the
printer.
PPD
string
read/write
Current PPD. Either one the PPD constants or a PPD model name.
PPD list
list of strings
read only
A list of the names of the available PPDs.
print black
boolean
read/write
If true, print the black ink.
print blank pages
boolean
read/write
If true, print blank pages.
print cyan
boolean
read/write
If true, print the cyan ink.
print file
file reference or file name as string
read/write
The path to the file used when printing
to disk.
print guides grids
boolean
read/write
If true, print visible guides and baseline
grids.
print magenta
boolean
read/write
If true, print the magenta ink.
334
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
print master pages
boolean
read/write
If true, print master pages.
print nonprinting
boolean
read/write
If true, print non-printing objects.
print page orientation
portrait, landscape, reverse portrait, reverse landscape
read/write
The orientation of the printed page.
print spreads
boolean
read/write
If true, print spreads.
print yellow
boolean
read/write
If true, print the yellow ink.
printer
string
read/write
The current printer. Either to file or a
printer name.
printer list
list of strings
read only
A list of the names of available printers.
profile
string
read/write
The color profile to use. Either one the
idProfile constants or a profile name.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
registration marks
boolean
read/write
If true, add small ‘targets’ outside the page
area for aligning separations.
reverse order
boolean
read/write
If true, print in reverse order.
scale height
fixed
read/write
The vertical scaling percentage to apply
when printing.
scale mode
scale width height, scale to fit
read/write
The method used to scale the page.
scale proportional
boolean
read/write
If true, scale the width and height proportionally when printing.
scale width
fixed
read/write
The horizontal scaling percentage to apply
when printing.
screening
string
read/write
The ink screening to use.
screening list
list of strings
read only
A list of the names of the available ink
screenings in the PPD.
send image data
all image data, optimized subsampling, proxy image data, none
read/write
Sets the method used to transmit image
data to the printer.
sequence
all, odd, even
read/write
Whether to print odd pages, even pages
or both.
simulate overprint
boolean
read/write
If true, simulate overprinting in the
printed document.
source space
use document, proof space
read/write
The CMS source.
text as black
boolean
read/write
If true, print all text in black.
thumbnails
boolean
read/write
If true, print thumbnails.
thumbnails per
page
k1x2, k2x2, k3x3, k4x4, k5x5, k6x6, k7x7
read/write
Thumbnails per page: 1x2, 2x2, 3x3, 4x4,
5x5, 6x6 or 7x7.
tile
boolean
read/write
If true, tile pages when printing.
tiling overlap
fixed
read/write
The amount of tiling overlap for Auto or
Auto Justified tiling.
tiling type
auto, auto justified, manual
read/write
The type of tiling to use when printing.
trapping
off, application builtin, Adobe inRIP
read/write
The type of trapping to use.
use document
bleed to print
boolean
read/write
If true, print the document bleed area.
yellow angle
fixed
read/write
The halftone screen angle used to print
yellow ink.
yellow frequency
fixed
read/write
The frequency of the yellow ink
InDesign CS Scripting Guide
AppleScript Reference
335
printer preset
Properties
Property:
Type:
Access:
Description:
all printer marks
boolean
read/write
Whether to print all types of printer’s
marks
black angle
fixed
read/write
The angle of the black ink
black frequency
fixed
read/write
The frequency of the black ink
bleed bottom
fixed or measurement string
read/write
Amount to image below the defined page
size
bleed inside
fixed or measurement string
read/write
Amount to image inside the defined page
size
bleed marks
boolean
read/write
Adds fine rules that define the amount
of extra area to image outside the define
page size
bleed outside
fixed or measurement string
read/write
Amount to image outside the defined page
size
bleed top
fixed or measurement string
read/write
Amount to image above the defined page
size
class
type
read only
The class descriptor type
collating
boolean
read/write
Should printed copies be collated?
color bars
boolean
read/write
Adds small squares of color representing
the CMYK inks and tints of gray in 10%
increments
color output
composite leave unchanged, composite gray, composite RGB, composite
CMYK, separations, inRIP separations
read/write
The color output mode used to print
composite angle
fixed
read/write
The angle of the composite gray ink
composite frequency
fixed
read/write
The frequency of the composite gray ink
copies
integer
read/write
The number of copies of a document to be
printed
CRD
string
read/write
The color-rendering dictionary to use. Either one the CRD enumerations or a CRD
name. Can return: default/use document/
working or string.
crop marks
boolean
read/write
Adds fine horizontal and vertical rules
that define where the page should be
trimmed
cyan angle
fixed
read/write
The angle of the cyan ink
cyan frequency
fixed
read/write
The frequency of the cyan ink
data format
ASCII, binary
read/write
The format of data sent to the printer
download PPD
fonts
boolean
read/write
Whether to download PPD fonts
flattener preset
name
string
read/write
The transparency flattener preset name
flip
none, horizontal, vertical, horizontal and vertical
read/write
The type of flip
font downloading
none, complete, subset, subset large
read/write
Control how fonts are downloaded to the
printer
ignore spread overrides
boolean
read/write
Whether to ignore flattener spread overrides
include slug to
print
boolean
read/write
Whether to include the slug area to print.
index
integer
read only
index of the printer preset within its parent application
intent
use color settings, perceptual, saturation, relative colorimetric, absolute
colorimetric
read/write
The rendering intent
336
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
magenta angle
fixed
read/write
The angle of the magenta ink
magenta frequency
fixed
read/write
The frequency of the magenta ink
mark line weight
p125pt, p25pt, p50pt, p05mm, p07mm, p10mm, p15mm, p20mm, p30mm
read/write
line weight of the printer’s mark
mark offset
fixed
read/write
Amount to offset the page marks from the
edge of the defined page size
mark type
default
read/write
The type of printer’s mark to use
name
string
read/write
The name of the printer preset
negative
boolean
read/write
Whether to print as negative
object reference
printer preset
read only
An object reference for this printer preset
omit bitmaps
boolean
read/write
Replace bitmap images with OPI links
omit EPS
boolean
read/write
Replace epss images with OPI links
omit PDF
boolean
read/write
Replace pdf images with OPI links
OPI image replacement
boolean
read/write
Whether to print graphics that are either
linked using OPI comments or OPI comments stored in imported epss files
page information
marks
boolean
read/write
Prints the filename, page number, current
date and time and color separation name
page position
upper left, center horizontally, center vertically, centered
read/write
Where to position the page
paper gap
fixed
read/write
The amount of custom paper gap
paper height
defined by driver or custom (constants) or fixed or measurement string
read/write
The custom paper height. Either one of the
paper size enumerations or a value. Can
return: auto or string.
paper offset
fixed
read/write
The amount of custom paper offset
paper size
defined by driver or custom (constants) or ‘auto’ or name of page size as string read/write
The paper size. Either one of the paper size
enumerations or a paper size name. Can
return: defined by driver/custom or string.
paper size list
list of strings
read only
All available paper sizes
paper transverse
boolean
read/write
Whether to transverse the paper
paper width
defined by driver or custom (constants) or fixed or measurement string
read/write
The custom paper width. Either one of the
paper size enumerations or a value. Can
return: auto or fixed.
parent
object
read only
The printer preset’s parent
PostScript level
level 2, level 3
read/write
The level of PostScript to send to the
printer
PPD
string
read/write
Current PPD. Either one the PPD enumerations or a PPD model name. Can
return: device independent or string.
PPD list
list of strings
read only
All available PPDs
print black
boolean
read/write
Whether to print the black ink
print blank pages
boolean
read/write
Whether to print blank pages
print cyan
boolean
read/write
Whether to print the cyan ink
print file
file reference or file name as string
read/write
The path to the file used when printing
to disk
print guides grids
boolean
read/write
Whether to print visible guides and
baseline grids
print magenta
boolean
read/write
Whether to print the magenta ink
print master pages
boolean
read/write
Whether to print master pages
print nonprinting
boolean
read/write
Whether to print nonprinting objects
print page orientation
portrait, landscape, reverse portrait, reverse landscape
read/write
The orientation of the printed page
print spreads
boolean
read/write
Whether to print spreads
print yellow
boolean
read/write
Whether to print the yellow ink
printer
string
read/write
Current printer. Either to file or a printer
name. Can return: postscript file or string.
InDesign CS Scripting Guide
AppleScript Reference
337
Property:
Type:
Access:
Description:
printer list
list of strings
read only
All available printers
profile
string
read/write
The color profile to use. Either one the
idProfile enumerations or a profile
name. Can return: PostScript CMS/use
document/working or string.
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
registration marks
boolean
read/write
Adds small ‘targets’ outside the page area
for aligning the different separations
reverse order
boolean
read/write
Whether to print in reverse order
scale height
fixed
read/write
The percentage of scale to apply to the
height of a page when printing
scale mode
scale width height, scale to fit
read/write
How to scale the page
scale proportional
boolean
read/write
Whether to scale the width and height
proportionally
scale width
fixed
read/write
The percentage of scale to apply to the
width of a page when printing
screening
string
read/write
The ink screening to use. Can return:
default/custom or string.
screening list
list of strings
read only
All available ink screenings in the PPD
send image data
all image data, optimized subsampling, proxy image data, none
read/write
Controls how much image data to send to
the printer
sequence
all, odd, even
read/write
Whether to print odd pages, even pages
or both
simulate overprint
boolean
read/write
Whether to simulate overprint
source space
use document, proof space
read/write
The CMS source
text as black
boolean
read/write
Whether to print text as black
thumbnails
boolean
read/write
Whether to print thumbnails
thumbnails per
page
k1x2, k2x2, k3x3, k4x4, k5x5, k6x6, k7x7
read/write
Thumbnails per page: 1x2, 2x2, 3x3, 4x4,
5x5, 6x6 or 7x7
tile
boolean
read/write
Whether to tile pages
tiling overlap
fixed
read/write
The amount of tiling overlap for Auto or
Auto Justified tiling
tiling type
auto, auto justified, manual
read/write
The type of tiling
trapping
off, application builtin, Adobe inRIP
read/write
The type of trapping
use document
bleed to print
boolean
read/write
Whether to use the document bleed area
to print.
yellow angle
fixed
read/write
The angle of the yellow ink
yellow frequency
fixed
read/write
The frequency of the yellow ink
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
make
None
printer preset
Create a new printer preset.
338
AppleScript Reference
InDesign CS Scripting Guide
quit behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the quit behavior within its parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the quit behavior.
object reference
quit behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
quit behavior
Create a new quit behavior.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
Description:
AppleScript Reference
339
radiobutton control
Properties
Property:
Type:
Access:
Description:
checked state
boolean
read/write
If true, the radiobutton control is checked.
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the radiobutton control within its
parent radiobutton group
min width
fixed
read/write
The minimum width of the control.
object reference
radiobutton control
read only
An object reference to the object.
parent
radiobutton group
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
static label
string
read/write
The static text label of the radiobutton
control.
Methods
Method:
Parameters:
Return:
Description:
make
None
radiobutton
control
Create a new radiobutton
control.
340
AppleScript Reference
InDesign CS Scripting Guide
radiobutton group
Elements
Element:
Refer to by:
radiobutton control
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the radiobutton group within
its parent dialog column, dialog row,
enabling group or border panel
min width
fixed
read/write
The minimum width of the control.
object reference
radiobutton group
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
selected button
integer
read/write
The index of the selected radiobutton
control in the group.
Methods
Method:
Parameters:
Return:
Description:
make
None
radiobutton
group
Create a new radiobutton
group.
InDesign CS Scripting Guide
AppleScript Reference
341
real combobox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
edit value
fixed
read/write
Real number value of the editbox or combobox. For measurement controls, this
value is in points. For percentage controls,
a value of 100 equals 100%
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the real combobox within its parent dialog column, dialog row, enabling
group or border panel
large nudge
fixed
read/write
The amount that the value of the control
changes when you hold down Shift and
press the uo or down arrow keys (while
editing the value in the control). If you do
not set a value for this property, the value
of the control will not change when you
hold down Shift and press the up or down
arrow keys.
maximum value
fixed
read/write
The maximum value for this control.
min width
fixed
read/write
The minimum width of the control.
minimum value
fixed
read/write
The minimum value for this control.
object reference
real combobox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
small nudge
fixed
read/write
The amount that the value of the control
changes when you press the up and down
arrow keys while editing the value in the
control. If you do not set a value for this
property, the value of the control will not
change when you press the up or down
arrow keys.
string list
list of strings
read/write
A list of the strings that appear on the
menu of the control.
Methods
Method:
Parameters:
Return:
Description:
make
None
real combobox
Create a new real combobox.
342
AppleScript Reference
InDesign CS Scripting Guide
real editbox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
edit value
fixed
read/write
Real number value of the editbox or combobox. For measurement controls, this
value is in points. For percentage controls,
a value of 100 equals 100%
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the real editbox within its parent
dialog column, dialog row, enabling group
or border panel
large nudge
fixed
read/write
The amount that the value of the control
changes when you hold down Shift and
press the uo or down arrow keys (while
editing the value in the control). If you do
not set a value for this property, the value
of the control will not change when you
hold down Shift and press the up or down
arrow keys.
maximum value
fixed
read/write
The maximum value for this control.
min width
fixed
read/write
The minimum width of the control.
minimum value
fixed
read/write
The minimum value for this control.
object reference
real editbox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
small nudge
fixed
read/write
The amount that the value of the control
changes when you press the up and down
arrow keys while editing the value in the
control. If you do not set a value for this
property, the value of the control will not
change when you press the up or down
arrow keys.
Methods
Method:
Parameters:
Return:
Description:
make
None
real editbox
Create a new real editbox.
InDesign CS Scripting Guide
AppleScript Reference
343
rectangle
Elements
Element:
Refer to by:
EPS
index, name, range, relative, test, id
graphic
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
image
index, name, range, relative, test, id
movie
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
path
index, name, range, relative, test
PDF
index, name, range, relative, test, id
PICT
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
sound
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
text path
index, name, range, relative, test, id
WMF
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items within this page
item, regardless of their position in the
object hierarchy (i.e., page items inside
groups or inside other page items will be
included).
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
content type
unassigned, graphic type, text type
read/write
The type of content
corner effect
none, rounded corner, inverse rounded corner, inset corner, bevel corner,
fancy corner
read/write
The corner effect applied to the page item.
This property corresponds to the Effect
pop-up menu in the Corner Effects dialog
box.
344
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
corner radius
fixed
read/write
The radius of the corner effect applied to
the page item. This property corresponds
to the Size field in the Corner Effects
dialog box.
end cap
butt end cap, round end cap, projecting end cap
read/write
The appearance of the end points of an
open path. This property corresponds to
the End Cap options in the Stroke palette.
end join
miter end join, round end join, bevel end join
read/write
The appearance of the stroke at corner
points. This property corresponds to the
End Join options in the Stroke palette.
This property has no effect on smooth (or
“curve”) points on a path.
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the page item.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the page item (-1 indicates 100%, or no
override).
gap color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the gap of the stroke of the
page item.
gap tint
fixed
read/write
The tint percentage applied to the gap of
the stroke of the page item (-1 indicates
100%, or no override).
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
gradient fill angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient fill length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the fill of the page
item.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied to the fill of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
gradient stroke
angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient stroke
length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the stroke of the page
item.
InDesign CS Scripting Guide
AppleScript Reference
345
Property:
Type:
Access:
Description:
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied
to the stroke of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the rectangle within its parent
spread, master spread, page item, oval,
rectangle, polygon, graphic line, group,
state, document, layer, page, button, text
frame, story, text, character, word, line,
text column, paragraph, text style range,
ce...
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item layer
layer
read/write
The layer containing the page item.
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
left line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the first
(or “left) point of an open path.
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
locked
boolean
read/write
If true, the page item is locked.
miter limit
fixed
read/write
Defines the point at which a corner point
switches from a mitered (pointed) join to
a beveled (squared-off) join. If the width
of the stroke at a corner point would be
wider than this value times the stroke
weight, InDesign applies a beveled join to
the corner.
nonprinting
boolean
read/write
If true, the page item is non-printing.
object reference
rectangle
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
overprint fill
boolean
read/write
If true, the fill of the page item will
overprint.
overprint gap
boolean
read/write
If true, overprint the gap color applied to
the stroke of the page item.
overprint stroke
boolean
read/write
If true, overprint the stroke of the page
item.
overridden
boolean
read only
If true, this page item originated on a
master spread and was later overridden
(i.e., copied to the document page). It is
still linked to the page item on the master
spread.
346
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
overridden master
page item
page item
read only
A reference to the master page item linked
to the page item (if any).
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the last
(“right”) point of an open path.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
stroke alignment
center alignment, inside alignment, outside alignment
read/write
This property controls the way that the
stroke of a path is drawn relative to the
path, and corresponds to the Stroke Alginment options in the Stroke palette.
stroke color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the stroke of the page item.
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The method used to adjust the position
of dashes and gaps on a dashed stroke
around corner points on a path. This
property corresponds to the Corners popup menu in the Stroke palette (only visible
when a dashed stroke is selected).
stroke dash and
gap
list of fixed or measurement strings {dash, gap, ...}
read/write
The dash and gap settings of a dashed line.
A list of up to 6 values.
InDesign CS Scripting Guide
AppleScript Reference
347
Property:
Type:
Access:
Description:
stroke tint
fixed
read/write
The tint percentage applied to the stroke
of the page item (-1 indicates 100%, or no
override).
stroke type
stroke style
read/write
The stroke type applied to the page item-either one of the default stroke types, or
the name of a custom stroke style.
stroke weight
fixed
read/write
The weight (in points) of the stroke applied to the page item.
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
add path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Return:
Description:
page item
Create a new shape by adding
the path(s) of this object with
the paths of other objects. This
method corresponds to the
Add path operation (Objects>P
athfinder>Add).
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
delete
None
nothing
Deletes the object.
duplicate
None
rectangle
Duplicates the object.
page item
Creates a new shape by excluding area of intersection of this
object with the other objects.
This method corresponds
to the Exclude Overlap path
operation (Objects>Pathfinder
>Exclude Overlap).
nothing
Exports the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Fit content within a graphic
frame.
exclude overlap
path
Name:
Type:
Description:
with
list of objects
The objects to
exclude.
export
Name:
Type:
Description:
format
string (name of export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
extract label
fit
348
AppleScript Reference
InDesign CS Scripting Guide
Method:
insert label
Parameters:
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
with
list of objects
The objects to intersect with.
Name:
Type:
Description:
[layer]
layer or layer name as string
The layer on which
to create the rectangle as layer.
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after this
rectangle or at the
beginning/end of
this document,
spread, Master
spread, page or
layer as document,
spread, master
spread, page or
layer.
make compound
path
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
markup
Name:
Type:
Description:
using
XML element
The element to mark
up.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
Name:
Type:
Description:
destination page
page
The page on which
to override the master page item.
intersect path
make
minus back
move
override
Return:
Description:
nothing
Sets the string associated with
the given key (label name).
page item
Create a new shape based on
the area of intersection of this
object and other objects. This
method corresponds to the
Intersect path operation (Objec
ts>Pathfinder>Intersect).
rectangle
Create a new rectangle.
page item
Create a compound path by
adding the paths of this object
to the paths of other objects.
This method corresponds
to the Object>Compound
paths>Make command.
nothing
Markup layout content with
XML preserving the existing
content.
page item
Create a new shape by reverse
subtracting this object from
other objects. This method
corresponds to the Minus Back
path operation (Objects>Pathfi
nder>Minus Back).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
page item
Overrides an item from the
master page and places it on
the page.
InDesign CS Scripting Guide
AppleScript Reference
349
Method:
place
place xml
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
Name:
Type:
Description:
using
XML element
The element to place
into.
Return:
Description:
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
release compound
path
None
objects
release compound path.
remove override
None
nothing
Removes a locally overriden
master page item
reset scaling
None
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
350
AppleScript Reference
InDesign CS Scripting Guide
Method:
resize
rotate
select
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to rotate
around, either one
of the enums or an
x,y value.
[considering current rotation]
boolean
if true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
if true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
if true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
nothing
Select this rectangle.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
InDesign CS Scripting Guide
AppleScript Reference
351
Method:
shear
store
subtract path
unlink
352
Parameters:
Name:
Type:
Description:
by
number
angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to shear
around, either one
of the enums or an
x,y value.
[considering current shear]
boolean
if true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
if true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
if true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Shear the page item.
asset
Store a page item in a library.
page item
Create a new shape by subtracting the area of intersection of
this object and other objects
from the other objects. This
method corresponds to the
Subtract path operation (Objec
ts>Pathfinder>Subtract).
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
row
Elements
Element:
Refer to by:
cell
index, name, range, relative, test, id
column
index, name, range, relative, test
row
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
auto grow
boolean
read/write
If true, the cell will expand to display its
content.
bottom edge stroke
color
swatch
read/write
The stroke color of the bottom edge of the
cell.
bottom edge stroke
gap color
swatch
read/write
The gap color of the stroke applied to the
bottom edge of the cell.
bottom edge stroke
gap overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the bottom edge of
the cell.
bottom edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the bottom edge of the
cell (-1 indicates 100%, or no tint override).
bottom edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
bottom edge of the cell.
bottom edge stroke
priority
integer
read/write
The stroke priority of the bottom edge
bottom edge stroke
tint
fixed
read/write
The tint applied to the stroke of the bottom edge of the cell (-1 indicates 100%, or
no tint override).
bottom edge stroke
type
stroke style
read/write
The type of stroke applied to the bottom
edge of the cell.
bottom edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
bottom edge of the cell.
bottom inset
fixed or measurement string
read/write
The bottom inset the cell.
class
type
read only
The class of the object.
clip content to cell
boolean
read/write
If true, clip the content of the cell to the
boundaries of the cell.
column span
integer
read only
The number of columns that this cell
spans
contents
objects
read/write
The text contents of the cell.
diagonal line in
front
boolean
read/write
If true, the diagonal line will draw in front
of the contents of the cell.
diagonal line
stroke color
swatch
read/write
The stroke color of the diagonal line(s)
applied to the cell.
diagonal line
stroke gap color
swatch
read/write
The gap color of the diagonal line(s).
diagonal line
stroke gap overprint
boolean
read/write
If true, overprint the color of the gap of
the diagonal line(s).
diagonal line
stroke gap tint
fixed
read/write
The tint applied to the gap color of the
stroke of the diagonal line(s) of the cell (-1
indicates 100%, or no tint override).
diagonal line
stroke overprint
boolean
read/write
If true, overprint the diagonal line(s) applied to the cell.
InDesign CS Scripting Guide
AppleScript Reference
353
Property:
Type:
Access:
Description:
diagonal line
stroke tint
fixed
read/write
The tint applied to the stroke of the diagonal line(s) of the cell (-1 indicates 100%, or
no tint override).
diagonal line
stroke type
stroke style
read/write
The type of stroke applied to the diagonal
line(s) of the cell.
diagonal line
stroke weight
fixed or measurement string
read/write
The stroke weight of the diagonal line(s)
of the cell.
fill color
swatch
read/write
The swatch, color, gradient, tint, or mixed
ink applied to the fill of the cell.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the cell (-1 indicates 100%, or no tint
override).
first baseline offset
ascent offset, cap height, leading offset, embox height, x height, fixed height
read/write
The method used to calculate the distance
from the first baseline of text in the cell
and the top inset of the cell.
gradient fill angle
fixed
read/write
Angle of a linear gradient on the fill
gradient fill length
fixed
read/write
Length of ramp for a linear gradient or
radius of a radial gradient on the fill
gradient fill start
list of fixed or measurement strings {x, y}
read/write
Center point for a radial gradient or starting point for a linear gradient on the fill
height
fixed or measurement string
read/write
The height of the cell.
index
integer
read only
index of the cell within its parent table.
inner column
stroke color
swatch
read/write
The stroke color of the inner column of
the cell.
inner column
stroke gap color
swatch
read/write
The gap color of the stroke applied to the
inner column of the cell.
inner column
stroke gap overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the inner column of
the cell.
inner column
stroke gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the inner column of the
cell (-1 indicates 100%, or no tint override).
inner column
stroke overprint
boolean
read/write
If true, overprint the stroke applied to the
inner column of the cell.
inner column
stroke tint
fixed
read/write
The tint applied to the stroke of the inner
column of the cell (-1 indicates 100%, or
no tint override).
inner column
stroke type
stroke style
read/write
The type of stroke applied to the inner
column of the cell.
inner column
stroke weight
fixed or measurement string
read/write
The width of the stroke applied to the the
inner column of the cell.
inner row stroke
color
swatch
read/write
The stroke color of the inner row of the
cell.
inner row stroke
gap color
swatch
read/write
The gap color of the stroke applied to the
inner row of the cell.
inner row stroke
gap overprint
boolean
read/write
Whether to overprint the gap of the inner
row
inner row stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the inner row of the cell
(-1 indicates 100%, or no tint override).
inner row stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
inner row of the cell.
inner row stroke
tint
fixed
read/write
The tint applied to the stroke of the inner
row of the cell (-1 indicates 100%, or no
tint override).
inner row stroke
type
stroke style
read/write
The type of stroke applied to the inner row
of the cell.
354
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
inner row stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
inner row of the cell.
keep with next row
boolean
read/write
If true, keep this row with the next row
when the rows break between pages, text
frames, or text columns.
left edge stroke
color
swatch
read/write
The stroke color of the left edge of the cell.
left edge stroke gap
color
swatch
read/write
The gap color of the stroke applied to the
left edge of the cell.
left edge stroke gap
overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the left edge of the cell.
left edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the left edge of the cell
(-1 indicates 100%, or no tint override).
left edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
left edge of the cell.
left edge stroke
priority
integer
read/write
The stroke priority of the left edge
left edge stroke tint
fixed
read/write
The tint of the color of the left edge
left edge stroke
type
stroke style
read/write
The type of stroke applied to the left edge
of the cell.
left edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
left edge of the cell.
left inset
fixed or measurement string
read/write
The left inset of the cell.
maximum height
fixed or measurement string
read/write
Specifies the maximum height of the row
containing the cell.
minimum first
baseline offset
fixed or measurement string
read/write
The minimum distance (in points) between the first baseline of the text in the
cell and the top inset of the frame or cell.
minimum height
fixed or measurement string
read/write
Constrains the row height to an amount
no smaller than this value. The row may
be larger than this amount, however,
as the row height will continue to grow
automatically as text is added.
name
string
read only
The name of the cell, in the form row
number; column number. The third cell of
the fourth row, for example, would have
the name “R4:C3”.
object reference
row
read only
An object reference to the object.
overflows
boolean
read only
If true, the cell contains overset (i.e.,
uncomposed) text.
overprint fill
boolean
read/write
If true, overprint the fill of the cell.
paragraph spacing
limit
fixed or measurement string
read/write
When the vertical justification of the
cell is set to justified, this is the maximum amount of space that will be added
between paragraphs. Increase this value
to encourage spacing between paragraphs
of vertically justified text; decrease it to
increase the leading between lines of text
in vertically justified text.
parent
object
read only
The parent of the object.
parent column
column
read only
The parent column of the cell.
parent row
row
read only
The parent row of the cell.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right edge stroke
color
swatch
read/write
The stroke color of the right edge of the
cell.
InDesign CS Scripting Guide
AppleScript Reference
355
Property:
Type:
Access:
Description:
right edge stroke
gap color
swatch
read/write
The gap color of the stroke applied to the
right edge of the cell.
right edge stroke
gap overprint
boolean
read/write
If true, overprint the color assigned to
the gap of the stroke of the right edge of
the cell.
right edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the right edge of the cell
(-1 indicates 100%, or no tint override).
right edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
right edge of the cell.
right edge stroke
priority
integer
read/write
The stroke priority of the right edge
right edge stroke
tint
fixed
read/write
The tint applied to the stroke of the right
edge of the cell (-1 indicates 100%, or no
tint override).
right edge stroke
type
stroke style
read/write
The type of stroke applied to the right
edge of the cell.
right edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
right edge of the cell.
right inset
fixed or measurement string
read/write
The right inset the cell.
rotation angle
fixed
read/write
The rotation angle of the cell.
row span
integer
read only
The number of rows that this cell spans
row type
body row, header row, footer row, mixed state
read/write
The type of the row containing the cell.
start row
anywhere, next column, next frame, next page, next odd page, next even page
read/write
Where to start the row
text cell rotation
follows story direction
boolean
read/write
Whether text cell direction matches the
story direction
top edge stroke
color
swatch
read/write
The stroke color of the top edge of the cell.
top edge stroke gap
color
swatch
read/write
The gap color of the stroke applied to the
top edge of the cell.
top edge stroke gap
overprint
boolean
read/write
If true, overprint the color assigned to the
gap of the stroke of the top edge of the cell.
top edge stroke
gap tint
fixed
read/write
The tint applied to the gap color of the
stroke applied to the top edge of the cell
(-1 indicates 100%, or no tint override).
top edge stroke
overprint
boolean
read/write
If true, overprint the stroke applied to the
top edge of the cell.
top edge stroke
priority
integer
read/write
The stroke priority of the top edge
top edge stroke tint
fixed
read/write
The tint applied to the stroke of the top
edge of the cell (-1 indicates 100%, or no
tint override).
top edge stroke
type
stroke style
read/write
The type of stroke applied to the right
edge of the cell.
top edge stroke
weight
fixed or measurement string
read/write
The width of the stroke applied to the the
top edge of the cell.
top inset
fixed or measurement string
read/write
The top inset the cell.
top left diagonal
line
boolean
read/write
If true, draw a diagonal line from the top
left corner to the bottom right corner of
the cell .
top right diagonal
line
boolean
read/write
If true, draw a diagonal line from the top
right corner to the bottom left corner of
the cell .
vertical justification
top align, center align, bottom align, justify align
read/write
The vertical justification applied to the
text in the cell.
width
fixed or measurement string
read/write
The width of the cell.
356
AppleScript Reference
InDesign CS Scripting Guide
Methods
Method:
create outlines
delete
make
merge
redistribute
search
select
split
unmerge
Parameters:
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original object.
None
Name:
Type:
Description:
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after an
existing row or at
the beginning/end
of a parent as row or
table.
Name:
Type:
Description:
with
row
The cell to merge
with.
Name:
Type:
Description:
using
horizontal, vertical
which direction to
redistribute.
[thru]
row
redistribute till this
object.
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Name:
Type:
Description:
using
horizontal, vertical
Which direction to
split.
None
Return:
Description:
objects
Create outlines from the text.
nothing
Deletes the object.
row
Create a new row.
row
Merge cells together.
nothing
Redistribute columns or rows.
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
Select this row.
nothing
Split the cell either horizontally
or vertically.
objects
Unmerge the cells.
InDesign CS Scripting Guide
AppleScript Reference
357
section
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
continue numbering
boolean
read/write
If true, continue page numbering from the
previous section.
id
integer
read only
A unique number identifying the object.
include section
prefix
boolean
read/write
If true, include the section prefix as part of
the page number.
index
integer
read only
index of the section within its parent
document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
length
integer
read only
The number of pages in this section
marker
string
read/write
The section marker.
name
string
read/write
The name of the section.
object reference
section
read only
An object reference to the object.
page number start
integer
read/write
The number at which to start numbering
pages (active when continue numbering
property is set to false).
page number style
upper roman, lower roman, upper letters, lower letters, arabic
read/write
The type of numbering to use for page
numbers in the section.
page start
page
read/write
The first page in the section.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
section
Create a new section.
extract label
insert label
make
358
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after an
existing section
or at the beginning/end of a
parent as section or
document.
AppleScript Reference
InDesign CS Scripting Guide
show hide fields behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
fields to hide
list of form fields
read/write
The fields to hide.
fields to show
list of form fields
read/write
The fields to show.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the show hide fields behavior
within its parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the show hide fields behavior.
object reference
show hide fields behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
show hide
fields behavior
Create a new show hide fields
behavior.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
AppleScript Reference
359
sound
Elements
Element:
Refer to by:
image
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
class
type
read only
The class of the object.
description
string
read/write
Description
do not print poster
boolean
read/write
Does not print the sound poster
embed in PDF
boolean
read/write
Embed content in pdf
file path
file reference or file name as string
read/write
The file path
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the sound within its parent page
item, oval, rectangle or polygon
item layer
layer
read/write
The layer containing the page item.
item link
link
read only
link to a placed file
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
locked
boolean
read/write
If true, the page item is locked.
name
string
read/write
The name of the sound.
object reference
sound
read only
An object reference to the object.
parent
object
read only
The parent of the page item.
play on page turn
boolean
read/write
Play on page turn
poster file
string
read/write
Poster file
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
sound poster type
none, standard, proxy image
read/write
Current poster type (‘proxy image’ is
read-only)
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
Parameters:
Return:
Description:
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
360
AppleScript Reference
InDesign CS Scripting Guide
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
sound
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Fit content within a graphic
frame.
nothing
Sets the string associated with
the given key (label name).
sound
Create a new sound.
nothing
Markup layout content with
XML preserving the existing
content.
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
extract label
fit
insert label
make
markup
move
reset scaling
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[layer]
layer or layer name as string
The layer on which
to create the sound
as layer.
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after this
sound or at the beginning/end of this
document, spread,
Master spread,
page or layer as
document, spread,
master spread, page
or layer.
Name:
Type:
Description:
using
xml element
The element to mark
up.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
None
InDesign CS Scripting Guide
AppleScript Reference
361
Method:
resize
select
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Select this sound.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
asset
Store a page item in a library.
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
store
unlink
362
Name:
Type:
Description:
using
library
The library in which
to store.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
sound behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the sound behavior within its
parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the sound behavior.
object reference
sound behavior
read only
An object reference to the object.
operation
play, stop, pause, resume
read/write
The operation to perform when the sound
behavior is activated.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
sound item
sound
read/write
The sound page item.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
sound
behavior
Create a new sound behavior.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
Description:
AppleScript Reference
363
spell preference
Properties
Property:
Type:
Access:
Description:
check capitalized
sentences
boolean
read/write
If true, check the spelling of capitalized
sentences.
check capitalized
words
boolean
read/write
If true, check the spelling of capitalized
words.
check misspelled
words
boolean
read/write
If true, check misspelled words.
check repeated
words
boolean
read/write
If true, check for repeated words.
class
type
read only
The class of the object.
object reference
spell preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
364
AppleScript Reference
InDesign CS Scripting Guide
spread
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
guide
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items on the spread,
regardless of their position in the object
hierarchy (i.e., page items inside groups or
inside other page items will be included).
applied master
master spread
read/write
The master spread applied to the spread.
class
type
read only
The class of the object.
flattener override
default, none, custom
read/write
The transparency flattener override applied to the spread (if any).
flattener preferences
flattener preference
read only
The transparency flattener preferences for
the spread.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the spread within the document.
keep together
boolean
read/write
If true, the pages of the spread should stay
together when pages are added or removed
before the spread.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
object reference
spread
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
show master items
boolean
read/write
If true, display items on the master spread.
InDesign CS Scripting Guide
AppleScript Reference
365
Methods
Method:
create guides
Parameters:
Name:
Type:
Description:
[number of rows]
integer
Number of rows of
guides on a page.
[number of
columns]
integer
Number of columns
of guides on a page.
[row gutter]
fixed or measurement string
The amount of gutter between rows.
[column gutter]
fixed or measurement string
The amount of
gutter between
columns.
[guide color]
list of fixed {r, g, b} or light blue, red,
green, blue, yellow, magenta, cyan, gray,
black, orange, dark green, teal, tan,
brown, violet, gold, dark blue, pink,
lavender, brick red, olive green, peach,
burgundy, grass green, ochre, purple,
light gray, charcoal, grid blue, grid orange, fiesta, light olive, lipstick, cute teal,
sulphur, grid green, white
The guideÕs color.
[fit margins]
boolean
Whether the guides
should fit to margins or fit to page.
[remove existing]
boolean
If true, remove
existing guides.
[layer]
layer or layer name as string
The layer on which
to create the spread
as layer.
Return:
Description:
nothing
Create multiple guides on all
pages of a spread.
Deletes the object.
delete
None
nothing
duplicate
None
spread
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
spread
Create a new spread.
spread
Move the spread before/after
another spread or page, or
to the beginning/end of a
document.
extract label
insert label
make
move
366
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after an
existing spread or at
the beginning/end
of a parent as spread
or document.
Name:
Type:
Description:
[to]
before, after, at beginning, at end
Location.
[reference]
spread or page
A spread, page
or document.
Before/after the
spread/page or at
the beginning/end
of the document.
AppleScript Reference
InDesign CS Scripting Guide
Method:
place
remove override
Parameters:
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
None
Return:
Description:
object
Place a file.
nothing
Removes a locally overriden
master page item
InDesign CS Scripting Guide
AppleScript Reference
367
state
Elements
Element:
Refer to by:
EPS
index, name, range, relative, test, id
graphic
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
image
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
PDF
index, name, range, relative, test, id
PICT
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
text frame
index, name, range, relative, test, id
WMF
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
active
boolean
read/write
If true, the state is the active state.
class
type
read only
The class of the object.
enabled
boolean
read/write
If true, the state is enabled for pdf generation.
id
integer
read only
The state’s unique id
index
integer
read only
index of the state within its parent button
name
string
read only
The name of the state.
object reference
state
read only
An object reference to the object.
parent
button
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
statetype
up, rollover, down
read/write
The state type of the state.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
make
None
state
Create a new state.
368
AppleScript Reference
InDesign CS Scripting Guide
static text
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the static text within its parent
dialog column, dialog row, enabling group
or border panel
min width
fixed
read/write
The minimum width of the control.
object reference
static text
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
static label
string
read/write
The text in the static label control.
Methods
Method:
Parameters:
Return:
Description:
make
None
static text
Create a new static text.
InDesign CS Scripting Guide
AppleScript Reference
369
story
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
character
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
nested style
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
tab stop
index, name, range, relative, test
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All page item objects contained by this
text object, including any nested page
items or page items inside groups.
applied character
style
character style
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
paragraph style
read/write
The paragraph style applied to the text.
associated XML
elements
list of XML elements
read only
The XML elements associated with this
text object (if any).
370
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
contents
string
read/write
The contents of the text object. If the text
object is a single character, this property
might contain either a special character
constant or a string; for text objects containing multiple characters, this property
will contain a string.
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
InDesign CS Scripting Guide
AppleScript Reference
371
Property:
Type:
Access:
Description:
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
gradient fill angle
fixed
read/write
The angle of the gradient applied to the fill
of the text (if any).
gradient fill length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the fill of
the text.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to the fill of the text, or the center
point of a radial gradient applied to the fill
of the text.
gradient stroke
angle
fixed
read/write
The angle of the gradient applied to the
stroke of the text.
gradient stroke
length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the stroke
of the text.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to stroke of the text, or the center
point of a radial gradient applied to the
stroke of the text.
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the story within its parent XML
element or document
item link
link
read only
link to a placed file
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
372
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
label
string
read/write
A label that can be set to any string
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
length
integer
read only
The number of characters in the text
object.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
story
read only
An object reference to the object.
open type features
list of integers
read/write
open type features
InDesign CS Scripting Guide
AppleScript Reference
373
Property:
Type:
Access:
Description:
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
swatch or string
read/write
The gap color of the paragraph rule above.
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
374
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
story preferences
story preference
read only
The story preferences for the story. The
properties of this object correspond to the
options in the story palette.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
InDesign CS Scripting Guide
AppleScript Reference
375
Property:
Type:
Access:
Description:
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list of objects
read/write
A list of all of the properties of all of the
tab stops on this story. Can return: list of
record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
376
AppleScript Reference
InDesign CS Scripting Guide
Methods
Method:
changecase
create outlines
delete
export
extract label
insert label
markup
move
place xml
Parameters:
Name:
Type:
Description:
using
uppercase, lowercase, titlecase, sentencecase
Case option to use.
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original text.
None
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The full path to the
exported file.
[showing options]
boolean
If true, display the
Export dialog box.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
using
XML element
The XML element
to associate with the
text.
Name:
Type:
Description:
to
before, after, at end, at beginning,
unknown
Where to move the
text, relative to the
reference object
(before/after).
[reference]
object
A text object that
specifies the destination of the text
you’re moving.
Name:
Type:
Description:
using
XML element
The element to place
into.
Return:
Description:
nothing
Change the case of text.
objects
Create outlines from the text.
If you set the delete original
parameter to true, InDesign
will delete the original text and
insert the character outlines as
an inline graphic; if the delete
original parameter is false, InDesign creates an independent
graphic and places it above the
text.
nothing
Deletes the object.
nothing
Export the object to a file.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
nothing
Associate the text with an XML
element while preserving the
existing text content.
nothing
Moves the text.
nothing
Places XML content from the
specified element replacing the
existing content.
InDesign CS Scripting Guide
AppleScript Reference
377
Method:
search
story edit
378
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
None
AppleScript Reference
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
InDesign CS Scripting Guide
Edit the story in a story editor
window
story preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
object reference
story preference
read only
An object reference to the object.
optical margin
alignment
boolean
read/write
If true, adjust the position of characters
at the edges of text columns. In general,
the edges of punctuation characters
will “hang” beyond the edges of the text
column, but other characters are also
adjusted.
optical margin size
fixed
read/write
A point size used as a base for calculating
how far characters should hang outside
the margins when optical margin alginment is on.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
InDesign CS Scripting Guide
AppleScript Reference
379
story window
Properties
Property:
Type:
Access:
Description:
bounds
list of numbers or measurement strings {top, left, bottom, right}
read/write
The bounds of the story window, in the
format (top, left, bottom, right)
class
type
read only
The class descriptor type
index
integer
read only
index of the story window within its parent document or application
name
string
read only
The name of the story window
object reference
story window
read only
An object reference for this story window
parent
object
read only
The story window’s parent. Can return:
document or application.
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
selection
list
read/write
The selection of the front-most window.
Can return: object, list of objects or nothing.
Methods
Method:
Parameters:
Return:
Description:
bring to front
None
nothing
Brings the object to the top
close
None
nothing
Close the StoryWindow
maximize
None
nothing
Maximize the window
minimize
None
nothing
Minimize the window
restore
None
nothing
Restore the window
nothing
Select one or more objects.
select
380
Name:
Type:
Description:
selectable items
object or list of objects, or nothing to
deselect all
The objects to select.
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
AppleScript Reference
InDesign CS Scripting Guide
striped stroke style
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the striped stroke style within its
parent document or application
name
string
read/write
The name of the striped stroke style.
object reference
striped stroke style
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
stripe array
list of fixed
read/write
A list defining the stripe and gap of the
striped stroke style.
stroke style type
string
read only
The stroke style type.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
make
None
striped stroke
style
Create a new striped stroke
style.
InDesign CS Scripting Guide
AppleScript Reference
381
stroke style
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the stroke style within its parent
document or application
name
string
read/write
The name of the stroke style.
object reference
stroke style
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
stroke style type
string
read only
The type of the stroke style.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
382
AppleScript Reference
InDesign CS Scripting Guide
subtopic
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
index
integer
read only
index of the subtopic within its parent
topic
name
string
read/write
The name of the subtopic.
object reference
subtopic
read only
An object reference to the object.
parent
topic
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
sort order
string
read/write
The sort order text of the subtopic.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
subtopic
Create a new subtopic.
subtopic
Move the subtopic to another
index location in the subtopics
collection.
make
move
Name:
Type:
Description:
name
string
subtopic name.
[sort order]
string
sort order as string.
Name:
Type:
Description:
to
integer
the location to
insert.
InDesign CS Scripting Guide
Description:
AppleScript Reference
383
SVG export preference
Properties
Property:
Type:
Access:
Description:
applied flattener
preset
flattener preset
read/write
The flattener preset
class
type
read only
The class of the object.
embed images
boolean
read/write
If true, embed bitmap images in the
exported SVG file.
file encoding
ASCII, UTF8, UTF16
read/write
The file encoding to use.
font subsetting
none, subset glyphs, subset english, subset glyphs and english, subset roman,
subset glyphs and roman, subset entire
read/write
The method used to subset fonts saved in
the exported SVG file.
ignore spread overrides
boolean
read/write
If true, ignore flattener spread overrides
when exporting the SVG file.
object reference
SVG export preference
read only
An object reference to the object.
page range
string or ‘all’
read/write
The range of pages to export.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
readers spreads
boolean
read/write
If true, export reader’s spreads.
real precision
integer
read/write
Number of digits of precision for real
numbers.
rendering style
progressive, batch
read/write
The rendering style to use in the exported
SVG file.
style format
inline, entity, css, presentation attributes
read/write
The format used to specify SVG object
styles.
384
AppleScript Reference
InDesign CS Scripting Guide
swatch
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the swatch within its parent
application or document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the swatch.
object reference
swatch
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
swatch
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
nothing
Merge one or more other
swatches into this one.
InDesign CS Scripting Guide
AppleScript Reference
extract label
insert label
merge
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
with
swatch
The swatches to
merge.
385
synchronize option
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
group name
string
read only
The name of the group this book synchronize option style appears in.
index
integer
read only
index of the synchronize option within its
parent book
name
string
read only
The name of the XML tag
object reference
synchronize option
read only
An object reference to the object.
parent
book
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
use style
boolean
read/write
If true, use the book synchronize option
style during a synchronize.
386
AppleScript Reference
InDesign CS Scripting Guide
tab stop
Properties
Property:
Type:
Access:
Description:
alignment
left align, center align, right align, character align
read/write
The alignment of the tab stop.
alignment
character
string
read/write
The tab stop alignment character.
class
type
read only
The class of the object.
index
integer
read only
index of the tab stop within its parent text
default, paragraph, paragraph style, text,
character, word, line, text column, text
style range, insertion point or story
leader
string
read/write
The tab stop leader
object reference
tab stop
read only
An object reference to the object.
parent
object
read only
The parent of the object.
position
fixed or measurement string
read/write
The position of the tab stop on the text
ruler.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
make
None
tab stop
Create a new tab stop.
InDesign CS Scripting Guide
AppleScript Reference
387
table
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
cell
index, name, range, relative, test, id
column
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
row
index, name, range, relative, test
text frame
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items contained by this
object, regardless of their location in the
object hierarchy (i.e., including objects
nested within other objects, such as
groups).
alternating fills
no alternating pattern, alternating rows, alternating columns
read/write
What alternating fills pattern we use
body row count
integer
read/write
Number of table body rows
bottom border
stroke color
swatch
read/write
The color of the table’s bottom border
bottom border
stroke gap color
swatch
read/write
The gap color of the table’s bottom border
bottom border
stroke gap overprint
boolean
read/write
Whether to overprint the gap of the table’s
bottom border
bottom border
stroke gap tint
fixed
read/write
The gap tint of the gap color of the table’s
bottom border
bottom border
stroke overprint
boolean
read/write
Whether to overprint the table’s bottom
border
bottom border
stroke tint
fixed
read/write
The tint of the color of the table’s bottom
border
bottom border
stroke type
stroke style
read/write
The stroke type of the table’s bottom
border
bottom border
stroke weight
fixed or measurement string
read/write
The stroke weight of the table’s bottom
border
break footers
in all text columns, once per text frame, once per page
read/write
Where to put the footers
break headers
in all text columns, once per text frame, once per page
read/write
Where to put the headers
class
type
read only
The class of the object.
column count
integer
read/write
The number of columns
column fills priority
boolean
read/write
Whether to disaply column alternating
fills or row alternating fills
contents
objects
read/write
The text contents of the cell.
388
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
end column fill
color
swatch
read/write
The fill color of columns in the second
alternating fill group
end column fill
count
integer
read/write
The number of columns in the second
alternating fills group
end column fill
overprint
boolean
read/write
Whether to overprint the columns in the
second alternating fills group
end column fill tint
fixed
read/write
The tint of the color of columns in the
second alternating fills group
end column line
style
stroke style
read/write
The stroke type of columns in the second
alternating strokes group
end column stroke
color
swatch
read/write
The stroke color of columns in the second
alternating strokes group
end column stroke
count
integer
read/write
The number of columns in the second
alternating strokes group
end column stroke
gap color
swatch
read/write
The stroke gap color of columns in the
second alternating strokes group
end column stroke
gap overprint
boolean
read/write
Whether to overprint the gap of the
columns in the second alternating strokes
group
end column stroke
gap tint
fixed
read/write
The gap tint of the gap color of columns in
the second alternating strokes group
end column stroke
overprint
boolean
read/write
Whether to overprint the columns in the
second alternating strokes group
end column stroke
tint
fixed
read/write
The tint of the color of columns in the
second alternating strokes group
end column stroke
weight
fixed or measurement string
read/write
The stroke weight of columns in the second alternating strokes group
end row fill color
swatch
read/write
The fill color of rows in the second alternating fills group
end row fill count
integer
read/write
The number of rows in the second alternating fills group
end row fill overprint
boolean
read/write
Whether to overprint the rows in the
second alternating fills group
end row fill tint
fixed
read/write
The tint of the color of rows in the second
alternating fills group
end row stroke
color
swatch
read/write
The stroke color of rows in the second
alternating strokes group
end row stroke
count
integer
read/write
The number of rows in the second alternating strokes group
end row stroke gap
color
swatch
read/write
The stroke gap color of rows in the second
alternating strokes group
end row stroke gap
overprint
boolean
read/write
Whether to overprint the gap of the rows
in the second alternating strokes group
end row stroke gap
tint
fixed or measurement string
read/write
The gap tint of the gap color of rows in the
second alternating strokes group
end row stroke
overprint
boolean
read/write
Whether to overprint the rows in the
second alternating strokes group
end row stroke tint
fixed or measurement string
read/write
The tint of the color of rows in the second
alternating strokes group
end row stroke
type
stroke style
read/write
The stroke type of rows in the second
alternating strokes group
end row stroke
weight
fixed or measurement string
read/write
The stroke weight of rows in the second
alternating strokes group
footer row count
integer
read/write
Number of table footer rows
header row count
integer
read/write
Number of table header rows
height
fixed or measurement string
read/write
The height of the cell.
InDesign CS Scripting Guide
AppleScript Reference
389
Property:
Type:
Access:
Description:
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the cell within its parent table.
label
string
read/write
A label that can be set to any string
left border stroke
color
swatch
read/write
The color of the table’s left border
left border stroke
gap color
swatch
read/write
The gap color of the table’s left border
left border stroke
gap overprint
boolean
read/write
Whether to overprint the gap of the table’s
left border
left border stroke
gap tint
fixed
read/write
The gap tint of the gap color of the table’s
left border
left border stroke
overprint
boolean
read/write
Whether to overprint the table’s left
border
left border stroke
tint
fixed
read/write
The tint of the color of the table’s left
border
left border stroke
type
stroke style
read/write
The stroke type of the table’s left border
left border stroke
weight
fixed or measurement string
read/write
The stroke weight of the table’s left border
object reference
table
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right border stroke
color
swatch
read/write
The color of the table’s right border
right border stroke
gap color
swatch
read/write
The gap color of the table’s right border
right border stroke
gap overprint
boolean
read/write
Whether to overprint the gap of the table’s
right border
right border stroke
gap tint
fixed
read/write
The gap tint of the color of the table’s right
border
right border stroke
overprint
boolean
read/write
Whether to overprint the table’s right
border
right border stroke
tint
fixed
read/write
The tint of the color of the table’s right
border
right border stroke
type
stroke style
read/write
The stroke type of the table’s right border
right border stroke
weight
fixed or measurement string
read/write
The stroke weight of the table’s right
border
skip first alternating fill columns
integer
read/write
The number of first columns to skip when
alternating fills
skip first alternating fill rows
integer
read/write
The number of first rows to skip when
alternating fills
skip first alternating stroke columns
integer
read/write
The number of first columns to skip when
alternating strokes
skip first alternating stroke rows
integer
read/write
The number of first rows to skip when
alternating strokes
skip first header
boolean
read/write
Whether to skip the first occurrence of the
headers
skip last alternating fill columns
integer
read/write
The number of last columns to skip when
alternating fills
skip last alternating fill rows
integer
read/write
The number of last rows to skip when
alternating fills
skip last alternating stroke columns
integer
read/write
The number of last columns to skip when
alternating strokes
390
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
skip last alternating stroke rows
integer
read/write
The number of last rows to skip when
alternating strokes
skip last footer
boolean
read/write
Whether to skip the last occurrence of the
footers
space after
fixed or measurement string
read/write
Space after
space before
fixed or measurement string
read/write
Space before
start column fill
color
swatch
read/write
The fill color of columns in the first alternating fills group
start column fill
count
integer
read/write
The number of columns in the first alternating fills group
start column fill
overprint
boolean
read/write
Whether to overprint the columns in the
first alternating fills group
start column fill
tint
fixed
read/write
The tint of the color of columns in the first
alternating fills group
start column
stroke color
swatch
read/write
The stroke color of columns in the first
alternating strokes group
start column
stroke count
integer
read/write
The number of columns in the first alternating strokes group
start column
stroke gap color
swatch
read/write
The stroke gap color of columns in the
first alternating strokes group
start column
stroke gap overprint
boolean
read/write
Whether to overprint the gap of the
columns in the first alternating strokes
group
start column
stroke gap tint
fixed
read/write
The gap tint of the gap color of columns in
the first alternating strokes group
start column
stroke overprint
boolean
read/write
Whether to overprint the columns in the
first alternating strokes group
start column
stroke tint
fixed
read/write
The tint of the color of columns in the first
alternating strokes group
start column
stroke type
stroke style
read/write
The stroke type of columns in the first
alternating strokes group
start column
stroke weight
fixed or measurement string
read/write
The stroke weight of columns in the first
alternating strokes group
start row fill color
swatch
read/write
The fill color of rows in the first alternating fills group
start row fill count
integer
read/write
The number of rows in the first alternating
fills group
start row fill overprint
boolean
read/write
Whether to overprint the rows in the first
alternating fills group
start row fill tint
fixed
read/write
The tint of the color of rows in the first
alternating fills group
start row stroke
color
swatch
read/write
The stroke color of rows in the first alternating strokes group
start row stroke
count
integer
read/write
The number of rows in the first alternating
strokes group
start row stroke
gap color
swatch
read/write
The stroke gap color of rows in the first
alternating strokes group
start row stroke
gap overprint
boolean
read/write
Whether to overprint the gap of the rows
in the first alternating strokes group
start row stroke
gap tint
fixed
read/write
The gap tint of the gap color of rows in the
first alternating strokes group
start row stroke
overprint
boolean
read/write
Whether to overprint the rows in the first
alternating strokes group
start row stroke
tint
fixed
read/write
The tint of the color of rows in the first
alternating strokes group
start row stroke
type
stroke style
read/write
The stroke type of rows in the first alternating strokes group
InDesign CS Scripting Guide
AppleScript Reference
391
Property:
Type:
Access:
Description:
start row stroke
weight
fixed or measurement string
read/write
The stroke weight of rows in the first alternating strokes group
story offset
integer
read only
The location of the object from the beginning of the story
stroke order
row on top, column on top, best joins, indesign 2 compatibility
read/write
Whether to draw columns on top if true or
rows on top if false
top border stroke
color
swatch
read/write
The color of the table’s top border
top border stroke
gap color
swatch
read/write
The gap color of the table’s top border
top border stroke
gap overprint
boolean
read/write
Whether to overprint the gap of the table’s
top border
top border stroke
gap tint
fixed
read/write
The gap tint of the gap color of the table’s
top border
top border stroke
overprint
boolean
read/write
Whether to overprint the table’s top
border
top border stroke
tint
fixed
read/write
The tint of the color of the table’s top
border
top border stroke
type
stroke style
read/write
The stroke type of the table’s top border
top border stroke
weight
fixed or measurement string
read/write
The stroke weight of the top border of the
table
width
fixed or measurement string
read/write
The width of the cell.
Methods
Method:
convert to text
create outlines
delete
make
392
Parameters:
Name:
Type:
Description:
[column separator]
string
The character to
interpret as the
column separator.
[row separator]
string
The character to
interpret as the row
separator.
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original object.
None
Name:
Type:
Description:
[to]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after an
existing table or at
the beginning/end
of a parent as table,
textFrame, text,
character, word,
line, paragraph,
textcolumn, insertion point, story, cell
or textStyleRange.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
text
Convert to text.
objects
Create outlines from the text.
nothing
Deletes the object.
table
Create a new table.
Method:
search
select
unmerge
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
None
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
Select this table.
objects
Unmerge the cells.
InDesign CS Scripting Guide
AppleScript Reference
393
tagged text export preference
Properties
Property:
Type:
Access:
Description:
character set
ASCII, ansi, unicode, shift JIS
read/write
The character set to use when exporting
tagged text.
class
type
read only
The class of the object.
object reference
tagged text export preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
tag form
verbose, abbreviated
read/write
The tag form to use when exporting
tagged text.
394
AppleScript Reference
InDesign CS Scripting Guide
tagged text import preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
object reference
tagged text import preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Remove Text Formatting
boolean
read/write
Whether to remove text formatting or not
style conflict
publication definition, tag file definition
read/write
What to do when style definitions in the
incoming tagged text file conflict with
definitions of styles having the same
names in the current publication.
Use Typographers
Quotes
boolean
read/write
Whether to use Typographer’s quotes or
not
InDesign CS Scripting Guide
AppleScript Reference
395
text
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
character
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
nested style
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
tab stop
index, name, range, relative, test
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All page item objects contained by this
text object, including any nested page
items or page items inside groups.
applied character
style
character style
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
paragraph style
read/write
The paragraph style applied to the text.
396
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
ascent
fixed
read only
The maximum ascent of any character in
the text object (in points, relative to the
baseline of the line containing the text).
associated XML
elements
list of XML elements
read only
The XML elements associated with this
text object (if any).
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
baseline
fixed
read only
The vertical location of the baseline of the
text, in the current vertical measurement
units, relative to the ruler zero point.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
contents
string
read/write
The contents of the text object. If the text
object is a single character, this property
might contain either a special character
constant or a string; for text objects containing multiple characters, this property
will contain a string.
descent
fixed
read only
The maximum descent of any character in
the text, in points, relative to the baseline
of the line containing the text object.
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
InDesign CS Scripting Guide
AppleScript Reference
397
Property:
Type:
Access:
Description:
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
gradient fill angle
fixed
read/write
The angle of the gradient applied to the fill
of the text (if any).
gradient fill length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the fill of
the text.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to the fill of the text, or the center
point of a radial gradient applied to the fill
of the text.
gradient stroke
angle
fixed
read/write
The angle of the gradient applied to the
stroke of the text.
gradient stroke
length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the stroke
of the text.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to stroke of the text, or the center
point of a radial gradient applied to the
stroke of the text.
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal offset
fixed
read only
The horizontal location of the left edge
of the first character in the text, in page
coordinates, relative to the current zero
point.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
398
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
index
integer
read only
index of the object within its parent
object.
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
length
integer
read only
The number of characters in the text
object.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
InDesign CS Scripting Guide
AppleScript Reference
399
Property:
Type:
Access:
Description:
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
text
read only
An object reference to the object.
open type features
list of long
read/write
open type features
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
parent story
story
read only
The story containing the text object.
parent text frame
text frame
read only
The text frame containing the text object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
swatch or string
read/write
The gap color of the paragraph rule above.
400
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
InDesign CS Scripting Guide
AppleScript Reference
401
Property:
Type:
Access:
Description:
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list of objects
read/write
A list of all of the properties of all of the
tab stops on this text. Can return: list of
record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
402
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
Methods
Method:
apply style
changecase
convert to table
create outlines
delete
Parameters:
Name:
Type:
Description:
using
character style, paragraph style, or string
The paragraph style
or character style to
apply.
[clearing overrides]
boolean
If true, clear any local formatting in the
text object before
applying the style.
Name:
Type:
Description:
using
uppercase, lowercase, titlecase, sentencecase
Case option to use.
Name:
Type:
Description:
[column separator]
string
The character to
interpret as the
column separator.
[row separator]
string
The character to
interpret as the row
separator.
[number of
columns]
integer
The number of
columns in the table
(only used if the
column and row
separators are the
same).
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original text.
None
Return:
Description:
nothing
Apply a paragraph or character
style to the text object.
nothing
Change the case of text.
table
Convert the text to a table. The
parameters for this command
correspond to the options
in the Convert text to table
dialog box (select some text
and choose table>Convert text
to table to display this dialog
box).
objects
Create outlines from the text.
If you set the delete original
parameter to true, InDesign
will delete the original text and
insert the character outlines as
an inline graphic; if the delete
original parameter is false, InDesign creates an independent
graphic and places it above the
text.
nothing
Deletes the object.
InDesign CS Scripting Guide
AppleScript Reference
403
Method:
export
markup
move
place
404
Parameters:
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The full path to the
exported file.
[showing options]
boolean
If true, display the
Export dialog box.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
using
XML element
The XML element
to associate with the
text.
Name:
Type:
Description:
to
before, after, at end, at beginning,
unknown
Where to move the
text, relative to the
reference object
(before/after).
[reference]
object
A text object that
specifies the destination of the text
you’re moving.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The location (in
page coordinates) at
which to place the
incoming file.
[destination layer]
layer or layer name as string
The layer on which
to place the incoming file.
[showing options]
boolean
If true, display the
import options
dialog box for the
file type being
placed.
[autoflowing]
boolean
If true, autoflow the
incoming text.
[retaining formatting]
boolean
If true, retain the
formatting of the incoming text. If false,
place the text using
the document’s default text formatting
attributes.
[converting
quotes]
boolean
If true, convert typewriter
(“straight”) quotation marks to typographic (“curly”)
quotation marks.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Export the object to a file.
nothing
Associate the text with an XML
element while preserving the
existing text content.
nothing
Moves the text.
object
Place a file.
Method:
search
select
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
InDesign CS Scripting Guide
Selects text.
AppleScript Reference
405
text column
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
character
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
nested style
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
tab stop
index, name, range, relative, test
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All page item objects contained by this
text object, including any nested page
items or page items inside groups.
applied character
style
character style
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
paragraph style
read/write
The paragraph style applied to the text.
406
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
ascent
fixed
read only
The maximum ascent of any character in
the text object (in points, relative to the
baseline of the line containing the text).
associated XML
elements
list of XML elements
read only
The XML elements associated with this
text object (if any).
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
baseline
fixed
read only
The vertical location of the baseline of the
text, in the current vertical measurement
units, relative to the ruler zero point.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
contents
string
read/write
The contents of the text object. If the text
object is a single character, this property
might contain either a special character
constant or a string; for text objects containing multiple characters, this property
will contain a string.
descent
fixed
read only
The maximum descent of any character in
the text, in points, relative to the baseline
of the line containing the text object.
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
InDesign CS Scripting Guide
AppleScript Reference
407
Property:
Type:
Access:
Description:
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
gradient fill angle
fixed
read/write
The angle of the gradient applied to the fill
of the text (if any).
gradient fill length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the fill of
the text.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to the fill of the text, or the center
point of a radial gradient applied to the fill
of the text.
gradient stroke
angle
fixed
read/write
The angle of the gradient applied to the
stroke of the text.
gradient stroke
length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the stroke
of the text.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to stroke of the text, or the center
point of a radial gradient applied to the
stroke of the text.
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal offset
fixed
read only
The horizontal location of the left edge
of the first character in the text, in page
coordinates, relative to the current zero
point.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
408
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
index
integer
read only
index of the object within its parent
object.
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
length
integer
read only
The number of characters in the text
object.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
InDesign CS Scripting Guide
AppleScript Reference
409
Property:
Type:
Access:
Description:
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
text column
read only
An object reference to the object.
open type features
list of integers
read/write
open type features
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
parent story
story
read only
The story containing the text object.
parent text frame
text frame
read only
The text frame containing the text object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
swatch or string
read/write
The gap color of the paragraph rule above.
410
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
InDesign CS Scripting Guide
AppleScript Reference
411
Property:
Type:
Access:
Description:
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list of objects
read/write
A list of all of the properties of all of the
tab stops on this text column. Can return:
list of record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
412
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
Methods
Method:
apply style
changecase
convert to table
create outlines
delete
Parameters:
Name:
Type:
Description:
using
character style, paragraph style, or string
The paragraph style
or character style to
apply.
[clearing overrides]
boolean
If true, clear any local formatting in the
text object before
applying the style.
Name:
Type:
Description:
using
uppercase, lowercase, titlecase, sentencecase
Case option to use.
Name:
Type:
Description:
[column separator]
string
The character to
interpret as the
column separator.
[row separator]
string
The character to
interpret as the row
separator.
[number of
columns]
integer
The number of
columns in the table
(only used if the
column and row
separators are the
same).
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original text.
None
Return:
Description:
nothing
Apply a paragraph or character
style to the text object.
nothing
Change the case of text.
table
Convert the text to a table. The
parameters for this command
correspond to the options
in the Convert text to table
dialog box (select some text
and choose table>Convert text
to table to display this dialog
box).
objects
Create outlines from the text.
If you set the delete original
parameter to true, InDesign
will delete the original text and
insert the character outlines as
an inline graphic; if the delete
original parameter is false, InDesign creates an independent
graphic and places it above the
text.
nothing
Deletes the object.
InDesign CS Scripting Guide
AppleScript Reference
413
Method:
export
markup
move
place
414
Parameters:
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The full path to the
exported file.
[showing options]
boolean
If true, display the
Export dialog box.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
using
XML element
The XML element
to associate with the
text.
Name:
Type:
Description:
to
before, after, at end, at beginning
Where to move the
text, relative to the
reference object
(before/after).
[reference]
object
A text object that
specifies the destination of the text
you’re moving.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The location (in
page coordinates) at
which to place the
incoming file.
[destination layer]
layer or layer name as string
The layer on which
to place the incoming file.
[showing options]
boolean
If true, display the
import options
dialog box for the
file type being
placed.
[autoflowing]
boolean
If true, autoflow the
incoming text.
[retaining formatting]
boolean
If true, retain the
formatting of the incoming text. If false,
place the text using
the document’s default text formatting
attributes.
[converting
quotes]
boolean
If true, convert typewriter
(“straight”) quotation marks to typographic (“curly”)
quotation marks.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Export the object to a file.
nothing
Associate the text with an XML
element while preserving the
existing text content.
nothing
Moves the text.
object
Place a file.
Method:
search
select
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
InDesign CS Scripting Guide
Selects text.
AppleScript Reference
415
text default
Elements
Element:
Refer to by:
nested style
index, name, range, relative, test
tab stop
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
applied character
style
character style
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
paragraph style
read/write
The paragraph style applied to the text.
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
416
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
gradient fill angle
fixed
read/write
The angle of the gradient applied to the fill
of the text (if any).
gradient fill length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the fill of
the text.
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
InDesign CS Scripting Guide
AppleScript Reference
417
Property:
Type:
Access:
Description:
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
418
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
text default
read only
An object reference to the object.
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
swatch or string
read/write
The gap color of the paragraph rule above.
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
InDesign CS Scripting Guide
AppleScript Reference
419
Property:
Type:
Access:
Description:
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
420
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list
read/write
A list of all of the properties of all of the
tab stops on this text default. Can return:
list of record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
InDesign CS Scripting Guide
AppleScript Reference
421
Property:
Type:
Access:
Description:
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
422
AppleScript Reference
InDesign CS Scripting Guide
text editbox
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
edit contents
string
read/write
The text in the text edit field of the control.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the text editbox within its parent
dialog column, dialog row, enabling group
or border panel
min width
fixed
read/write
The minimum width of the control.
object reference
text editbox
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
make
None
text editbox
Create a new text editbox.
InDesign CS Scripting Guide
AppleScript Reference
423
text export preference
Properties
Property:
Type:
Access:
Description:
character set
unicode, default platform
read/write
The character set to use when exporting
plain text.
class
type
read only
The class of the object.
object reference
text export preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
platform
macintosh, PC
read/write
The platform character set to use when
exporting plain text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
424
AppleScript Reference
InDesign CS Scripting Guide
text frame
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
character
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
path
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text path
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All of the page items within this page
item, regardless of their position in the
object hierarchy (i.e., page items inside
groups or inside other page items will be
included).
associated XML
element
list of XML elements
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
content type
unassigned, graphic type, text type
read/write
The type of content
contents
string
read/write
The text frame’s contents
InDesign CS Scripting Guide
AppleScript Reference
425
Property:
Type:
Access:
Description:
corner effect
none, rounded corner, inverse rounded corner, inset corner, bevel corner,
fancy corner
read/write
The corner effect applied to the page item.
This property corresponds to the Effect
pop-up menu in the Corner Effects dialog
box.
corner radius
fixed
read/write
The radius of the corner effect applied to
the page item. This property corresponds
to the Size field in the Corner Effects
dialog box.
end cap
butt end cap, round end cap, projecting end cap
read/write
The appearance of the end points of an
open path. This property corresponds to
the End Cap options in the Stroke palette.
end join
miter end join, round end join, bevel end join
read/write
The appearance of the stroke at corner
points. This property corresponds to the
End Join options in the Stroke palette.
This property has no effect on smooth (or
“curve”) points on a path.
end text frame
object
read only
The last text frame in the thread
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the page item.
fill tint
fixed
read/write
The tint percentage applied to the fill of
the page item (-1 indicates 100%, or no
override).
gap color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the gap of the stroke of the
page item.
gap tint
fixed
read/write
The tint percentage applied to the gap of
the stroke of the page item (-1 indicates
100%, or no override).
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
gradient fill angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
gradient fill length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the fill of the page
item.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied to the fill of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
gradient stroke
angle
fixed
read/write
The angle of a linear gradient applied to
the fill of the page item.
426
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
gradient stroke
length
fixed
read/write
The length of the ramp of a linear gradient
(or the diameter of the ramp of a radial
gradient) applied to the stroke of the page
item.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the gradient applied
to the stroke of the page item (in page
coordinates). For linear gradients, this
property contains the location of one end
of the gradient; for radial gradients, this
property contains the center point of the
gradient.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the text frame within its parent
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item layer
layer
read/write
The layer containing the page item.
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
left line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the first
(or “left) point of an open path.
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
locked
boolean
read/write
If true, the page item is locked.
miter limit
fixed
read/write
Defines the point at which a corner point
switches from a mitered (pointed) join to
a beveled (squared-off) join. If the width
of the stroke at a corner point would be
wider than this value times the stroke
weight, InDesign applies a beveled join to
the corner.
next text frame
object
read/write
The next text frame in the thread
nonprinting
boolean
read/write
If true, the page item is non-printing.
object reference
text frame
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
overflows
boolean
read only
Whether the frame has overset text. When
true, there is more text in the story but no
remaining text frames in which to place it
overprint fill
boolean
read/write
If true, the fill of the page item will
overprint.
overprint gap
boolean
read/write
If true, overprint the gap color applied to
the stroke of the page item.
overprint stroke
boolean
read/write
If true, overprint the stroke of the page
item.
InDesign CS Scripting Guide
AppleScript Reference
427
Property:
Type:
Access:
Description:
overridden
boolean
read only
If true, this page item originated on a
master spread and was later overridden
(i.e., copied to the document page). It is
still linked to the page item on the master
spread.
overridden master
page item
page item
read only
A reference to the master page item linked
to the page item (if any).
parent
object
read only
The parent of the page item.
parent story
story
read only
The related story
previous text frame object
read/write
The previous text frame in the thread
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right line end
none, simple arrow head, simple wide arrow head, triangle arrow head, triangle wide arrow head, barbed arrow head, curved arrow head, circle arrow
head, circle solid arrow head, square arrow head, square solid arrow head, bar
arrow head
read/write
A shape, such as an arrowhead, on the last
(“right”) point of an open path.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
start text frame
object
read only
The first text frame in the thread
stroke alignment
center alignment, inside alignment, outside alignment
read/write
This property controls the way that the
stroke of a path is drawn relative to the
path, and corresponds to the Stroke Alginment options in the Stroke palette.
stroke color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the stroke of the page item.
428
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
stroke corner
adjustment
none, dashes, gaps, dashes and gaps
read/write
The method used to adjust the position
of dashes and gaps on a dashed stroke
around corner points on a path. This
property corresponds to the Corners popup menu in the Stroke palette (only visible
when a dashed stroke is selected).
stroke dash and
gap
list of fixed or measurement strings {dash, gap, ...}
read/write
The dash and gap settings of a dashed line.
A list of up to 6 values.
stroke tint
fixed
read/write
The tint percentage applied to the stroke
of the page item (-1 indicates 100%, or no
override).
stroke type
stroke style
read/write
The stroke type applied to the page item-either one of the default stroke types, or
the name of a custom stroke style.
stroke weight
fixed
read/write
The weight (in points) of the stroke applied to the page item.
text frame index
integer
read only
index of the text frame in its thread of
linked frames
text frame preferences
text frame preference
read only
text frame preferences
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
Methods
Method:
add path
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Return:
Description:
page item
Create a new shape by adding
the path(s) of this object with
the paths of other objects. This
method corresponds to the
Add path operation (Objects>P
athfinder>Add).
bring forward
None
nothing
Brings the object forward.
bring to front
None
nothing
Brings the object to the top
objects
Create outlines from the text.
create outlines
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original objects.
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
page item
Creates a new shape by excluding area of intersection of this
object with the other objects.
This method corresponds
to the Exclude Overlap path
operation (Objects>Pathfinder
>Exclude Overlap).
exclude overlap
path
Name:
Type:
Description:
with
list of objects
The objects to
exclude.
InDesign CS Scripting Guide
AppleScript Reference
429
Method:
export
Parameters:
Name:
Type:
Description:
format
string (name of export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
given
content to frame, frame to content, center content, proportionally
The fit option to use.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
with
list of objects
The objects to intersect with.
Name:
Type:
Description:
[layer]
layer or layer name as string
The layer on which
to create the textFrame as layer.
[at]
before, after, at end, at beginning,
unknown
Location.
[reference]
object
Before/after this
textFrame or at
the beginning/end
of this document,
spread, Master
spread, page or
layer as document,
spread, master
spread, page or
layer.
make compound
path
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
markup
Name:
Type:
Description:
using
XML element
The element to mark
up.
extract label
fit
insert label
intersect path
make
430
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Exports the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Fit content within a graphic
frame.
nothing
Sets the string associated with
the given key (label name).
page item
Create a new shape based on
the area of intersection of this
object and other objects. This
method corresponds to the
Intersect path operation (Objec
ts>Pathfinder>Intersect).
text frame
Create a new text frame.
page item
Create a compound path by
adding the paths of this object
to the paths of other objects.
This method corresponds
to the Object>Compound
paths>Make command.
nothing
Markup layout content with
XML preserving the existing
content.
Method:
minus back
move
override
place
place xml
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current position.
Name:
Type:
Description:
destination page
page
The page on which
to override the master page item.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point where
to place the object
(only applicable if
you are telling a
page or spread to
place).
[destination layer]
layer or layer name as string
The layer(s) to place
the file on (only
valid if you are telling a page or spread
to place).
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
Any settable property of the placed
object.
Name:
Type:
Description:
using
XML element
The element to place
into.
Return:
Description:
page item
Create a new shape by reverse
subtracting this object from
other objects. This method
corresponds to the Minus Back
path operation (Objects>Pathfi
nder>Minus Back).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
page item
Overrides an item from the
master page and places it on
the page.
object
Place a file.
nothing
Places XML content from the
specified element replacing the
existing content.
release compound
path
None
objects
release compound path.
remove override
None
nothing
Removes a locally overriden
master page item
reset scaling
None
nothing
Reset an item to 100% scaling,
resizes to retain same appearance
InDesign CS Scripting Guide
AppleScript Reference
431
Method:
resize
rotate
scale text attributes
432
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The percentage of
horizontal scale.
[vertical scale]
fixed
The percentage of
vertical scale.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around, either one
of the enums or an
x,y value.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to rotate
around, either one
of the enums or an
x,y value.
[considering current rotation]
boolean
if true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
if true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
if true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
None
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
nothing
Move a text frame’s scaling into
the text attributes
Method:
search
select
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
Select this text frame.
send backward
None
nothing
Sends the object backward.
send to back
None
nothing
Send object to the back
nothing
Shear the page item.
asset
Store a page item in a library.
shear
store
Name:
Type:
Description:
by
number
angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
the point to shear
around, either one
of the enums or an
x,y value.
[considering current shear]
boolean
if true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
if true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
if true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
library
The library in which
to store.
InDesign CS Scripting Guide
AppleScript Reference
433
Method:
subtract path
unlink
434
Parameters:
Name:
Type:
Description:
with
list of objects
The objects to merge
with this object.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
page item
Create a new shape by subtracting the area of intersection of
this object and other objects
from the other objects. This
method corresponds to the
Subtract path operation (Objec
ts>Pathfinder>Subtract).
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
text frame preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
first baseline offset
ascent offset, cap height, leading offset, embox height, x height, fixed height
read/write
The method used to calculate the distance
between the first baseline of text in the
text frame and the top inset of the text
frame.
ignore wrap
boolean
read/write
If true, the text in the text frame ignores
the text wrap of other objects.
inset spacing
list or fixed or measurement strings
read/write
The text inset of the text frame. For
rectangular text frames, this property
contains a four-item list; for non-rectangular text frames, the property contains a
single value.
minimum first
baseline offset
fixed or measurement string
read/write
The minimum distance in points between
the baseline of the first line of text in the
text frame and the top inset of the text
frame.
object reference
text frame preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
text column count
integer
read/write
The number of columns in the text frame.
text column fixed
width
fixed or measurement string
read/write
The fixed column width of the text frame.
text column gutter
fixed or measurement string
read/write
The distance between the columns of the
text frame.
use fixed column
width
boolean
read/write
If true, the columns of the text frame are a
fixed width.
vertical justification
top align, center align, bottom align, justify align
read/write
The type of vertical justification applied to
the text frame.
vertical threshold
fixed or measurement string
read/write
The maximum amount of vertical space
between two paragraphs.
InDesign CS Scripting Guide
AppleScript Reference
435
text import preference
Properties
Property:
Type:
Access:
Description:
character set
ansi, ASCII, unicode, RecommendShiftJIS83pv, ShiftJIS90pv, ShiftJIS90ms,
GB2312, chinese big 5, macintosh CE, macintosh cyrillic, macintosh greek,
macintosh turkish, windows cyrillic, windows EE, windows greek, windows
turkish, DOS latin 2
read/write
The character set to use.
class
type
read only
The class of the object.
convert spaces into
tabs
boolean
read/write
If true, convert sequentially repeating
spaces to tabs.
dictionary
string
read/write
language to use.
object reference
text import preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
platform
macintosh, PC
read/write
The platform character set to use when
exporting plain text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
spaces into tabs
count
integer
read/write
The number of sequential spaces to convert to a tab.
strip returns
between lines
boolean
read/write
If true, remove extra carriage returns at
the ends of lines.
strip returns between paragraphs
boolean
read/write
If true, remove extra carriage returns
between paragraphs.
436
AppleScript Reference
InDesign CS Scripting Guide
text path
Elements
Element:
Refer to by:
character
index, name, range, relative, test
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
paragraph
index, name, range, relative, test
text
index, name, range, relative, test
text column
index, name, range, relative, test
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
center bracket
fixed
read only
The center bracket.
class
type
read only
The class of the object.
contents
string
read/write
The contents of the text object. If the text
object is a single character, this property
might contain either a special character
constant or a string; for text objects containing multiple characters, this property
will contain a string.
end bracket
fixed
read/write
The end bracket.
end text frame
object
read only
The last text frame in the thread.
flip path effect
not flipped, flipped, undefined flip value
read/write
The flip path effect.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the object within its parent
object.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
next text frame
object
read/write
The next text frame in the thread.
object reference
text path
read only
An object reference to the object.
overflows
boolean
read only
If true, the text path contains overset text.
parent
object
read only
The parent of the object.
parent story
story
read only
The related story
path alignment
top path alignment, bottom path alignment, center path alignment
read/write
The path alignment.
path effect
rainbow path effect, skew path effect, ribbon path effect, stair step path effect,
gravity path effect
read/write
The path effect.
path spacing
integer
read/write
The path spacing.
previous text frame object
read/write
The previous text frame in the thread.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
start bracket
fixed
read/write
The start bracket.
start text frame
object
read only
The first text frame in the thread.
text alignment
ascender text alignment, descender text alignment, center text alignment,
baseline text alignment, above right em box text alignment, below left em
box text alignment, above right icf box text alignment, below left icf box text
alignment
read/write
The text alignment.
text frame index
integer
read only
index of the text frame in its thread of
linked frames.
InDesign CS Scripting Guide
AppleScript Reference
437
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
text path
Create a new text path.
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
extract label
insert label
make
search
438
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
AppleScript Reference
InDesign CS Scripting Guide
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
text preference
Properties
Property:
Type:
Access:
Description:
abut text to text
wrap
boolean
read/write
If true, text will abut the bottom of a text
wrap object.
baseline shift key
increment
fixed
read/write
The amount of baseline shift each press
of the shift-option/alt-up arrow or
shift-option/alt-down arrow increases or
decreases.
class
type
read only
The class of the object.
highlight custom
spacing
boolean
read/write
If true, use on-screen highlighting to
identify custom spacing.
highlight hj violations
boolean
read/write
If true, use on-screen highlighting to
identify hyphenation and justification
violations.
highlight keeps
boolean
read/write
If true, use on-screen highlighting to identify paragraphs that violate keep options.
highlight substituted fonts
boolean
read/write
If true, to highlight text formatted using
missing fonts.
highlight substituted glyphs
boolean
read/write
If true, use on-screen highlighting to
identify substituted glyphs.
justify text wraps
boolean
read/write
If true, to justify text where it wraps
around other objects.
kerning key increment
fixed
read/write
The amount of kerning each press of the
option/alt-right arrow or option/alt-left
arrow increases or decreases.
leading key increment
fixed
read/write
The amount of leading each press of the
option/alt-up arrow or option/alt-down
arrow increases or decreases.
link text files when
importing
boolean
read/write
Whether text files should be linked when
importing
object reference
text preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
scaling adjusts text
boolean
read/write
If true, scaling adjusts text attributes.
show invisibles
boolean
read/write
If true, show hidden characters.
small cap
fixed
read/write
The percentage of the font size for text
formatted as small caps. This setting
has no effect on true small caps from an
OpenType font.
subscript position
fixed
read/write
The percentage of the leading that subscripted text will move.
subscript size
fixed
read/write
The percentage of the font size for subscripted text.
superscript position
fixed
read/write
The percentage of the leading that the
superscripted text will move.
superscript size
fixed
read/write
The percentage of the font size for superscripted text.
typographers
quotes
boolean
read/write
If true, typed straight quotes will be converted to typographic quotes.
use optical size
boolean
read/write
If true, use a multiple master’s optical size
axis.
use paragraph
leading
boolean
read/write
If true, apply leading changes to entire
paragraphs.
InDesign CS Scripting Guide
AppleScript Reference
439
Property:
Type:
Access:
Description:
z order text wrap
boolean
read/write
Whether text wrap only affects text beneath it in the z order.
440
AppleScript Reference
InDesign CS Scripting Guide
text style range
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
character
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
nested style
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
tab stop
index, name, range, relative, test
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All page item objects contained by this
text object, including any nested page
items or page items inside groups.
applied character
style
character style
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
paragraph style
read/write
The paragraph style applied to the text.
InDesign CS Scripting Guide
AppleScript Reference
441
Property:
Type:
Access:
Description:
ascent
fixed
read only
The maximum ascent of any character in
the text object (in points, relative to the
baseline of the line containing the text).
associated XML
elements
list of XML elements
read only
The XML elements associated with this
text object (if any).
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
baseline
fixed
read only
The vertical location of the baseline of the
text, in the current vertical measurement
units, relative to the ruler zero point.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
contents
string
read/write
The contents of the text object. If the text
object is a single character, this property
might contain either a special character
constant or a string; for text objects containing multiple characters, this property
will contain a string.
descent
fixed
read only
The maximum descent of any character in
the text, in points, relative to the baseline
of the line containing the text object.
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
442
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
gradient fill angle
fixed
read/write
The angle of the gradient applied to the fill
of the text (if any).
gradient fill length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the fill of
the text.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to the fill of the text, or the center
point of a radial gradient applied to the fill
of the text.
gradient stroke
angle
fixed
read/write
The angle of the gradient applied to the
stroke of the text.
gradient stroke
length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the stroke
of the text.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to stroke of the text, or the center
point of a radial gradient applied to the
stroke of the text.
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal offset
fixed
read only
The horizontal location of the left edge
of the first character in the text, in page
coordinates, relative to the current zero
point.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
InDesign CS Scripting Guide
AppleScript Reference
443
Property:
Type:
Access:
Description:
index
integer
read only
index of the object within its parent
object.
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
length
integer
read only
The number of characters in the text
object.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
444
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
text style range
read only
An object reference to the object.
open type features
list of long
read/write
open type features
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
parent story
story
read only
The story containing the text object.
parent text frame
text frame
read only
The text frame containing the text object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
swatch or string
read/write
The gap color of the paragraph rule above.
InDesign CS Scripting Guide
AppleScript Reference
445
Property:
Type:
Access:
Description:
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
446
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list of objects
read/write
A list of all of the properties of all of the
tab stops on this text style range. Can
return: list of record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
InDesign CS Scripting Guide
AppleScript Reference
447
Property:
Type:
Access:
Description:
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
Methods
Method:
apply style
changecase
convert to table
create outlines
delete
448
Parameters:
Name:
Type:
Description:
using
character style, paragraph style, or string
The paragraph style
or character style to
apply.
[clearing overrides]
boolean
If true, clear any local formatting in the
text object before
applying the style.
Name:
Type:
Description:
using
uppercase, lowercase, titlecase, sentencecase
Case option to use.
Name:
Type:
Description:
[column separator]
string
The character to
interpret as the
column separator.
[row separator]
string
The character to
interpret as the row
separator.
[number of
columns]
integer
The number of
columns in the table
(only used if the
column and row
separators are the
same).
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original text.
None
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Apply a paragraph or character
style to the text object.
nothing
Change the case of text.
table
Convert the text to a table. The
parameters for this command
correspond to the options
in the Convert text to table
dialog box (select some text
and choose table>Convert text
to table to display this dialog
box).
objects
Create outlines from the text.
If you set the delete original
parameter to true, InDesign
will delete the original text and
insert the character outlines as
an inline graphic; if the delete
original parameter is false, InDesign creates an independent
graphic and places it above the
text.
nothing
Deletes the object.
Method:
export
markup
move
place
Parameters:
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The full path to the
exported file.
[showing options]
boolean
If true, display the
Export dialog box.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
using
XML element
The XML element
to associate with the
text.
Name:
Type:
Description:
to
after, at beginning, at end, before
Where to move the
text, relative to the
reference object
(before/after).
[reference]
object
A text object that
specifies the destination of the text
you’re moving.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The location (in
page coordinates) at
which to place the
incoming file.
[destination layer]
layer
The layer on which
to place the incoming file.
[showing options]
boolean
If true, display the
import options
dialog box for the
file type being
placed.
[autoflowing]
boolean
If true, autoflow the
incoming text.
[retaining formatting]
boolean
If true, retain the
formatting of the incoming text. If false,
place the text using
the document’s default text formatting
attributes.
[converting
quotes]
boolean
If true, convert typewriter
(“straight”) quotation marks to typographic (“curly”)
quotation marks.
Return:
Description:
nothing
Export the object to a file.
nothing
Associate the text with an XML
element while preserving the
existing text content.
nothing
Moves the text.
object
Place a file.
InDesign CS Scripting Guide
AppleScript Reference
449
Method:
search
select
450
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
Selects text.
text wrap preference
Elements
Element:
Refer to by:
path
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
contour options
contour option
read only
The contour options.
inverse
boolean
read/write
If true, invert the text wrap (creating an
inside-out wrap).
object reference
text wrap preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
text wrap offset
list of fixed or measurement strings
read/write
The amount of offset to move the wrap
away from the edges of the frame. Can
return: number or string, list of numbers
or strings or nothing.
text wrap type
none, jump object text wrap, next column text wrap, bounding box text wrap,
contour, user modified
read/write
The type of text wrap applied to the object.
InDesign CS Scripting Guide
AppleScript Reference
451
tint
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
color value
list of fixed
read/write
The color values of the tint
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the tint within its parent
application or document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
model
spot, process, registration, mixedinkmodel
read/write
The color model of the tint.
name
string
read/write
The name of the tint.
object reference
tint
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
space
RGB, CMYK, LAB, mixed ink
read/write
The color space of the tint.
tint value
fixed
read/write
The percentage tint of the base color.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
tint
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
tint
Create a new tint.
nothing
Merge one or more other
swatches into this one.
extract label
insert label
make
merge
452
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[color]
object
The base color as
color.
Name:
Type:
Description:
with
object
The swatches to
merge.
AppleScript Reference
InDesign CS Scripting Guide
TOC style
Elements
Element:
Refer to by:
TOC style entry
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
include book
documents
boolean
read/write
If the document this TOC style belongs to
is in a book, whether to include TOC data
from other book documents.
include hidden
boolean
read/write
If true, include text on hidden layers in the
generated TOC.
index
integer
read only
index of the TOC style within its parent
application or document
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
name
string
read/write
The name of the TOC style.
object reference
TOC style
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
run in
boolean
read/write
If true, use a run-in format for the TOC.
title
string
read/write
The title of the TOC.
title style
paragraph style
read/write
The paragraph style to apply to the TOC
title in the generated TOC.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
toc style
Create a new toc style.
extract label
insert label
make
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
InDesign CS Scripting Guide
AppleScript Reference
453
TOC style entry
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
format style
paragraph style
read/write
The paragraph style to apply to the TOC
entry text in the generated TOC.
index
integer
read only
index of the TOC style entry within its
parent TOC style
level
small integer
read/write
Level of this TOC style entry.
name
string
read/write
The name of the TOC style entry.
object reference
TOC style entry
read only
An object reference to the object.
page number position
after entry, before entry, none
read/write
Options for where to put page number.
page number style
character style
read/write
The character style to apply to the page
number.
parent
TOC style
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
separator
string
read/write
The string between entry text and page
number.
separator style
character style
read/write
The character style to apply to the separator text.
sort alphabet
boolean
read/write
If true, sort the entries in the generated
TOC alphabetically.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
454
AppleScript Reference
InDesign CS Scripting Guide
topic
Elements
Element:
Refer to by:
cross reference
index, name, range, relative, test, id
page reference
index, name, range, relative, test, id
subtopic
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
index
integer
read only
index of the topic within its parent index
name
string
read only
The name of the index topic.
object reference
topic
read only
An object reference to the object.
parent
index
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
capitalize
delete
make
Parameters:
Name:
Type:
Description:
[capitalization
option]
selected entry, include subentries, all
level1 entries, all entries
What to capitalize.
None
Name:
Type:
Description:
name
string
topic name.
[sort by]
string
String to use for
sorting this topic as
string.
Return:
Description:
nothing
Applies capitalization options
to the index entries.
nothing
Deletes the object.
topic
Create a new topic.
InDesign CS Scripting Guide
AppleScript Reference
455
transform preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class descriptor type
dimensions include
stroke weight
boolean
read/write
Whether transform panel includes stroke
weight in its dimension values
object reference
transform preference
read only
An object reference for this transform
preference
parent
object
read only
The transform preference’s parent
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
scale strokes
boolean
read/write
Whether strokes are scaled when objects
are scaled
show content offset
boolean
read/write
Whether transform panel display values
includes stroke weight in its dimension
values
transform content
boolean
read/write
Whether transform panel transforms
content when rotating, scaling, skewing
and resizing objects
transformations
are totals
boolean
read/write
Whether transform panel displays values
for nested objects relative to the parent
object
456
AppleScript Reference
InDesign CS Scripting Guide
transparency preference
Properties
Property:
Type:
Access:
Description:
blending space
default, RGB, CMYK
read/write
Determines the color space in which
colors will be blended on spreads where
there is transparency present.
class
type
read only
The class of the object.
object reference
transparency preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
InDesign CS Scripting Guide
AppleScript Reference
457
trap preset
Properties
Property:
Type:
Access:
Description:
black color threshold
fixed
read/write
Trap preset’s black color threshold in
percentage between 0% and 100%
black density
fixed
read/write
Trap preset’s black density in the range,
0.001 to 12.0
black width
fixed
read/write
The trap preset’s black width in the range
0.0 and 8.0
class
type
read only
The class descriptor type
color reduction
fixed
read/write
Trap preset’s color reduction threshold in
percentage between 0% and 100%
default trap width
fixed
read/write
The trap preset’s default width in the
range 0.0 and 8.0
id
integer
read only
The trap preset’s unique id
image placement
center edges, choke, image neutral density, images over spread
read/write
The trap preset’s image placement
images to images
boolean
read/write
If true, trap images to images
index
integer
read only
index of the trap preset within its parent
application or document
internal images
boolean
read/write
If true, trap images internally
label
string
read/write
A label that can be set to any string
name
string
read/write
The name of the trap preset
object reference
trap preset
read only
An object reference for this trap preset
objects to images
boolean
read/write
If true, trap objects to images.
one bit images
boolean
read/write
If trye, apply trapping to one-bit images
parent
object
read only
The trap preset’s parent. Can return:
application or document.
properties
AppleScript record
read/write
Property that allows setting of several
properties at the same time
sliding trap
threshold
fixed
read/write
Trap preset’s sliding trap threshold in
percentage between 0% and 100%
step threshold
fixed
read/write
Trap preset’s step threshold in percentage
between 1% and 100%
trap end
miter trap ends, overlap trap ends
read/write
The trap preset’s end type
trap join
miter end join, round end join, bevel end join
read/write
The trap preset’s join type
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
trap preset
Create a new trap preset.
extract label
insert label
make
458
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
AppleScript Reference
InDesign CS Scripting Guide
user dictionary
Properties
Property:
Type:
Access:
Description:
added words
list of string
read/write
words in the user dictionary.
class
type
read only
The class of the object.
index
integer
read only
index of the user dictionary within its parent application
name
string
read only
The name of the user dictionary.
object reference
user dictionary
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
removed words
list of strings
read/write
words in the not list dictionary.
Methods
Method:
add word
remove word
Parameters:
Name:
Type:
Description:
added words
list of strings
The list of exceptions to remove
from the user
dictionary.
[removed list]
boolean
If true, modify the
‘removed words’ list,
the ‘added words’
list is modified by
default.
Name:
Type:
Description:
removed words
list of strings
The list of exceptions to remove
from the user
dictionary.
[removed list]
boolean
If true, modify the
‘removed words’ list,
the ‘added words’
list is modified by
default.
Return:
Description:
nothing
Add a word to the user dictionary.
nothing
Remove a word from the user
dictionary.
InDesign CS Scripting Guide
AppleScript Reference
459
validation error
Properties
Property:
Type:
Access:
Description:
attribute name
string
read only
The attribute name if the validation error
refers to an attribute.
class
type
read only
The class of the object.
element
XML element
read only
The XML element which caused the validation error.
error message
string
read only
The validation error message.
index
integer
read only
index of the validation error within its
parent document
object reference
validation error
read only
An object reference to the object.
parent
document
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
460
AppleScript Reference
InDesign CS Scripting Guide
view preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
cursor key increment
fixed
read/write
The distance each press of an arrow key
will move the selection.
guide snapto zone
integer
read/write
The range within which an object snaps
to guides.
horizontal measurement units
points, picas, inches, inches decimal, millimeters, centimeters, ciceros
read/write
The measurement unit to use for the
horizontal ruler.
object reference
view preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
ruler origin
spread origin, page origin, spine origin
read/write
Where the default ruler origin (zero point)
should appear.
show frame edges
boolean
read/write
If true, show the edges of non-selected text
frames.
show rulers
boolean
read/write
If true, show the horizontal and vertical
rulers.
vertical measurement units
points, picas, inches, inches decimal, millimeters, centimeters, ciceros
read/write
The measurement unit to use for the vertical ruler.
InDesign CS Scripting Guide
AppleScript Reference
461
view zoom behavior
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
enable behavior
boolean
read/write
Whether behavior is enabled
event
mouse up, mouse down, mouse enter, mouse exit, on focus, on blur
read/write
The event which triggers the behavior
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the view zoom behavior within its
parent form field or button
label
string
read/write
A property that can be set to any string (of
up to 32Kb in length).
name
string
read only
The name of the view zoom behavior.
object reference
view zoom behavior
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
view zoom style
full screen, zoom in, zoom out, fit page, actual size, fit width, fit visible, reflow,
single page, one column, two column, rotate CW, rotate CCW
read/write
The View Zoom style.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
view zoom
behavior
Create a new view zoom
behavior.
extract label
insert label
make
462
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
None
AppleScript Reference
InDesign CS Scripting Guide
Description:
widget
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the widget within its parent
dialog column, dialog row, enabling group
or border panel
min width
fixed
read/write
The minimum width of the control.
object reference
widget
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
InDesign CS Scripting Guide
AppleScript Reference
463
window
Properties
Property:
Type:
Access:
Description:
bounds
list of numbers or measurement strings {top, left, bottom, right}
read/write
The bounds of the window, in screen
pixels.
class
type
read only
The class of the object.
index
integer
read only
index of the window within its parent
document or application
name
string
read only
The name of the window.
object reference
window
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
selection
list
read/write
The selection of the window.
Methods
Method:
Parameters:
Return:
Description:
bring to front
None
nothing
Brings the object to the top
close
None
nothing
Close the window
make
None
window
Create a new window.
maximize
None
nothing
Maximize the window
minimize
None
nothing
Minimize the window
restore
None
nothing
Restore the window
nothing
Selects an object or objects.
If the object is a text object
(e.g., characters, words, lines,
paragraphs), any other selected
objects are deselected (the AppendSelection parameter has
no effect).
select
464
Name:
Type:
Description:
selectable items
object, list of objects, or nothing (to
deselect all)
The object(s) to
select.
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
AppleScript Reference
InDesign CS Scripting Guide
WMF
Properties
Property:
Type:
Access:
Description:
absolute horizontal
scale
fixed
read/write
The horizontal scaling percentage applied
to the page item, relative to its containing
page item.
absolute rotation
angle
fixed
read/write
The rotation angle of the page item relative
to its containing page item.
absolute shear
angle
fixed
read/write
The shear angle of the page item relative to
its containing page item.
absolute vertical
scale
fixed
read/write
The vertical scaling percentage applied to
the page item, relative to its containing
page item.
associated XML
element
XML element
read only
Returns the XML element (or elements)
associated with this page item.
blend mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the object. This property corresponds
to the Blending Mode pop-up menu in the
Transparency palette.
class
type
read only
The class of the object.
clipping path
clipping path settings
read only
The clipping path settings
feather corner type
sharp, rounded, diffusion
read/write
This property controls the appearance
of the feathering effect near the corners
of the page item, and corresponds to the
Corners pop-up menu in the Feather
dialog box.
feather mode
none, standard
read/write
Turns feathering on or off for the page
item. This property corresponds to the
Feather option in the Feather dialog box.
feather width
fixed
read/write
The width of the feathering effect applied
to the page item. This option corresponds
to the Feather Width field in the Feather
dialog box.
geometric bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item excluding the
stroke width. If you want to consider the
width of the stroke when calculating the
bounds, use the visible bounds property
instead.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the page item.
id
integer
read only
A unique number identifying the object.
image type name
string
read only
The type of image
index
integer
read only
index of the wmff within its parent XML
element, page item, oval, rectangle, polygon, graphic line, state, group or button
isolate blending
boolean
read/write
If true, blend the page item in isolation.
This property corresponds to the Isolate
Blending option in the Transparency
palette.
item link
link
read only
link to a placed file
knockout group
boolean
read/write
If true, apply transparency to the objects
in the page item, but knock out any background objects. This property corresponds
to the Knockout group option in the
Transparency palette.
label
string
read/write
A property that can be set to any string
(up to 32Kb of text).
InDesign CS Scripting Guide
AppleScript Reference
465
Property:
Type:
Access:
Description:
local display setting
high quality, typical, optimized, default
read/write
The display setting for this page item.
nonprinting
boolean
read/write
Whether the page item is non-printing
object reference
WMF
read only
An object reference to the object.
opacity
fixed
read/write
The opacity of the page item. This property corresponds to the Opacity field/slider
in the Transparency palette.
parent
object
read only
The parent of the page item.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
rotation angle
fixed
read/write
The rotation angle of the page item.
shadow blend
mode
normal, multiply, screen, overlay, soft light, hard light, color dodge, color
burn, darken, lighten, difference, exclusion, hue, saturation, color, luminosity
read/write
The transparency blending mode applied
to the drop shadow of the page item. This
property corresponds to the Mode pop-up
menu in the Drop Shadow dialog box.
shadow blur radius
fixed
read/write
The blur radius applied to the drop
shadow of the page item. This property
corresponds to the Blur field in the Drop
Shadow dialog box.
shadow color
swatch
read/write
The color of the drop shadow applied to
the page item. This property corresponds
to the color pop-up menu in the Drop
Shadow dialog box.
shadow mode
none, drop
read/write
This property turns the drop shadow
effect on or off for the page item, and corresponds to the Drop Shadow option in
the Drop Shadow dialog box.
shadow opacity
fixed
read/write
The opacity of the drop shadow applied
to the page item, as a percentage from 0
to 100. This property corresponds to the
Opacity field in the Drop Shadow dialog
box.
shadow x offset
fixed
read/write
The horizontal offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the X Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the left; positive values move it
to the right.
shadow y offset
fixed
read/write
The vertical offset of the drop shadow
from the page item, in current measurement units. This property corresponds
to the Y Offset field in the Drop Shadow
dialog box. Negative values move the
shadow to the up; positive values move it
down.
shear angle
fixed
read/write
The shear angle applied to the page item.
text wrap preferences
text wrap preference
read only
The text wrap applied to the page item.
vertical scale
fixed
read/write
The vertical scaling percentage of the page
item.
visible bounds
list of fixed or measurement strings {y1, x1, y2, x2}
read/write
The bounds of the page item including
the stroke width. If you want to ignore
the width of the stroke when calculating
the bounds, use the geometric bounds
property instead.
466
AppleScript Reference
InDesign CS Scripting Guide
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
nothing
Export the object to file.
string
Gets the label value associated with the given key (label
name).
nothing
Sets the string associated with
the given key (label name).
nothing
Move page Item to a new location. One of the ‘To’ or ‘By’
parameters is required.
object
Place a file.
export
extract label
insert label
move
place
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
key
string
The key.
Name:
Type:
Description:
key
string
The key.
value
string
The string to insert
in the label.
Name:
Type:
Description:
[to]
list of fixed or measurement strings {x, y}
or page, spread, master spread, or layer
The new location of
the object.
[by]
list of fixed or measurement strings {x, y}
Amount by which
to move the object
relative to its current location.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The point at which
to place the file.
[destination layer]
layer or layer name as string
The layer on which
to place the file.
[showing options]
boolean
If true, display the
import options
dialog.
[autoflowing]
boolean
If true, autoflow
placed text.
[retaining formatting]
boolean
If true, keep formatting of placed text
files.
[converting
quotes]
boolean
If true, convert
straight quotes
to typographer’s
quotes.
InDesign CS Scripting Guide
AppleScript Reference
467
Method:
resize
rotate
468
Parameters:
Name:
Type:
Description:
[horizontal scale]
fixed
The horizontal scaling percentage.
[vertical scale]
fixed
The vertical scaling
percentage.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to scale
around.
[considering current scale]
boolean
If true then the
object’s current
scale and new scale
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and items
within it are scaled.
[considering parents scale]
boolean
If true then the
object is scaled
relative to its parent
page item. If false it
is scaled relative to
the spread.
Name:
Type:
Description:
by
number
Angle by which to
rotate the page item.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to rotate
around.
[considering current rotation]
boolean
If true then the
object’s current
rotation and new
rotation will be
combined. If false
then the new value
is absolute. The default value is false.
[transforming
content]
boolean
If true then both
the object and items
within it are rotated.
[considering parents rotation]
boolean
If true then the
object is rotated
relative to its parent
page item. If false it
is rotated relative to
the spread.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Resize the page item. You must
specify either horizontal scale
or vertical scale or both.
nothing
Rotate the page item.
Method:
shear
store
unlink
Parameters:
Name:
Type:
Description:
by
number
Angle by which to
shear the object.
[around]
list or numbers or measurement strings
{x, y} or bottom center anchor, bottom
left anchor, bottom right anchor, center
anchor, left center anchor, right center
anchor, top left anchor, top center anchor, top right anchor
The point to shear
around.
[considering current shear]
boolean
If true then the
object’s current
shear and new shear
will be combined. If
false then the new
value is absolute.
The default value is
false.
[transforming
content]
boolean
If true then both
the object and
items within it are
sheared.
[considering parents shear]
boolean
If true then the
object is sheared
relative to its parent
page item. If false it
is sheared relative to
the spread.
Name:
Type:
Description:
using
Library
The library in which
to store.
Name:
Type:
Description:
from
page or master spread
What to unlink
from.
Return:
Description:
nothing
Shear the page item.
asset
Store a page item in a library.
nothing
Detaches an overridden master
page item from the page or
from the master, or a text frame
from its threads.
InDesign CS Scripting Guide
AppleScript Reference
469
word
Elements
Element:
Refer to by:
button
index, name, range, relative, test, id
character
index, name, range, relative, test
form field
index, name, range, relative, test, id
graphic line
index, name, range, relative, test, id
group
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
nested style
index, name, range, relative, test
oval
index, name, range, relative, test, id
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
polygon
index, name, range, relative, test, id
rectangle
index, name, range, relative, test, id
tab stop
index, name, range, relative, test
table
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text frame
index, name, range, relative, test, id
text style range
index, name, range, relative, test
word
index, name, range, relative, test
Properties
Property:
Type:
Access:
Description:
align to baseline
boolean
read/write
If true, the baseline of the text in the paragraph containing the text object will align
to the document’s baseline grid.
all graphics
list of graphics
read only
All graphics
all page items
list of page items
read only
All page item objects contained by this
text object, including any nested page
items or page items inside groups.
applied character
style
character style
read/write
The character style applied to the text.
applied font
font or font name as string
read/write
The font applied to the text. You can apply
a font using either a font object or a string
containing the name of the font family
(“MinionPro”). To set both the font family
and the font style at the same time, you
can also use a string in the form font_
family_name tab font_style_name (for
example, “MinonPro Semibold Cond” for
MinionPro Semibold Condensed).
applied language
language
read/write
The language applied to the text. This
value can be a language object or the
name of the language dictionary (“,” for
example).
applied paragraph
style
paragraph style
read/write
The paragraph style applied to the text.
470
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
ascent
fixed
read only
The maximum ascent of any character in
the text object (in points, relative to the
baseline of the line containing the text).
associated XML
elements
list of XML elements
read only
The XML elements associated with this
text object (if any).
auto leading
fixed
read/write
Auto leading percentage applied to the
paragraph containing the text. Multiply
this value by the point size to calculate the
leading value.
balance ragged
lines
boolean
read/write
If true, InDesign will attempt to balance
the lines (i.e., make them the same width)
in the paragraph containing the text
object. This property has no effect on
justified text.
baseline
fixed
read only
The vertical location of the baseline of the
text, in the current vertical measurement
units, relative to the ruler zero point.
baseline shift
fixed
read/write
The amount of baseline shift (in points)
applied to the text object. Baseline shift is
applied relative to the baseline of the line
containing the text object. Positive values
move the text above the baseline; negative
values move the text below the baseline.
capitalization
normal, small caps, all caps, cap to small cap
read/write
The capitalization option applied to the
text. Note that this does not change the
typed characters in the text; only the appearance of the characters (on-screen and
in print) is affected.
class
type
read only
The class of the object.
composer
string
read/write
The text composer applied to the paragraph containing the text object. Use
“Adobe paragraph Composer” for the
paragraph (i.e., multi-line) composer, or
“Adobe Single-line Composer” for the
single-line composer.
contents
string
read/write
The contents of the text object. If the text
object is a single character, this property
might contain either a special character
constant or a string; for text objects containing multiple characters, this property
will contain a string.
descent
fixed
read only
The maximum descent of any character in
the text, in points, relative to the baseline
of the line containing the text object.
desired glyph
scaling
fixed
read/write
The desired glyph scaling percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Glyph Scaling field in the Justification
dialog box.
desired letter
spacing
fixed
read/write
The desired letter spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
Letter Spacing field in the Justification
dialog box.
desired word
spacing
fixed
read/write
The desired word spacing percentage applied to the paragraph containing the text.
This property corresponds to the Desired
word Spacing field in the Justification
dialog box.
drop cap
characters
small integer
read/write
Number of characters for drop cap.
drop cap lines
small integer
read/write
Number of lines for drop cap.
InDesign CS Scripting Guide
AppleScript Reference
471
Property:
Type:
Access:
Description:
drop cap style
character style
read/write
character style of drop cap. Can also accept: string.
fill color
swatch
read/write
The swatch, color, tint, gradient, or mixed
ink applied to the fill of the text.
fill tint
fixed
read/write
The tint applied to the fill color of the
characters in the text object (-1 indicates
no tint or 100%).
first line indent
fixed or measurement string
read/write
The indent applied to the first line of the
paragraph containing the text.
font style
string
read/write
The name of the font style applied to the
text (“Regular,” or “Bold,” for example).
gradient fill angle
fixed
read/write
The angle of the gradient applied to the fill
of the text (if any).
gradient fill length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the fill of
the text.
gradient fill start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to the fill of the text, or the center
point of a radial gradient applied to the fill
of the text.
gradient stroke
angle
fixed
read/write
The angle of the gradient applied to the
stroke of the text.
gradient stroke
length
fixed
read/write
Length of a linear gradient or the radius
of a radial gradient applied to the stroke
of the text.
gradient stroke
start
list of fixed or measurement strings {x, y}
read/write
The starting point of the linear gradient
applied to stroke of the text, or the center
point of a radial gradient applied to the
stroke of the text.
grid align first line
only
boolean
read/write
If true, only the first line of the paragraph
containing the text object will be aligned
to the frame grid (InDesign J only) or
baseline grid.
horizontal offset
fixed
read only
The horizontal location of the left edge
of the first character in the text, in page
coordinates, relative to the current zero
point.
horizontal scale
fixed
read/write
The horizontal scaling percentage applied
to the text object.
hyphen weight
small integer
read/write
The weight (in points) of hyphen
characters used in the text object.
hyphenate after
first
small integer
read/write
Sets the minimum length (in characters)
of the word fragment preceding a hyphenation break.
hyphenate before
last
small integer
read/write
Sets the minimum length (in characters)
of the word fragment following a hyphenation break.
hyphenate capitalized words
boolean
read/write
If true, hyphenate capitalized words in
the text.
hyphenate ladder
limit
small integer
read/write
Sets the maximum number of consecutive
lines of text that can end with a hyphen.
hyphenate words
longer than
small integer
read/write
Sets the minimum word length (in
characters) of words to eligible for hyphenation.
hyphenation
boolean
read/write
If true, hyphenation is on for the paragraph containing the text.
hyphenation zone
fixed or measurement string
read/write
The width of the hyphenation zone applied to the paragraph containing the text.
472
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
index
integer
read only
index of the object within its parent
object.
justification
left align, center align, right align, left justified, right justified, center justified,
fully justified
read/write
Alignment of the paragraph containing
the text.
keep all lines
together
boolean
read/write
If true, keep all lines in the paragraph
together (i.e., don’t split them between text
columns or text frames).
keep first lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will appear at the bottom of a text frame or text
column.
keep last lines
small integer
read/write
Sets the minimum number of lines of the
paragraph containing the text that will
appear at the top of a text frame or text
column.
keep lines together
boolean
read/write
If true, honor the settings of the KeepFirstlines and KeepLastlines properties.
keep with next
small integer
read/write
Prevents InDesign from breaking text for
1-3 lines following the paragraph containing the text. In some cases, this will force
InDesign to move the paragraph to the
next text frame or text column.
kerning method
string
read/write
The kerning method applied to the text
(optical, metrics or none).
kerning value
fixed
read/write
The amount of kerning applied to the
characters in the text object.
leading
fixed, measurement string, or ‘auto’
read/write
The leading value (in points) applied to
the text object, or ‘Auto’ for auto leading.
The largest leading value in a line sets the
leading for the line.
left indent
fixed or measurement string
read/write
The left indent applied to the paragraph
containing the text.
length
integer
read only
The number of characters in the text
object.
ligatures
boolean
read/write
If true, replace ligature character pairs
(“fi,” “fl”) appearing in the text object with
ligature characters.
maximum glyph
scaling
fixed
read/write
The maximum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Glyph Scaling field in the
Justification dialog box.
maximum letter
spacing
fixed
read/write
The maximum letter spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum Letter Spacing field in the
Justification dialog box.
maximum word
spacing
fixed
read/write
The maximum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Maximum word Spacing field in the
Justification dialog box.
minimum glyph
scaling
fixed
read/write
The minumum glyph scaling percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum Glyph Scaling field in the
Justification dialog box.
InDesign CS Scripting Guide
AppleScript Reference
473
Property:
Type:
Access:
Description:
minimum letter
spacing
fixed
read/write
The minumum letter spacing percentage
applied to the paragraph containing the
text. This property corresponds to the
Minimum Letter Spacing field in the Justification dialog box.
minimum word
spacing
fixed
read/write
The minumum word spacing percentage applied to the paragraph containing
the text. This property corresponds to
the Minimum word Spacing field in the
Justification dialog box.
no break
boolean
read/write
If true, the no break attribute is applied to
the text.
object reference
word
read only
An object reference to the object.
open type features
list of integers
read/write
open type features
OTF contextual
alternate
boolean
read/write
If true, InDesign will replace characters
in the text with contextual alternate
characters. Only applies to text set using
an OpenType font.
OTF discretionary
ligature
boolean
read/write
If true, InDesign will replace ligature
characters (“ffi,” “ffl”) in the text with
discretionary ligature characters. Only applies to text set using an OpenType font.
OTF figure style
tabular lining, proportional oldstyle, proportional lining, tabular oldstyle,
default
read/write
Which figure style to use in OpenType
fonts
OTF fraction
boolean
read/write
If true, InDesign will replace typed
fractions (“1/2”) in the text with fraction
alternate characters. Only applies to text
set using an OpenType font.
OTF ordinal
boolean
read/write
If true, InDesign will replace number
characters in the text with ordinal alternate characters. Only applies to text set
using an OpenType font.
OTF swash
boolean
read/write
If true, InDesign will replace characters in
the text with swash alternate characters.
Only applies to text set using an OpenType font.
OTF titling
boolean
read/write
If true, InDesign will replace characters in
the text with titling alternate characters.
Only applies to text set using an OpenType font.
overprint fill
boolean
read/write
If true, the fill of the characters in the text
object will overprint.
overprint stroke
boolean
read/write
If true, the stroke of the characters in the
text object will overprint.
parent
object
read only
The parent of the object.
parent story
story
read only
The story containing the text object.
parent text frame
text frame
read only
The text frame containing the text object.
point size
fixed
read/write
The size of the text in points.
position
normal, superscript, subscript, OT superscript, OT subscript, OT numerator,
OT denominator
read/write
The position attribute applied to the text.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
right indent
fixed or measurement string
read/write
The right indent applied to the paragraph
containing the text.
rule above
boolean
read/write
If true, the paragraph containing the text
object has a rule above.
rule above color
swatch or string
read/write
The color of the paragraph rule above.
rule above gap
color
swatch or string
read/write
The gap color of the paragraph rule above.
474
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
rule above gap
overprint
boolean
read/write
If true, overprint the rule above gap color.
rule above gap tint
fixed
read/write
The tint of the rule above gap color (-1
indicates no tint or 100%).
rule above left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
above.
rule above line
weight
fixed
read/write
The stroke weight of the paragraph rule
above.
rule above offset
fixed or measurement string
read/write
The offset of the paragraph rule above
from the baseline of the first line of the
paragraph containing the text. Positive
values move the rule above the baseline;
negative values move it below the baseline.
rule above overprint
boolean
read/write
If true, the paragraph rule above will
overprint.
rule above right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
above.
rule above tint
fixed
read/write
The tint of stroke applied to the paragraph
rule above (-1 indicates no tint or 100%).
rule above type
stroke style
read/write
The stroke type of the rule above. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule above width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule above. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
rule below
boolean
read/write
If true, the paragraph containing the text
object will have a rule below.
rule below color
swatch or string
read/write
The color of the paragraph rule below.
rule below gap
color
swatch or string
read/write
The color of the paragraph rule below gap
rule below gap
overPrint
boolean
read/write
If true, the gap applied to the paragraph
rule below will overprint.
rule below gap tint
fixed
read/write
The tint of the gap applied to the paragraph rule below (-1 indicates no tint or
100%).
rule below left
indent
fixed or measurement string
read/write
The left indent of the paragraph rule
below.
rule below line
weight
fixed
read/write
The stroke weight of the paragraph rule
below.
rule below offset
fixed or measurement string
read/write
The offset of the paragraph rule below.
rule below overPrint
boolean
read/write
If true, the paragraph rule below will
overprint.
rule below right
indent
fixed or measurement string
read/write
The right indent of the paragraph rule
below.
rule below tint
fixed
read/write
The tint applied to the stroke color of the
paragraph rule below (-1 indicates no tint
or 100%).
rule below type
stroke style
read/write
The stroke type of the rule below. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
rule below width
column width, text width
read/write
The basis for calculating the width of
the paragraph rule below. You can base
the width of the rule on the width of the
column or on the composed width of the
text in the paragraph.
InDesign CS Scripting Guide
AppleScript Reference
475
Property:
Type:
Access:
Description:
single word justification
left align, center align, right align, fully justified
read/write
Justification for lines containing a single
word.
skew
fixed
read/write
The skewing angle (in degrees) applied to
the text object.
space after
fixed or measurement string
read/write
The space after applied to the paragraph
containing the text.
space before
fixed or measurement string
read/write
The space before applied to the paragraph
containing the text.
start paragraph
anywhere, next column, next frame, next page, next odd page, next even page
read/write
This property controls the location at
which InDesign will start the paragraph.
strike through
color
swatch or string
read/write
The stroke color of the strike through.
strike through gap
color
swatch or string
read/write
The gap color of the strike through
strike through gap
overprint
boolean
read/write
If true, overprint the gap of the strike
through applied to the text (if any).
strike through gap
tint
fixed
read/write
The gap tint of the strike through
strike through
offset
fixed or measurement string
read/write
The offset of the strike through, relative to
the baseline of the text (in points). Positive
values move the strike through up; negative values move it down.
strike through
overprint
boolean
read/write
If true, overprint the strike through applied to the text (if any).
strike through tint
fixed
read/write
The tint of the strike through
strike through type
stroke style
read/write
The stroke type of the strikethrough. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
strike through
weight
fixed
read/write
The stroke weight of the strike through,
in points.
strike thru
boolean
read/write
If true, InDesign applies the strikethrough
type effect to the text object.
stroke color
swatch
read/write
The color applied to the stroke of the text.
stroke tint
fixed
read/write
The tint applied to the stroke color of the
characters in the text object (-1 indicates
no tint or 100%).
stroke weight
fixed
read/write
The width (in points) of the stroke applied
to the text.
tab list
list of objects
read/write
A list of all of the properties of all of the
tab stops on this word. Can return: list of
record.
tracking
fixed
read/write
The tracking or range kerning applied to
the text object (in thousanths of an em).
underline
boolean
read/write
If true, InDesign applies the underline
type style to the text object.
underline color
swatch or string
read/write
The color applied to the stroke of the
underline.
underline gap color
swatch or string
read/write
The gap color applied to the stroke of the
underline.
underline gap
overprint
boolean
read/write
If true, the gap of the underline will
overprint.
underline gap tint
fixed
read/write
The gap tint of the stroke applied to the
underline.
476
AppleScript Reference
InDesign CS Scripting Guide
Property:
Type:
Access:
Description:
underline offset
fixed or measurement string
read/write
The offset of the underline from the baseline of the text, in points. Positive values
move the underline below the baseline of
the text; negative values move it above the
baseline.
underline overprint
boolean
read/write
If true, the underline will overprint.
underline tint
fixed
read/write
The tint of the color applied to the stroke
of the underline.
underline type
stroke style
read/write
The stroke type of the underline. This
property can contain either one of the
stroke type constants or the name of a
stroke style defined in the document.
underline weight
fixed
read/write
The stroke weight of the underline.
vertical scale
fixed
read/write
The vertical scaling percentage applied to
the text object.
Methods
Method:
apply style
changecase
convert to table
create outlines
delete
Parameters:
Name:
Type:
Description:
using
character style, paragraph style, or string
The paragraph style
or character style to
apply.
[clearing overrides]
boolean
If true, clear any local formatting in the
text object before
applying the style.
Name:
Type:
Description:
using
uppercase, lowercase, titlecase, sentencecase
Case option to use.
Name:
Type:
Description:
[column separator]
string
The character to
interpret as the
column separator.
[row separator]
string
The character to
interpret as the row
separator.
[number of
columns]
integer
The number of
columns in the table
(only used if the
column and row
separators are the
same).
Name:
Type:
Description:
[delete original]
boolean
If true, delete the
original text.
None
Return:
Description:
nothing
Apply a paragraph or character
style to the text object.
nothing
Change the case of text.
table
Convert the text to a table. The
parameters for this command
correspond to the options
in the Convert text to table
dialog box (select some text
and choose table>Convert text
to table to display this dialog
box).
objects
Create outlines from the text.
If you set the delete original
parameter to true, InDesign
will delete the original text and
insert the character outlines as
an inline graphic; if the delete
original parameter is false, InDesign creates an independent
graphic and places it above the
text.
nothing
Deletes the object.
InDesign CS Scripting Guide
AppleScript Reference
477
Method:
export
markup
move
place
478
Parameters:
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The full path to the
exported file.
[showing options]
boolean
If true, display the
Export dialog box.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
using
XML element
The XML element
to associate with the
text.
Name:
Type:
Description:
to
before, after, at end, at beginning
Where to move the
text, relative to the
reference object
(before/after).
[reference]
object
A text object that
specifies the destination of the text
you’re moving.
Name:
Type:
Description:
file name
string
The file to place.
[place point]
list or numbers or measurement strings
{x, y}
The location (in
page coordinates) at
which to place the
incoming file.
[destination layer]
layer
The layer on which
to place the incoming file.
[showing options]
boolean
If true, display the
import options
dialog box for the
file type being
placed.
[autoflowing]
boolean
If true, autoflow the
incoming text.
[retaining formatting]
boolean
If true, retain the
formatting of the incoming text. If false,
place the text using
the document’s default text formatting
attributes.
[converting
quotes]
boolean
If true, convert typewriter
(“straight”) quotation marks to typographic (“curly”)
quotation marks.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Export the object to a file.
nothing
Associate the text with an XML
element while preserving the
existing text content.
nothing
Moves the text.
object
Place a file.
Method:
search
select
Parameters:
Name:
Type:
Description:
[for]
string
The text to search
for. Corresponds to
the Find What field
in the Find/Change
dialog box.
[whole word]
boolean
If true, limit the
search to whole
words that match
the search string.
[case sensitive]
boolean
If true, limit the
search to text that
matches the case
used in the search
string.
[replacing with]
string
The replacement
text. This parameter
corresponds to the
Change To field of
the Find/Change
dialog box.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Return:
Description:
list of objects
Searches for text and returns a
list of text objects matching the
search string and/or formatting
specified by the find preferences. Search can also replace
the text and/or formatting.
This command corresponds
to InDesign’s Find/Change
feature.
You can use any of InDesign’s
metacharacters as part of the
string (e.g., “^p” for a return
character) in the “for” parameter.
You can use some of InDesign’s
metacharacters (e.g., “
” for a tab character) in the
“replacing with” parameter,
but not all of them (wildcard
characters, such as “^?” for any
character, are not supported by
this parameter).
nothing
InDesign CS Scripting Guide
Selects text.
AppleScript Reference
479
word RTF import preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
convert page
breaks
none, page break, column break
read/write
The method used to convert page breaks
in the imported file.
Convert Tables To
unformatted table, unformatted tabbed text
read/write
The method used for importing tables in
the incoming file.
import index
boolean
read/write
If true, import index text.
import notes
boolean
read/write
If true, import footnotes and endnotes.
import TOC
boolean
read/write
If true, import table of contents text.
object reference
word RTF import preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Remove Formatting
boolean
read/write
If true, remove text and table formatting.
480
AppleScript Reference
InDesign CS Scripting Guide
XML attribute
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
index
integer
read only
index of the XML attribute within its parent XML element
name
string
read/write
The name of the XML attribute.
object reference
XML attribute
read only
An object reference to the object.
parent
XML element
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
value
string
read/write
The value of the XML attribute.
Methods
Method:
Parameters:
Return:
delete
None
nothing
Deletes the object.
xml attribute
Create a new attribute.
nothing
Select this xml attribute.
InDesign CS Scripting Guide
AppleScript Reference
make
select
Name:
Type:
Description:
name
string
The attribute name.
value
string
The attribute value.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
Description:
481
XML comment
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the XML comment within its parent document, XML element or XML item
object reference
XML comment
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
story offset
integer
read only
The location of the object from the beginning of the story
value
string
read/write
The value of the XML comment.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
xml comment
Create a new XML comment.
xml element
Move element before/after
another element or text object,
or to beginning/end.
nothing
Select this xml comment.
make
move
select
482
Name:
Type:
Description:
story offset
integer
Offset within the
story as insertion
point or integer.
[value]
string
Value.
Name:
Type:
Description:
to
before, after, at end, at beginning
Location.
[reference]
object
Before/after this
object as xml item
or text.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
AppleScript Reference
InDesign CS Scripting Guide
XML element
Elements
Element:
Refer to by:
character
index, name, range, relative, test
DTD
index, name, range, relative, test, id
EPS
index, name, range, relative, test, id
image
index, name, range, relative, test, id
insertion point
index, name, range, relative, test
line
index, name, range, relative, test
page item
index, name, range, relative, test, id
paragraph
index, name, range, relative, test
PDF
index, name, range, relative, test, id
PICT
index, name, range, relative, test, id
story
index, name, range, relative, test, id
text
index, name, range, relative, test
text column
index, name, range, relative, test
text style range
index, name, range, relative, test
WMF
index, name, range, relative, test, id
word
index, name, range, relative, test
XML attribute
index, name, range, relative, test
XML comment
index, name, range, relative, test, id
XML element
index, name, range, relative, test, id
XML instruction
index, name, range, relative, test, id
XML item
index, name, range, relative, test, id
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
contents
string
read/write
The text contents of the XML element.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the XML element within its parent document, XML element or XML item
markup tag
XML tag
read/write
The XML markup tag associated with the
XML element.
object reference
XML element
read only
An object reference to the object.
parent
object
read only
The parent of the object.
parent story
story
read only
The related story
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
story offset
integer
read only
The location of the object from the beginning of the story
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
object
Duplicates the object.
InDesign CS Scripting Guide
AppleScript Reference
483
Method:
export
import xml
make
markup
move
place xml
select
untag
Name:
Type:
Description:
format
string (name of the export format as it
appears in the Export dialog box) or eps
type, InCopy, jpg, pdf type, rtf, svg, svg
compressed, tagged text, text type, xml
The export format.
to
string
The file to export to.
[showing options]
boolean
If true, display the
export options
dialog.
[using]
export preset or export preset name as
string
The export preset
to use.
Name:
Type:
Description:
from
string
What to import
from.
Name:
Type:
Description:
markup tag
XML tag
The XML tag used
to identify this
element as string or
xml tag.
[xml content]
xml content
Content to be
marked up as text,
story or pageItem.
Name:
Type:
Description:
using
XML tag
The object to mark
up as text, story or
pageItem.
Name:
Type:
Description:
to
after, at beginning, at end, before
Location.
[reference]
object
Before/after this
object as xml item
or text.
Name:
Type:
Description:
using
XML element
The object to place
into as story or
pageItem.
Name:
Type:
Description:
[existing selection]
replace, add to, remove from
How to handle the
existing selection.
None
validate
484
Parameters:
Name:
Type:
Description:
[maximum errors]
integer
The maximum
number of validation errors to generate.
AppleScript Reference
InDesign CS Scripting Guide
Return:
Description:
nothing
Export the object to file.
nothing
Import a XML file into an
InDesign document.
xml element
Create a new XML element.
nothing
Markup layout content with
XML preserving the existing
content.
xml element
Move element before/after
another element or text object,
or to beginning/end.
nothing
Places XML content in the
specified object replacing the
existing content.
nothing
Select this xml element.
nothing
Untag an element
objects
Validate XML structure against
a dtdd.
XML export map
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
index
integer
read only
index of the XML export map within its
parent application or document
mapped style
object
read only
The style mapped to the XML tag.
markup tag
XML tag
read/write
The markup tag mapped to the style.
object reference
XML export map
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
xml export
map
Create a new mapping.
make
Name:
Type:
Description:
mapped style
character style, paragraph style, or string
The mapped style
as paragraphStyle,
characterStyle or
string.
markup tag
XML tag
The tag to map as
xml tag or string.
InDesign CS Scripting Guide
AppleScript Reference
485
XML export preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
copy formatted
images
boolean
read/write
If true, copy formatted images to the
images subfolder.
copy optimized
images
boolean
read/write
If true, copy optimized images to the
images subfolder.
copy original
images
boolean
read/write
If true, copy the original images to the
images subfolder.
exclude dtd
boolean
read/write
If true, exclude the dtdd from the exported XML.
export from
selected
boolean
read/write
If true, export the selected element (otherwise export the entire document).
file encoding
UTF8, UTF16, shift JIS
read/write
The file encoding to use when exporting.
GIF options interlaced
boolean
read/write
If true, generate interlaced GIFs.
GIF options palette
adaptive palette, macintosh palette, web palette, windows palette
read/write
The color palette to use for GIF conversion.
image conversion
automatic, JPEG, GIF
read/write
Type of image to generate for optimized
and formatted images.
JPEG options
format
baseline encoding, progressive encoding
read/write
The format of converted JPEG image.
JPEG options
quality
low, medium, high, maximum
read/write
The quality setting for converted JPEG
images.
object reference
XML export preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
preferred browser
file reference or file name as string
read/write
The name of the preferred browser for
viewing XML.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
ruby
boolean
read/write
If true, include Ruby characters in the
exported XML.
view after export
boolean
read/write
If true, view exported XML in the default
browser after exporting.
486
AppleScript Reference
InDesign CS Scripting Guide
XML import map
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
index
integer
read only
index of the XML import map within its
parent application or document
mapped style
object
read/write
The style mapped to the XML tag.
markup tag
XML tag
read only
The XML markup tag to map to the style.
object reference
XML import map
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
xml import
map
Create a new mapping.
make
Name:
Type:
Description:
markup tag
XML tag
The tag to map as
xml tag or string.
mapped style
character style, paragraph style, or string
the mapped style
as paragraphStyle,
characterStyle or
string.
InDesign CS Scripting Guide
AppleScript Reference
487
XML import preference
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
import style
append import, merge import
read/write
The method used to import XML content
(append or merge).
import to selected
boolean
read/write
If true, import into the selected element
(otherwise import at the root element).
object reference
XML import preference
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
488
AppleScript Reference
InDesign CS Scripting Guide
XML instruction
Properties
Property:
Type:
Access:
Description:
class
type
read only
The class of the object.
data
string
read/write
The data of the PI.
id
integer
read only
A unique number identifying the object.
index
integer
read only
index of the XML instruction within its
parent document, XML element or XML
item
object reference
XML instruction
read only
An object reference to the object.
parent
object
read only
The parent of the object.
properties
AppleScript record
read/write
An AppleScript record containing all of
the properties of the object.
story offset
integer
read only
The location of the object from the beginning of the story
target
string
read/write
The target of the PI.
Methods
Method:
Parameters:
Return:
Description:
delete
None
nothing
Deletes the object.
duplicate
None
XML instruction
Duplicates the object.
xml instruction
Create a new XML processing
instruction.
xml element
Move element before/after
another element or text object,
or to beginning/end.
nothing
Select this xml instruction.
make
move
select
Name:
Type:
Description:
story offset
integer
Offset within the
story as insertion
point or integer.
[target]
string
Target.
[data]
string
Data.
Name:
Type:
Description:
to
before, after, at end, at beginning
Location.
[reference]
object
Before/after this
object as xml item
o">
/
다운로드
친절한 알림입니다. 여기에서 문서를 볼 수 있습니다. 그러나 가장 중요한 것은 AI가 이미 읽었다는 것입니다. 복잡한 내용을 간단하게 설명하고, 모든 언어로 질문에 답변하고, 가장 길거나 복잡한 문서도 빠르게 탐색할 수 있도록 도와줍니다.
광고