JAVASCRIPT TOOLS GUIDE © 2010 Adobe Systems Incorporated
Total Page:16
File Type:pdf, Size:1020Kb
ADOBE® CREATIVE SUITE® 5 JAVASCRIPT TOOLS GUIDE © 2010 Adobe Systems Incorporated. All rights reserved. Adobe® Creative Suite® 5 JavaScript Tools 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 or electronic form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of Adobe Systems Incorporated. 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. This publication and the information herein is furnished AS IS, 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, makes no warranty of any kind (express, implied, or statutory) with respect to this publication, and expressly disclaims any and all 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 actual organization. Adobe, the Adobe logo, Acrobat, After Effects, Creative Suite, Dreamweaver, Fireworks, Flash, Flex, Flex Builder, Illustrator, InCopy, InDesign, and Photoshop are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Apple, Mac, Macintosh, and Mac OS 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 other countries. JavaScript and all Java-related marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. UNIX is a registered trademark of The Open Group. 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 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. 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 agreement. The 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 guide. Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA. Contents 1 Introduction . 9 ExtendScript overview . 9 Example code . 9 Development and debugging tools . 10 Cross-platform file-system access . 10 User-interface development tools . 10 Interapplication communication and messaging . 10 External communication . 11 External shared-library integration . 11 Additional utilities and features . 11 Scripting for specific applications . 12 Startup scripts . 12 JavaScript variables . 12 2 The ExtendScript Toolkit . 13 Configuring the Toolkit window . 13 Panel menus . 14 Document windows . 15 Workspaces . 16 Dialogs . 16 Selecting scripts . 17 The Scripts panel and favorite script locations . 17 The Script Editor . 18 Navigation aids . 19 Coding aids . 22 Searching in text . 24 Syntax marking . 26 Debugging in the Toolkit . 27 Selecting a debugging target . 27 The JavaScript console . 28 Controlling code execution . 29 Visual indication of execution states . 30 Setting breakpoints . 31 Evaluation in help tips . 33 Tracking data . 33 The call stack . 34 Code profiling for optimization . 35 Inspecting object models . 36 3 File System Access . 39 Using File and Folder objects . 39 Specifying paths . 39 Unicode I/O . 43 3 4 File error handling . 43 File access error messages . 44 File- and Folder-supported encoding names . 45 Additional encodings . 45 File object . 47 File object constructors . ..