Functions

Executes a Function and assigns the result to a Variable. You can also call object methods in this window.

Functions (Ctrl+F10)

Parameters

Output Variable (Optional)
Name of the Variable in which to store the contents.
Array Object
If checked, the name of an Array/Object on which to call the method.
Use Function from External File
Check this option to select an AutoHotkey Script File (.ahk) containing one or more functions to be used. This feature requires AutoHotkey installed.
See Remarks below for more information.
Function Name
A valid AHK Built-in Function, an existing User-Defined function or one in the selected external .ahk file.
Comma separated parameters

The list of parameters for the function. Notes:

InStr("AutoHotkey", "o", , , 2)

The function above have 5 possible parameters. In this example parameters 3 and 4 will use the default values.

Remarks

AutoHotkey's Built-in Functions are supported by default. You can also define your own functions inside PMC in User-Defined functions](Functions.html#user-defined-functions) window and run functions from external AutoHotkey Script Files, if you have [AutoHotkey installed.

External Functions

If a Standard Library File is configured it will be automatically loaded when a new command is added.

When you load an external file the program will try to detect possible function names and list them in Function Name field. If the function you want doesn't appear in the list you can still type it manually.

When this feature is used in Playback it will create a temporary .ahk file in the same directory where Macro Creator is installed and run it using AutoHotkey. The result will be copied to the Output Variable and the script will be closed.

If the ahk file containing the function have #include directives they must contain the absolute path for the included files (e.g.: #include c:\lib\myfunction.ahk).

Since those functions are not loaded with Macro Creator they may take longer to execute.

Note: This feature is limited and can only return 1 string/number value. It's recommended to use User-Defined Functions instead.