Adobe InDesign CS3 Scripting Tutorial

Adobe InDesign CS3 Scripting Tutorial. Getting Started 5 … tutorial script): tell application “Adobe InDesign CS3″ set myDocument to make document …

More PDF Content

Adobe InDesign CS3 Scripting Tutorial ADOBE INDESIGN CS3 SCRIPTING TUTORIAL Adobe InDesign CS3 Scripting Tutorial 2007 Adobe Systems Incorporated. All rights reserved. Adobe, the Adobe logo, Creative Suite, InDesign, Illustrator, and Photoshop 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. Apple and Mac OS are trademarks of Apple Computer, Inc., registered in the United States and other countries. All other trademarks are the property of their respective owners. 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. Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA. 3 Adobe InDesign CS3 Scripting Tutorial Introduction Scripting is the most powerful feature in Adobe InDesign CS3. No other feature can save you as much time, trouble, and money as scripting. This document is for every InDesign user. If you never created a script before, we show you how to get started. If you wrote scripts for other applications, we show you how to apply your knowledge to InDesign scripting. The document also covers how to install and run an InDesign script and describes what InDesign scripting can and cannot do. We discuss the software you need to start writing your own scripts. After you learn the basics of InDesign scripting in this tutorial, you can move on to Adobe InDesign CS3 Scripting Guide, which explores scripting in more depth. Adobe InDesign CS3 Scripting Guide contains hundreds of tutorial scripts covering topics like text formatting, finding and changing text, associating scripts with menu items, drawing objects on a page, and exporting documents. Getting Started Almost anything you can do with the user interface; you can do with a script. You can draw frames, enter and format text, place graphics, and print or export the pages of the document. Any action that can change a document or its contents can be scripted. There even are a few things you can do in scripting that you cannot do using the user interface. Scripts can create menus, add menu items, create and display dialog boxes and panels, and respond to user-interface selections. Scripts can read and write text files, parse XML data, and communicate with other applications. Scripts can do everything from very small tasks (like setting a tab stop at the location of the text cursor) to providing complete features (InDesign’s XHTML export feature is provided by a script). You can start with simple scripts that do only one thing and move on to scripts that automate your entire publishing workflow. Most of the things scripting cannot do like setting up a workspace or defining a set of keyboard shortcuts are things that have to do with the user interface. In addition, scripts cannot add new types of objects to an InDesign document or add new, fundamental capabilities to the program, like a new text-composition engine. For that type of extensibility, you must use the InDesign Software Development Kit (SDK), which shows you to write compiled plug-ins using C++. We tend to think of scripting in terms of long, repetitive tasks, like laying out a phone book. It also is good for things like the following: Automating the myriad, small, annoying tasks you face every day. Customizing InDesign to match your work habits and layouts. Achieving creative effects that would be difficult or impossible to attain by other means. Adobe InDesign CS3 Scripting Tutorial Getting Started 4 Installing Scripts Installing an InDesign script is easy: put the script file in the Scripts Panel folder inside the Scripts folder in your InDesign application folder. (Create the Scripts folder if it does not already exist.) Alternately, put the script inside the Scripts Panel folder in your user-preferences folder. Your user-preferences folder is at Mac OS: ~/Library/Preferences/Adobe InDesign/Version 5.0/Scripts Windows XP: ~\Documents and Settings\user_name\Application Data\Adobe \InDesign\Version 5.0\Scripts where ~ is your system volume and user_name is your user name. Once the script is in the folder, it appears on the Scripts panel inside InDesign. To display the panel, choose Window > Automation > Scripts. You also can put aliases/shortcuts to scripts (or to folders containing scripts) in the Scripts Panel folder, and they will appear in the Scripts panel. To run a specific script when InDesign starts, put the script inside a folder named Startup Scripts inside the Scripts folder (create this folder if it does not already exist). Running a Script To run a script, display the Scripts panel (choose Window > Automation > Scripts), then double-click the script name in the Scripts panel. Many scripts display user-interface items (like dialog boxes or panels) and display alerts if necessary. Using the Scripts Panel The InDesign Scripts panel is the easiest and best way to run most InDesign scripts. If the panel is not already visible, you can display it by choosing Window > Automation > Scripts. Scripts run from the Scripts panel run faster than scripts run from the Finder (Mac OS ) or Explorer (Windows ). To view the script actions as they execute, choose Enable Redraw from the Scripts panel menu. The Scripts panel can run compiled or uncompiled AppleScripts (files with the file extension .spt , .as , or .applescript ), JavaScripts (files with the file extension .js or .jsx ), VBScripts (files with the extension .vbs ), or executable programs from the Scripts panel. To edit a script shown in the Scripts panel, hold down Option (Mac OS) or Alt (Windows) key and double-click the script’s name. This opens the script in the editor you defined for the script file type. To open the folder containing a script shown in the Scripts panel, hold down the Command (Mac OS) or Ctrl-Shift (Windows) keys and double-click the script’s name. Alternately, choose Reveal in Finder (Mac OS) or Reveal in Explorer (Windows) from the Scripts panel menu. The folder containing the script opens in the Finder (Mac OS) or Explorer (Windows). Scripts run as a series of actions, which means you can undo the changes the script made to a document by choosing Undo from the Edit menu. This can help you troubleshoot a script, as you can step backward through each change. Adobe InDesign CS3 Scripting Tutorial Getting Started 5 To add a keyboard shortcut for a script, choose Edit > Keyboard Shortcuts, select an editable shortcut set from the Set menu, then choose Product Area > Script

Download Adobe InDesign CS3 Scripting Tutorial pdf from wwwimages.adobe.com, 43 pages, 2939.32KB.
Related Books

Leave a Reply