Extendscript Reflection Interface; Reflection Object - Adobe 27510753 - InDesign CS2 - PC Manual

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

Advertisement

58
Using ExtendScript Tools and Features
Prop
Class
Name
ExtendScript Reflection Interface
ExtendScript provides a reflection interface that allows you to find out everything about an object, including
its name, a description, the expected data type for properties, the arguments and return value for methods,
and any default values or limitations to the input values.
Reflection Object
Every object has a reflect property that returns a Reflection object that reports the contents of the
object. You can, for example, show the values of all the properties of an object with code like this:
var f= new File ("myfile");
var props = f.reflect.properties;
for (var i = 0; i < props.length; i++) {
$.writeln('this property ' + props[i].name + ' is ' + f[props[i].name]);
}
Reflection object properties
All properties are read only.
description
help
methods
name
properties
A second reference count for the number of properties that reference the object. The
garbage collector uses this count to break circular references. If the reference count is not
equal to the number of JavaScript properties that reference it, the object is considered to
be used elsewhere and is not garbage collected.
The class name of the object.
The name of the object. This name does not reflect the name of the property the object
has been stored into. The name is mostly relevant to Function objects, where it is the name
of the function or method. Names in brackets are internal names of scripts. If the object
has an ID, the last column displays that ID.
String
Short text describing the reflected object, or undefined if no de-
scription is available.
String
Longer text describing the reflected object more completely, or un-
defined
Array of Re-
An Array of ReflectionInfo Objects containing all methods of the
flectionInfo
reflected object, defined in the class or in the specific instance.
String
The class name of the reflected object.
Array of Re-
An Array of ReflectionInfo objects containing all properties of
flectionInfo
the reflected object, defined in the class or in the specific instance.
For objects with dynamic properties (defined at runtime) the list
contains only those dynamic properties that have already been ac-
cessed by the script. For example, in an object wrapping an HTML
tag, the names of the HTML attributes are determined at run time.
if no description is available.
Adobe InDesign CS2 Scripting Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents