Manual
Photoshop CS
Scripting Guide
ADOBE SYSTEMS INCORPORATED
Corporate Headquarters
345 Park Avenue
San Jose, CA 95110-2704
(408) 536-6000
http://partners.adobe.com
October 2003
Adobe Photoshop Scripting Guide
Copyright 1991–2003 Adobe Systems Incorporated.
All rights reserved.
The information in this document is furnished for informational use only, is subject to changewithout 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, Photoshop, and PostScriptare either registered trademarks or trademarks of Adobe Systems Incorporated in the United States
and/or other countries. Apple, Macintosh, and Mac are trademarks of Apple Computer, Inc. registered in the United States and other
countries. Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries. All othertrademarks are the property of their respective owners.
Table of contents
C hapter 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 About this manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 What is scripting? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Why use scripting? . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 What about actions? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.6 JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.7 Choosing a scriptinglanguage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.8 Legacy COM scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.9 New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.10 What’s Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
C hapter 2Scripting basics . . . . . . . . . . . . . . . . . . . . . . . 8
2.1 Documents as objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2 Object model concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4 Documenting scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.5 Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.6 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.7 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.8 Commandsand methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.9 Handlers, subroutines and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.10 Debugging and Error Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.11 What’s Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
C hapter3
Scripting Photoshop. . . . . . . . . . . . . . . . . . . . . 31
3.1 Photoshop scripting guidelines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2 Viewing Photoshop objects, commands and methods . . . . . . . . . . . . . . . . . . . . 31
3.3 Your first Photoshop script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.4 Advanced Scripting ....
Regístrate para leer el documento completo.