Adobe 27510753 - InDesign CS2 - PC Manual page 78

Scripting guide
Hide thumbs Also See for 27510753 - InDesign CS2 - PC:
Table of Contents

Advertisement

70
Using ExtendScript Tools and Features
#engine name
#include file
#includepath path
Identifies the ExtendScript engine that runs this script. This allows other engines to
refer to the scripts in this engine by importing the exported functions and vari-
ables. See the "Importing and exporting between scripts" section.
Use JavaScript identifier syntax for the name. Enclosing quotes are optional. For
example:
#engine library
#engine "$lib"
Includes a JavaScript source file from another location. Inserts the contents of the
named file into this file at the location of this statement. The file argument is an
Adobe portable file specification. See the "Specifying Paths" section.
As a convention, use the file extension . jsxinc for JavaScript include files. For
example:
#include "../include/lib.jsxinc"
To set one or more paths for the #include statement to scan, use the #include-
preprocessor directive.
path
If the file to be included cannot be found, ExtendScript throws a run-time error.
Included source code is not shown in the debugger, so you cannot set breakpoints
in it.
One or more paths that the #include statement should use to locate the files to
be included. The semicolon ( ; ) separates path names.
If a #include file name starts with a slash ( / ), it is an absolute path name, and
the include paths are ignored. Otherwise, ExtendScript attempts to find the file by
prefixing the file with each path set by the #includepath statement.
For example:
#includepath "include;../include"
#include "file.jsxinc"
Multiple #includepath statements are allowed; the list of paths changes each
time an #includepath statement is executed.
As a fallback, ExtendScript also uses the contents of the environment variable
as a list of include paths.
JSINCLUDE
Some engines can have a predefined set of include paths. If so, the path provided
by #includepath is tried before the predefined paths. If, for example, the engine
has a predefined path set to predef;predef/include , the preceding example
causes the following lookup sequence:
: literal lookup
file. jsxinc
l
include/file. jsxinc
l
../include/file. jsxinc:
l
predef/file. jsxinc
l
predef/include/file. jsxinc
l
: first #includepath path
second #includepath path
: first predefined engine path
: second predefined engine path
Adobe InDesign CS2 Scripting Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents