Adobe InDesign CS5 Scripting Guide: Javascript

the best approach to scripting XML in InDesign. ….Work with XML, from creating XML elements and importing XML to adding XML elements to a layout. Apply XML rules, a new scripting feature that makes working with XML in InDesign faster and easier.

More PDF Content

Adobe InDesign CS5 Scripting Guide: Javascript
Introduction … 9
How to Use the Scripts in this Document … 9
About the Structure of the Scripts … 9
For More Information … 10
Other JavaScript development options … 10
Scripting Features … 11
Script Preferences … 11
Getting the Current Script … 12
Script Versioning …
Targeting …
Compilation …
Interpretation …
Using the doScript Method … 13
Sending parameters to doScript … 14
Returning values from doScript … 14
Controlling Undo with doScript … 16
Working with Script Labels … 16
Running Scripts at Startup … 18
Session and Main Script Execution … 18
Documents … 19
Basic Document Operations …
Creating a new document …
Opening a document …
Saving a document …
Closing a document …
Basic Page Layout …
Defining page size and document length …
Defining bleed and slug areas …
Setting page margins and columns …
Changing the appearance of the pasteboard …
Guides and grids …
Changing measurement units and ruler …
Defining and applying document presets …
Setting up master spreads …
Adding XMP metadata …
Creating a document template …
Creating watermarks …
Adjusting Page Sizes and Layout … 38
Selecting pages … 38
Resizing and reframing pages … 39
Transforming pages … 39
Master page overlay … 40
Printing a Document …
Printing using page ranges …
Setting print preferences …
Printing with printer presets …
Exporting a Document as PDF …
Exporting to PDF …
Setting PDF export options …
Exporting a range of pages to PDF …
Exporting individual pages to PDF …
Exporting PDF with Interactive Features …
Exporting Pages as EPS …
Exporting all pages to EPS …
Exporting a range of pages to EPS …
Exporting as EPS with file naming …
Working with Layers … 50
Understanding the Layer Object Model … 50
Scripting Layers …
Creating layers …
Referring to layers …
Deleting layers …
Moving layers …
Duplicating layers …
Merging layers …
Assigning page items to layers …
Setting layer properties …
Working with Page Items … 56
Creating Page Items … 56
Page-item geometry … 57
Grouping Page Items … 59
Duplicating and Moving Page Items …
Creating compound paths …
Using Pathfinder operations …
Converting page-item shapes …
Arranging page items …
Transforming Page Items …
Using the transform method …
Working with transformation matrices …
Coordinate spaces …
Transformation origin …
Resolving locations …
Transforming points …
Transforming again …
Resize and Reframe … 69
Text and Type … 71
Entering and Importing Text …
Creating a text frame …
Adding text …
Stories and text frames …
Replacing text …
Inserting special characters …
Placing Text and Setting Text-Import Preferences … 74
Exporting Text and Setting Text-Export Preferences … 77
Understanding Text Objects …
Working with text selections …
Moving and copying text …
Text objects and iteration …
Working with Text Frames …
Linking text frames …
Unlinking text frames …
Removing a frame from a story …
Splitting all frames in a story …
Creating an anchored frame …
Formatting Text …
Setting text defaults …
Working with fonts …
Applying a font …
Changing text properties …
Changing text color …
Creating and applying styles …
Deleting a style …
Importing paragraph and character styles …
Finding and Changing Text … 100
About find/change preferences … 100
Finding and changing text … 101
Finding and changing text formatting … 101
Using grep … 102
Using glyph search … 104
Working with Tables … 104
Path Text … 108
Autocorrect … 108
Footnotes … 108
Span Columns … 109
Setting Text Preferences … 109
User Interfaces … 111
Dialog Overview … 111
Your First InDesign Dialog … 112
Adding a User Interface to “Hello World” … 113
Creating a More Complex User Interface … 113
Working with ScriptUI … 116
Creating a progress bar with ScriptUI … 116
Events … 118
Understanding the Event Scripting Model … 118
About event properties and event propagation … 118
Working with Event Listeners … 119
Sample afterNew Event Listener … 121
Sample beforePrint Event Listener … 122
Sample Selection Event Listeners … 123
Sample onIdle Event Listener … 124
Menus … 128
Understanding the Menu Model … 128
Localization and menu names … 130
Running a Menu Action from a Script … 131
Adding Menus and Menu Items … 131
Menus and Events … 132
Working with scriptMenuActions … 133
A More Complex Menu-scripting Example … 134
Working with Preflight … 140
Exploring Preflight Profiles … 140
Listing preflight profiles … 140
Listing preflight rules … 141
Listing preflight data objects … 141
Importing a Preflight Profile … 142
Creating a Preflight Profile … 143
Adding Rules … 144
Processing a Profile … 145
Custom Rules … 146
Available Rules … 146
ADBE_BlankPages … 148
ADBE_BleedSlug … 148
ADBE_BleedTrimHazard … 149
ADBE_Colorspace … 149
ADBE_CrossReferences … 149
ADBE_FontUsage … 150
ADBE_ImageColorManagement … 150
ADBE_ImageResolution … 150
ADBE_PageCount … 151
ADBE_PageSizeOrientation … 151
ADBE_ScaledGraphics … 151
ADBE_ScaledType … 151
ADBE_SmallText … 152
ADBE_SpotColorSetup … 152
ADBE_StrokeRequirements … 152
ADBE_TextOverrides … 152
ADBE_TransparencyBlending … 152
Creating Dynamic Documents … 153
Importing Movies and Sounds … 153
Creating Buttons … 154
Creating Multistate Objects … 156
Working with Animation … 158
Basic animation … 158
TimingSettings … 158
Animating transformations … 161
Motion presets … 162
Design options … 162
Key frames … 163
Adding Page Transitions … 164
XML … 165
Overview … 165
The Best Approach to Scripting XML in InDesign … 165
Scripting XML Elements … 166
Setting XML preferences … 166
Setting XML import preferences … 166
Importing XML … 167
Creating an XML tag … 167
Loading XML tags … 168
Saving XML tags … 168
Creating an XML element … 168
Moving an XML element … 168
Deleting an XML element … 168
Duplicating an XML element … 168
Removing items from the XML structure … 169
Creating an XML comment … 169
Creating an XML processing instruction … 169
Working with XML attributes … 169
Working with XML stories … 170
Exporting XML … 170
Adding XML Elements to a Layout … 171
Associating XML elements with page items and text … 171
Marking up existing layouts … 172
Applying styles to XML elements … 174
Working with XML tables … 175
XML Rules … 178
Overview … 178
Why use XML rules? … 179
XML-rules programming model … 179
XML Rules Examples … 185
Setting up a sample document … 185
Getting started with XML rules … 186
Changing the XML structure using XML rules … 190
Duplicating XML elements with XML rules … 191
XML rules and XML attributes … 192
Applying multiple matching rules … 194
Finding XML elements … 195
Extracting XML elements with XML rules … 198
Applying formatting with XML rules … 199
Creating page items with XML rules … 202
Creating Tables using XML Rules … 203
Scripting the XML-rules Processor Object … 204
Track Changes … 206
Tracking Changes … 206
Navigating tracked changes … 206
Accepting and reject tracked changes … 207
Information about tracked changes … 207
Preferences for Tracking Changes … 208

Download Adobe InDesign CS5 Scripting Guide: Javascript pdf from www.adobe.com, 209 pages, 1447.68KB.
Related Books

Leave a Reply