Scripting Read Me for Adobe InDesign CS3

Similar documents
ADOBE INDESIGN CS3 SCRIPTING: WORKING WITH TRANSFORMATIONS IN JAVASCRIPT

ADOBE INDESIGN CS3 SCRIPTING TUTORIAL

Creating Hyperlinks & Buttons InDesign CS6

USING STUFFIT DELUXE THE STUFFIT START PAGE CREATING ARCHIVES (COMPRESSED FILES)

Examining the InDesign Server Solution

Printer Sharing of the PT-9500pc in a Windows Environment

Adobe Training Services Exam Guide. ACE: Illustrator CS6

2. Installation Instructions - Windows (Download)

Android Setup Phase 2

Scala InfoChannel Content Manager 5 Backup and Restore Instructions

Introduction: The Xcode templates are not available in Cordova or above, so we'll use the previous version, for this recipe.

Open a PDF document using Adobe Reader, then click on the Tools menu on the upper left hand corner.

Purchase Agent Installation Guide

Creating Interactive PDF Forms

About WINZIP : Basic User Guide

How to build text and objects in the Titler

The In-Stream LogoKit is an In-Stream linear and non-linear ad format that plays in VPAID-compliant video players. The ad displays icons in the

MY WORLD GIS. Installation Instructions

Microsoft Dynamics NAV Connector. User Guide

ADOBE INDESIGN CS6 INTRODUCTION TO ADOBE INDESIGN CS6 SERVER DEVELOPMENT

How to Mail Merge PDF Documents

Adobe Dreamweaver CC 14 Tutorial

Netop School and L230 or X550 from NComputing as student computers

MANAGING OUTLOOK PERSONAL DATA FILES

Setting up the Oracle Warehouse Builder Project. Topics. Overview. Purpose

Canterbury Maps Quick Start - Drawing and Printing Tools

User Guide for the Genetic Analysis Lab Information Management System (dnalims)

Taking Advantage of Crystal Reports

Creating PDF Forms in Adobe Acrobat

Enterprise Historian 3BUF D1 Version 3.2/1 Hot Fix 1 for Patch 4 Release Notes

1 ImageBrowser Software User Guide

Installation of IR under Windows Server 2008

E-Notebook SQL 12.0 Desktop Database Installation Guide. E-Notebook SQL 12.0 Desktop Database Installation Guide

BRIC VPN Setup Instructions

NETWRIX USER ACTIVITY VIDEO REPORTER

MadCap Software. Import Guide. Flare 11

Software Development Environment. Installation Guide


Getting Started using the SQuirreL SQL Client

Using ADOBE CONTRIBUTE CS5

MULTI-FIND/CHANGE. Automatication VERSION 1.02

Adobe Acrobat Professional DC Tutorial

Sitecore InDesign Connector 1.1

C O N F I G U R I N G Y O U R W E B B R O W S E R TO A L L O W P O P - U P W I N D O W S

WinTask x64 Scheduler for Windows 7 64 bit, Windows 8/ bit and Windows 2008 R2 64 bit. Scheduler Quick Start Guide

Working with AppleScript

Installing (1.8.7) 9/2/ Installing jgrasp

Installation Guidelines (MySQL database & Archivists Toolkit client)

Recipes4Success. Animate a Rocket Ship. Frames 6 - Drawing Tools

Adobe Illustrator CS5 Part 1: Introduction to Illustrator

1. Open Thunderbird. If the Import Wizard window opens, select Don t import anything and click Next and go to step 3.

Primavera P6 Professional Windows 8 Installation Instructions. Primavera P6. Installation Instructions. For Windows 8 Users

Backing Up and Restoring the Database

How to resize, rotate, and crop images

Adobe Acrobat 9 Deployment on Microsoft Systems Management

NetBeans IDE Field Guide

How to Build a Form in InDesign CS5

SLIDE SHOW 18: Report Management System RMS IGSS. Interactive Graphical SCADA System. Slide Show 2: Report Management System RMS 1

ADOBE INTRODUCTION TO SCRIPTING

AddLocalUser AddLocalGroup AddLocalUserToLocalGroup AddDomainUserToLocalGroup AddDomainGroupToLocalGroup

