O'Reilly logo

Adobe® Illustrator® CS2 Official JavaScript Reference by Adobe Systems Incorporated

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Using File and Folder Objects

Overview

Because path name syntax is very different in Windows, Mac OS, and UNIX®, Adobe ExendScript defines the File and Folder objects to provide platform-independent access to the underlying file system. A File Object (page 259) represents a disk file, and a Folder Object (page 268) represents a directory or folder.

  • The Folder object supports file system functionality such as traversing the hierarchy; creating, renaming, or removing files; or resolving file aliases.

  • The File object supports input/output functions to read or write files.

There are several ways to distinguish between a File and a Folder object. For example:

if (f instanceof File) ... if (typeof f.open == "undefined") ...// Folders do not open ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required