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 three ways to paste a user-defined function
into a script:
- Select Edit>Paste Special>Function>User-defined
from the menu bar. - Enable AutoScript and double-click the function’s
signature in the listbox that displays when you pause. - Select the function in the Browser and copy and
paste it into the script.
Using 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:
-
Select Window>Browser from the
menu bar. -
Select a global function from the Function page.
or
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 popup menu. -
In the Script view, move the insertion point to
where you want to paste the function and select Paste from the popup
menu.The function and its prototype parameters display at the insertion
point in your script. - Specify the required arguments.