About this Release. Introduction. Prerequisites. Installation. Using the Web SDK Packager

UW WEB CONTENT MANAGEMENT SYSTEM (CASCADE SERVER)

Printing Bar Code and RFID Labels from Oracle

NetWrix SQL Server Change Reporter. Quick Start Guide

CREATE A 3D MOVIE IN DIRECTOR

Diver-Office Backup and Restore the Database

Installing the VPN Client for Microsoft Windows OS

AXIS 70U - Using Scan-to-File

Bitrix Site Manager ASP.NET. Installation Guide

Installing Cobra 4.7

INSTALLATION DIRECTIONS

1.1 Installing Protégé You can follow the steps below to download and install Protégé from the source.

User Manual Web DataLink for Sage Line 50. Version 1.0.1

Installing the Microsoft Network Driver Interface

Application. 1.1 About This Tutorial Tutorial Requirements Provided Files

Smart Connection 9 Element Labels

Using Acrobat Comment and Markup tools

Monitor Print Popup for Mac. Product Manual.

MS Project Tutorial for Senior Design Using Microsoft Project to manage projects

How to install and use the File Sharing Outlook Plugin


Overview of the Adobe Flash Professional CS6 workspace

Set up Adobe Dreamweaver CS5/Mac for the Production Web Server

Load testing with. WAPT Cloud. Quick Start Guide

TIBCO ActiveMatrix BPM - Integration with Content Management Systems

ACTIVE DIRECTORY DEPLOYMENT

Microsoft Access Database

Online Backup Client User Manual

Sweet Home 3D user's guide

Customize tab; click the Accounts category; drag the satellite dish icon to your toolbar.

Setting Up a Dreamweaver Site Definition for OIT s Web Hosting Server

How To Test Your Web Site On Wapt On A Pc Or Mac Or Mac (Or Mac) On A Mac Or Ipad Or Ipa (Or Ipa) On Pc Or Ipam (Or Pc Or Pc) On An Ip

Create, Link, or Edit a GPO with Active Directory Users and Computers

Adobe Acrobat 9 Deployment on Microsoft Windows Group Policy and the Active Directory service

Transcription:

Scripting Read Me for Adobe InDesign CS3 This document contains late-breaking information about scripting in Adobe InDesign CS3, including: Important changes in scripting from InDesign CS2 to InDesign CS3 (see Changes in InDesign Scripting on page 1). Corrections to Adobe InDesign CS3 Scripting Guide (see Scripting Documentation Corrections on page 6). Known issues (see Known Issues Related to InDesign CS3 Scripting on page 6). Changes in InDesign Scripting Some aspects of InDesign scripting have changed since InDesign CS2, including the following: The scripting documentation was reorganized (see Scripting Documentation Reorganization on page 1). The place method now returns an array, rather than a single object (see The Place Method Now Returns an Array, Rather Than a Single Object on page 2). The resize, rotate, and shear methods were replaced by a single method, transform. (see Transforming Objects on page 2). The order of the items in the selection property has changed. Note: ember you can run your InDesign CS2 (version 4.x) and CS (version 3.x) scripts using the script-versioning feature. For more information on script versioning, see Chapter 2, Scripting Features, in Adobe InDesign CS3 Scripting Guide. Scripting Documentation Reorganization The scripting documentation set for InDesign CS3 differs from the documentation set for InDesign CS2. In InDesign CS3, the scripting documentation comprises the following: Adobe InDesign CS3 Scripting Tutorial Shows how to get started with InDesign scripting. Covers AppleScript, JavaScript, and VBScript in one PDF document. The introductory scripts presented in this PDF are available as a single Zip archive or can be copied from the PDF. Adobe InDesign CS3 Scripting Guide (AppleScript, JavaScript, and VBScript versions) Discusses more advanced InDesign scripting topics. All tutorial scripts shown are included in a single Zip archive, so there is no need to copy and paste scripts from the PDF. (Most scripts shown in the text are incomplete fragments demonstrating a specific property, method, or technique.) JavaScript Tools and Features Covers using the ExtendScript Toolkit for JavaScript development, creating user interfaces with ScriptUI, using the File and Folder objects, and other features specific to the ExtendScript language (Adobe s version of JavaScript). There is no Scripting Reference PDF for this release. Instead, use the object-model viewer included with your script-editing application (as described in Adobe InDesign CS3 Scripting Tutorial). InDesign sample scripts are now installed by default. 1

