• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
 
bb    
 
SCRIPTING GUIDE
 
© Copyright 2007 Adobe Systems Incorporated. All rights reserved.Adobe® Creative Suite® 3 Photoshop
®
Scripting Guide for Windows
®
and Macintosh
®
.NOTICE: All information contained herein is the property of Adobe Systems Incorporated. No part of this publication (whether in hardcopy orelectronic form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, orotherwise, without the prior written consent of Adobe Systems Incorporated. The software described in this document is furnished underlicense and may only be used or copied in accordance with the terms of such license. This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as acommitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors orinaccuracies, makes no warranty of any kind (express, implied, or statutory) with respect to this publication, and expressly disclaims any andall warranties of merchantability, fitness for particular purposes, and noninfringement of third party rights.Any references to company names in sample templates are for demonstration purposes only and are not intended to refer to any actualorganization.Adobe
®
, the Adobe logo, Illustrator
®
, and Photoshop
®
are either registered trademarks or trademarks of Adobe Systems Incorporated in theUnited States and/or other countries.Apple
®
, Mac OS
®
, and Macintosh
®
are trademarks of Apple Computer, Inc., registered in the United States and other countries. Microsoft
®
, andWindows
®
are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries. JavaScript
 TM
andall Java-related marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. UNIX
®
is aregistered trademark of The Open Group. All other trademarks are the property of their respective owners.All other trademarks are the property of their respective owners.If this guide is distributed with software that includes an end user agreement, this guide, as well as the software described in it, is furnishedunder license and may be used or copied only in accordance with the terms of such license. Except as permitted by any such license, no partof 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. Please note that the content in this guide is protectedunder copyright law even if it is not distributed with software that includes an end user license agreement. The content of this guide is furnished for informational use only, is subject to change without notice, and should not be construed as acommitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors orinaccuracies that may appear in the informational content contained in this guide.Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA.
 
3
Contents
Scripting Overview........................................................................................................................................................................7Why use scripts instead of actions?...................................................................................................................................7Scripting Support in PhotoshopCS3......................................................................................................................................8JavaScript Support...................................................................................................................................................................8Startup Scripts...........................................................................................................................................................................9Executing JavaScripts from AS or VBS..............................................................................................................................9PhotoshopCS3 Object Model....................................................................................................................................................9Containment Hierarchy.......................................................................................................................................................10 The Containment Hierarchy and the PhotoshopCS3 User Interface..................................................................12Additional Objects.................................................................................................................................................................14Constants..................................................................................................................................................................................14Creating a Sample Hello World Script...................................................................................................................................15Creating and Running an AppleScript............................................................................................................................15Creating and Running a VBScript.....................................................................................................................................16Creating and Running a JavaScript.................................................................................................................................17
Viewing PhotoshopCS3 Objects, Commands, and Methods......................................................................................19Viewing PhotoshopCS3’s AppleScript Dictionary.....................................................................................................19Viewing PhotoshopCS3’s Type Library (VBS)..............................................................................................................20 Targeting and Referencing the Application Object.........................................................................................................20Creating New Objects in a Script............................................................................................................................................21Setting the Active Object..........................................................................................................................................................23Setting the Active Document............................................................................................................................................24Setting the Active Layer.......................................................................................................................................................25Setting the Active Channels...............................................................................................................................................25Opening a Document.................................................................................................................................................................26Opening a File with Default File Format........................................................................................................................26Specifying File Formats to Open......................................................................................................................................27Saving a Document.....................................................................................................................................................................29Setting Application Preferences ............................................................................................................................................30Allowing or Preventing Dialogs..............................................................................................................................................31Working with the PhotoshopCS3 Object Model..............................................................................................................31Using the Application Object............................................................................................................................................31Using the Document Object..............................................................................................................................................32Working with Layer Objects...............................................................................................................................................34Creating an ArtLayer Object...............................................................................................................................................34Creating a Layer Set Object................................................................................................................................................35Working with Layer Set Objects........................................................................................................................................37Using the Text Item Object.................................................................................................................................................39Working with Selection Objects.......................................................................................................................................41
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...