Adobe 27510753 Scripting Guide - Page 67
ReflectionInfo Object, Reflection object functions, ReflectionInfo object properties
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 67 highlights
Adobe InDesign CS2 Scripting Guide Using ExtendScript Tools and Features 59 Reflection object functions find reflectionObj.find (name) Returns the ReflectionInfo object for the named property of the reflected object, or null if no such property exists. Use this method to get information about dynamic properties that have not yet been accessed, but that are known to exist. name The property for which to retrieve information. ➤ Examples This code determines the class name of an object: obj = new String ("hi"); obj.reflect.name; // => String This code gets a list of all methods: obj = new String ("hi"); obj.reflect.methods; //=> indexOf,slice,... obj.reflect.find ("indexOf"); // => the method info This code gets a list of properties: Math.reflect.properties; //=> PI,LOG10,... This code gets the data type of a property: Math.reflect.find ("PI").type; // => number ReflectionInfo Object This object contains information about a property, a method, or a method argument. l You can access ReflectionInfo objects in a Reflection object's properties and methods arrays, by name or index: obj = new String ("hi"); obj.reflect.methods[0]; obj.reflect.methods["indexOf"]; l You can access the ReflectionInfo objects for the arguments of a method in the arguments array of the ReflectionInfo object for the method, by index: obj.reflect.methods["indexOf"].arguments[0]; ReflectionInfo object properties arguments Array of For a reflected method, an array of ReflectionInfo objects describ- ReflectionInfo ing each method argument.