Scripting Read Me for Adobe InDesign CS3 Changes in InDesign Scripting 2 Installing the Scripting Documentation Scripts Perform the following steps to extract the scripts from the Zip archive. Once you extract the files, move the folder for the language you want to work with (AppleScript, JavaScript, or VBScript) to your Scripts Panel folder. (For more on installing scripts, see Adobe InDesign CS3 Scripting Tutorial.) Mac OS 1. Copy the Zip file to your hard drive. 2. Double-click the Zip file. Windows With a standard Windows installation, you can extract the Zip files using the Windows Extraction wizard, as described below. If you installed a third-party Zip application (like WinZip), however, you may have a customized menu instead of the menu items listed below. 1. Copy the Zip file to your hard drive. 2. Right-click the file, then choose the Extract All... menu item. 3. When presented with the Extraction Wizard dialog, click the Next button. 4. Choose a location for your files, or use the default location (the current directory). 5. When the extraction is complete, click the Finish button. The Place Method Now Returns an Array, Rather Than a Single Object In InDesign CS2 scripting, the place method returned a single object. In InDesign CS3 scripting, the same method returns an array, because some forms of the place method can place multiple files (just as you can using the InDesign user interface). Transforming Objects In InDesign CS2 scripting, you used the resize, rotate, and shear methods to transform page items. In InDesign CS3, those methods were replaced with a single method, transform. The transform method uses a transformation matrix object to apply all transformations (move, scale, shear, and rotate) to an object. Multiple transformations may be applied in a single operation. In addition, the repeated transformations available in the InDesign user interface are now supported by scripting: transform again, transform again individually, transform sequence again, and transform sequence again individually. You also can remove all transformations applied to an object, using the clear transformations method. The following examples show how to perform common transformations using the transform method.

Scripting Read Me for Adobe InDesign CS3 Changes in InDesign Scripting 3 AppleScript Transform.applescript An InDesign CS3 AppleScript A brief demonstration of the new transform method. The transform method has the following parameters: Coordinate space (pasteboard coordinates, parent coordinates, or inner coordinates) The coordinate space to use for the transformation. From (as an array of two numbers, an anchor point enumeration, or a bounding box limits enumeration): The center of transformation. With Matrix (Transformation Matrix): Specify the matrix used to transform the object. Replacing Current (Boolean): If true, replace the current transformation values of the object with the values of the transformation matrix. Considering Ruler Units (Boolean) If true, use the current ruler usings and zero point location when transforming the object. If false, use the coordinates relative to the Coordinate Space parameters. tell application Adobe InDesign CS3 set mydocument to make document set myrotatematrix to make transformation matrix with properties {counterclockwise rotation angle:27} set myscalematrix to make transformation matrix with properties {horizontal scale factor:0.5, vertical scale factor:0.5} set myshearmatrix to make transformation matrix with properties {clockwise shear angle:30} tell page 1 of mydocument Create an example page item. set myrectangle to make rectangle with properties {geometric bounds:{ 72pt, 72pt, 144pt, 288pt }} Rotate the page item. transform myrectangle in pasteboard coordinates from center anchor with matrix myrotatematrix Create another example page item. set myrectangle to make rectangle with properties {geometric bounds:{ 72pt, 72pt, 144pt, 288pt }} Scale the page item. transform myrectangle in pasteboard coordinates from center anchor with matrix myscalematrix Create another example page item. set myrectangle to make rectangle with properties {geometric bounds:{ 72pt, 72pt, 144pt, 288pt }} Shear the page item. transform myrectangle in pasteboard coordinates from center anchor with matrix myshearmatrix end tell end tell

