Transcription of Adobe InDesign CS6 JavaScript Scripting Guide
1 Adobe InDesign CS6 Adobe InDesign CS6 Scripting Guide : JavaScript 2012 Adobe Systems Incorporated. All rights InDesign CS6 Scripting Guide : JavaScriptIf this Guide is distributed with software that includes an end user agreement, this Guide , as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. Except as permitted by any such license, no part of this Guide may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written permission of Adobe Systems Incorporated.
2 Please note that the content in this Guide is protected under copyright law even if it is not distributed with software that includes an end user license content of this Guide 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 the informational content contained in this remember that existing artwork or images that you may want to include in your project may be protected under copyright law.
3 The unauthorized incorporation of such material into your new work could be a violation of the rights of the copyright owner. Please be sure to obtain any permission required from the copyright references to company names in sample templates are for demonstration purposes only and are not intended to refer to any actual , the Adobe logo, Creative Suite, and InDesign are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
4 Mac OS is a trademark of Apple Computer, Incorporated, registered in the United States and other countries. All other trademarks are the property of their respective Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA. Notice to Government End Users. The Software and Documentation are Commercial Items, as that term is defined at 48 , consisting of Commercial Computer Software and Commercial Computer Software Documentation, as such terms are used in 48 or 48 , as applicable. Consistent with 48 or 48 through , as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to Government end users (a) only as Commercial Items and (b) with only those rights as are granted to all other end users pursuant to the terms and conditions herein.
5 Unpublished-rights reserved under the copyright laws of the United States. Adobe Systems Incorporated, 345 Park Avenue, San Jose, CA 95110-2704, USA. For Government End Users, Adobe agrees to comply with all applicable equal opportunity laws including, if appropriate, the provisions of Executive Order 11246, as amended, Section 402 of the Vietnam Era Veterans Readjustment Assistance Act of 1974 (38 USC 4212), and Section 503 of the Rehabilitation Act of 1973, as amended, and the regulations at 41 CFR Parts 60-1 through 60-60, 60-250, and 60-741. The affirmative action clause and regulations contained in the preceding sentence shall be incorporated by Update Status(for entire document; see each chapter for chapter-specific update status)CS6 UpdatedThroughout document, changed CS5 to CS6 and version to 3 Contents1 Introduction.
6 10 How to Use the Scripts in this Document .. 10 About the Structure of the Scripts .. 11 Automatic jsxbin Conversion .. 11 Other JavaScript development options .. 11 For More Information .. 122 Scripting Features .. 13 Script Preferences .. 13 Getting the Current Script .. 14 Script Versioning .. 14 Targeting .. 15 Compilation .. 15 Interpretation .. 15 Using the doScript Method .. 16 Sending parameters to doScript .. 16 Returning values from doScript .. 16 Controlling Undo with doScript .. 18 Working with Script Labels .. 18 Running Scripts at Startup.
7 20 Session and Main Script Execution .. 203 Documents .. 21 Basic Document Operations .. 22 Creating a new document .. 22 Opening a document .. 22 Saving a document .. 23 Closing a document .. 24 Basic Page Layout .. 24 Defining page size and document length .. 24 Defining bleed and slug areas .. 25 Setting page margins and columns .. 26 Changing the appearance of the pasteboard .. 28 Guides and grids .. 28 Changing measurement units and ruler .. 30 Defining and applying document presets .. 31 Setting up master spreads .. 33 Adding XMP metadata.
8 35 Creating a document template .. 35 Creating watermarks .. 39 4 Adjusting Page Sizes and Layout .. 41 Selecting pages .. 41 Resizing and reframing pages .. 41 Transforming pages .. 42 Master page overlay .. 43 Making an Adaptive Layout .. 44 Making a flexible layout .. 44 Adding guides for a Guide -based layout .. 45 Setting constraints for an object-based layout .. 46 Creating alternative layouts .. 46 Collecting and Dropping Content .. 47 Printing a Document .. 47 Printing using page ranges .. 48 Setting print preferences .. 48 Printing with printer presets.
9 51 Exporting a Document as PDF .. 51 Exporting to PDF .. 51 Setting PDF export options .. 52 Exporting to grayscale PDF .. 53 Exporting a range of pages to PDF .. 54 Exporting individual pages to PDF .. 54 Exporting PDF with interactive features .. 55 Exporting as a PDF form .. 55 Exporting Pages as EPS .. 58 Exporting all pages to EPS .. 58 Exporting a range of pages to EPS .. 58 Exporting as EPS with file naming .. 58 Exporting to EPub .. 59 Exporting the current document .. 60 Setting EPub export options .. 604 Working with Layers .. 62 Understanding the Layer Object Model.
10 62 Scripting Layers .. 63 Creating layers .. 63 Referring to layers .. 63 Deleting layers .. 65 Moving layers .. 65 Duplicating layers .. 65 Merging layers .. 65 Assigning page items to layers .. 66 Setting layer properties .. 665 Text and Type .. 68 Entering and Importing Text .. 68 Creating a text frame .. 68 Adding text .. 69 Stories and text frames .. 69 Replacing text .. 70 5 Inserting special characters .. 70 Placing Text and Setting Text-Import Preferences .. 71 Exporting Text and Setting Text-Export Preferences .. 74 Understanding Text Objects.