Using your functions

You use user-defined functions the same way you use built-in functions. You can call them in event scripts or in other user-defined functions.

For complete information about calling functions, see Application Techniques.

Pasting user-defined functions

When you build a script in the Script view, you can type the call to the user-defined function. You can also paste the function into the script. There are four ways to paste a user-defined function into a script:

  • Drag the function from the System Tree to the Script view.

  • Select Edit>Paste Special>Function>User-defined from the menu bar.

  • Enable AutoScript, select the function's signature in the list that displays when you pause, and press Tab or Enter.

  • Select the function in the Browser and copy and paste it into the script.

Using the System Tree, AutoScript, or the Browser pastes the function's prototype arguments as well as its name into the script.

For more information about AutoScript, see Using AutoScript.

To paste a user-defined function into a script from the Browser:

  1. Select Tools>Browser from the menu bar.

  2. Do one of the following:

    • Select a global function from the Function page.

    • Select the object that contains the object-level function you want to paste from the corresponding page (such as the Window page).

    • Double-click the Functions category in the right pane.

    • Select the function you want to paste and select Copy from its pop-up menu.

  3. In the Script view, move the insertion point to where you want to paste the function and select Paste from the pop-up menu.

    The function and its prototype parameters display at the insertion point in your script.

  4. Specify the required arguments.