Scripting Read Me for Adobe InDesign CS3 Changes in InDesign Scripting 4 JavaScript Transform.jsx An InDesign CS3 JavaScript A brief demonstration of the new transform method. The transform method has the following parameters: Coordinate Space (CoordinateSpaces.pasteboardCoordinates, CoordinateSpaces.parentCoordinates, or CoordinateSpaces.innerCoordinates) The coordinate space to use for the transformation. From (as an array of two numbers, an AnchorPoint enumeration, or a BoundingBoxLimitsEnumeration): The center of transformation. With Matrix (Transformation Matrix): Specify the matrix used to transform the object. Replacing Current (Boolean): If true, replace the current transformation values of the object with the values of the transformation matrix. Considering Ruler Units (Boolean) If true, use the current ruler usings and zero point location when transforming the object. If false, use the coordinates relative to the Coordinate Space parameters. var myrotatematrix = app.transformationmatrices.add({counterclockwiserotationangle:27}); var myscalematrix = app.transformationmatrices.add({horizontalscalefactor:.5, verticalscalefactor:.5}); var myshearmatrix =app.transformationmatrices.add({clockwiseshearangle:30}); var mydocument = app.documents.add(); var myrectangle = mydocument.pages.item(0).rectangles.add({geometricbounds:["72pt", "72pt", "144pt", "288pt"]}); Template for rectangle.transform(): transform(in as CoordinateSpaces, from, withmatrix, [replacingcurrent], [consideringrulerunits as Boolean = False]) myrectangle.transform(coordinatespaces.pasteboardcoordinates, AnchorPoint.centerAnchor, myrotatematrix); Create another rectangle. myrectangle = mydocument.pages.item(0).rectangles.add({geometricbounds:["72pt", "72pt", "144pt", "288pt"]}); Transform the rectangle. myrectangle.transform(coordinatespaces.pasteboardcoordinates, AnchorPoint.centerAnchor, myscalematrix); Create another rectangle. myrectangle = mydocument.pages.item(0).rectangles.add({geometricbounds:["72pt", "72pt", "144pt", "288pt"]}); Transform the rectangle. myrectangle.transform(coordinatespaces.pasteboardcoordinates, AnchorPoint.centerAnchor, myshearmatrix);

Scripting Read Me for Adobe InDesign CS3 Changes in InDesign Scripting 5 VBScript Transform.vbs An InDesign CS3 VBScript A brief demonstration of the new transform method. The transform method has the following parameters: Coordinate Space (idcoordinatespaces.idpasteboardcoordinates, idcoordinatespaces.idparentcoordinates, or idcoordinatespaces.idinnercoordinates) The coordinate space to use for the transformation. From (as an array of two numbers, an idanchorpoint enumeration, or a idboundingboxlimitsenumeration): The center of transformation. With Matrix (Transformation Matrix): Specify the matrix used to transform the object. Replacing Current (Boolean): If true, replace the current transformation values of the object with the values of the transformation matrix. Considering Ruler Units (Boolean) If true, use the current ruler usings and zero point location when transforming the object. If false, use the coordinates relative to the Coordinate Space parameters. Set myindesign = CreateObject("InDesign.Application.CS3") Template for TransformationMatrices.Add Add([HorizontalScaleFactor], [VerticalScaleFactor], [ClockwiseShearAngle], [CounterclockwiseRotationAngle], [HorizontalTranslation], [VerticalTranslation], [MatrixValues]) As TransformationMatrix em Note empty parameters. Set myrotatematrix = myindesign.transformationmatrices.add(,,, 27) Set myscalematrix = myindesign.transformationmatrices.add(.5,.5) Set myshearmatrix = myindesign.transformationmatrices.add(,, 30) Set mydocument = myindesign.documents.add Set myrectangle = mydocument.pages.item(1).rectangles.add myrectangle.geometricbounds = Array("72pt", "72pt", "144pt", "288pt") Template for Rectangle.Transform: Transform(In As idcoordinatespaces, From, WithMatrix, [ReplacingCurrent], [ConsideringRulerUnits As Boolean = False]) yrectangle.transform idcoordinatespaces.idpasteboardcoordinates, idanchorpoint.idcenteranchor, myrotatematrix Create another rectangle. Set myrectangle = mydocument.pages.item(1).rectangles.add myrectangle.geometricbounds = Array("72pt", "72pt", "144pt", "288pt") Transform the rectangle. myrectangle.transform idcoordinatespaces.idpasteboardcoordinates, idanchorpoint.idcenteranchor, myscalematrix Create another rectangle. Set myrectangle = mydocument.pages.item(1).rectangles.add myrectangle.geometricbounds = Array("72pt", "72pt", "144pt", "288pt")

