Adobe InDesign CS4 (6.0) Object Model JS: Function

InDesign CS4

Class

Function

 The Function class wraps a built-in or JavaScript function.

QuickLinks

Function, apply, call, toSource, toString

Properties

PropertyTypeAccessDescription
argumentsObject r/wThe function arguments, packed into an array.
This property is deprecated; use the arguments property within the function body.
aritynumber readonlyThe number of formal arguments.
This property is deprecated; use the length property instead.
lengthnumber readonly The number of formal arguments.
namestring readonlyThe function name.

Methods

Constructor

Function Function (arguments: string, body: string) The Function constructor parses the argument list and creates a Function object.

ParameterTypeDescription
argumentsstringThe list of formal arguments, separated by commas.
The formal arguments can also be supplied one by one; in this case, the last argument to the Function constructor is considered to be the function body.
bodystringThe body of the function to create.

Instances

any apply (thisObj: Object, args: Array)
Apply a this object and an argument list to a function.
This function is different from call(); here, the arguments are suppliedas an Array object.

ParameterTypeDescription
thisObjObject The object to be used as this.
argsArrayAn array of arguments.

any call (thisObj: Object, argument: any)
Apply a this object and arguments to a function.
This function is different from apply(); here, the arguments are supplied one by one.

ParameterTypeDescription
thisObjObject The object to be used as this.
argument any The first agument to the function. Add as many as needed.

string toSource ()
Creates a string representation of this object that can be fed back to eval() to re-create an object. Works only with JavaScript functions.

string toString ()
Returns the function definition as a string.

Element of

EventListener.handler

Object.constructor

Used in:

EventListener Application.addEventListener (eventType: string, handler: any[, captures: bool=false])

any Application.doScript (script: any[, language: ScriptLanguage=ScriptLanguage.UNKNOWN][, withArguments: Array of any][, undoMode: UndoModes=UndoModes.SCRIPT_REQUEST][, undoName: string=Script])

bool Application.removeEventListener (eventType: string, handler: any[, captures: bool=false])

void Array.sort (userFunction: Function)

bool Button.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Button.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Checkbox.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Checkbox.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

EventListener Document.addEventListener (eventType: string, handler: any[, captures: bool=false])

bool Document.removeEventListener (eventType: string, handler: any[, captures: bool=false])

bool DropDownList.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool DropDownList.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool EditText.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool EditText.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

EventListener EventListeners.add (eventType: string, handler: any[, captures: bool=false][, withProperties: Object])

bool FlashPlayer.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool FlashPlayer.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Group.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Group.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool IconButton.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool IconButton.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Image.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Image.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool ListBox.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool ListBox.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

EventListener Menu.addEventListener (eventType: string, handler: any[, captures: bool=false])

bool Menu.removeEventListener (eventType: string, handler: any[, captures: bool=false])

EventListener MenuAction.addEventListener (eventType: string, handler: any[, captures: bool=false])

bool MenuAction.removeEventListener (eventType: string, handler: any[, captures: bool=false])

void Object.watch (name: string, func: Function)

bool Panel.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Panel.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Progressbar.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Progressbar.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool RadioButton.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool RadioButton.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

EventListener ScriptMenuAction.addEventListener (eventType: string, handler: any[, captures: bool=false])

bool ScriptMenuAction.removeEventListener (eventType: string, handler: any[, captures: bool=false])

bool Scrollbar.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Scrollbar.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Slider.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Slider.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool StaticText.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool StaticText.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

EventListener Submenu.addEventListener (eventType: string, handler: any[, captures: bool=false])

bool Submenu.removeEventListener (eventType: string, handler: any[, captures: bool=false])

bool TreeView.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool TreeView.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Window.addEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

bool Window.removeEventListener (eventName: String, handler: Function[, capturePhase: bool=false])

Return

Function Function.Function (arguments: string, body: string)

Jongware, 20-Jun-2010 v3.0.3dContents :: Index