Scripting Read Me for Adobe InDesign CS3 Scripting Documentation Corrections 6 Transform the rectangle. myrectangle.transform idcoordinatespaces.idpasteboardcoordinates, idanchorpoint.idcenteranchor, myshearmatrix Scripting Documentation Corrections The following are known errors in the Adobe InDesign CS3 scripting documentation: On page 4 of the Adobe InDesign CS3 Scripting Tutorial, we refer to.spt as a valid AppleScript file extension. This should be.scpt. Note, in addition, that.as is not a standard AppleScript file extension, but is supported by InDesign. On page 6 of Adobe InDesign CS3 Scripting Guide: AppleScript, the file path cited in the section on compilation is incorrect. The correct file path is: ~/Users/user_name/Library/Caches/Adobe InDesign/Version 5.0/Scripting Support/4.0 where ~ is your system volume and user_name is your user name. On page 6 of the Adobe InDesign CS3 Scripting Guide: VBScript, the file path cited in the section on compilation is incorrect. The correct file path is: ~:\Documents and Settings\All Users\Application Data\Adobe\InDesign\Version 5.0\Scripting Support\4.0 where ~ is your system volume. On page 6 of Adobe InDesign CS3 Scripting Guide: JavaScript, the reference to InDesign CS_J in the section on script interpretation should refer to InDesign CS. On page 27 (AppleScript version), 24, (JavaScript version), and 25 (VBScript version) of the Adobe InDesign CS3 Scripting Guide, we refer to a web page that has changed. The new link for the XMP specification is: http:partners.adobe.com/public/developer/xmp/topic.html Known Issues Related to InDesign CS3 Scripting JavaScript Start-up Scripts User start-up scripts should be placed in the InDesign start-up scripts location (where they will run once each time the application is launched), not in the ExtendScript engine initialization scripts location (where they will run each time an engine is initialized). To run scripts when InDesign starts, put them in the Startup Scripts folder inside the Scripts folder in your InDesign folder. (Create this folder if it does not already exist).) Cannot Set the Midpoint Location for an Opacity Gradient Stop If you try to set the midpoint location for the first opacity gradient stop in a gradient feather settings object, InDesign returns an error.

Scripting Read Me for Adobe InDesign CS3 Known Issues Related to InDesign CS3 Scripting 7 Scripts Run outside InDesign Cannot Create Persistent ExtendScript Engines (JavaScript only) As discussed in Chapter 2, Scripting, of Adobe InDesign CS3 Scripting Guide: JavaScript, ExtendScript scripts can create persistent instances of the ExtendScript engine. Functions and variables defined in the persistent engine can be used by other scripts that execute in that engine. To create a persistent ExtendScript engine, however, the script must be run from the InDesign Scripts panel running the script from the ExtendScript Toolkit or via BridgeTalk from another application will not create the persistent engine. Event Listeners Added or oved During Event Propagation Are Not Handled According to the W3C Specification The W3C DOM Level 2 Event Handling Specification (see http:www.w3.org/tr/dom-level-2-events/overview.html) states: And: If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. In InDesign scripting, event listeners added to an event target during event propagation are not triggered for the duration of the event. Event listeners removed from an event target during event propagation are triggered by the event (i.e., the event listeners are removed when event processing is complete,). The ExtendScript Toolkit Does Not Show a List of InDesign Scripts (Mac OS only) By default, the ExtendScript Toolkit does not specify a target application when it starts. This means the list of available scripts in the Scripts panel (in the ExtendScript Toolkit, not in InDesign) is not populated with available InDesign scripts. Set the target application to InDesign, and the ExtendScript Toolkit populates the Scripts panel. Documents Must be Saved before Packaging You must save a document using before using the package method. If you do not save the document, InDesign generates an error.