DynaRun

Run code dynamically in new AutoHotkey process.

OutputVar := DynaRun(Script , ScriptName, ScriptParameters, AlternateExecutable)
Command  Example: DynaRun "Msgbox Test", "MyDynaRunScript"
Function Example: PID := DynaRun("MsgBox Test", "MyDynaRunScript")

Parameters

OutputVar

The name of the variable in which to store the PID of new process.

Script

Script to execute in new process as pure text.

ScriptName (optional)

The name of the Script, it will be used for the pipe name and for script name, e.g. you will see it as title in a MsgBox.

ScriptParameters (optional)

Parameters for new script. To use parameters for executable you would need to specify those together with executable in AlternateExecutable.
This parameter can be an object which will be recreated in A_Args using ObjDump/ObjLoad

AlternateExecutable (optional)

AutoHotkey Executable used to run the script. If you want to pass parameters to executable you would need to use that parameter.

Example

DynaRun("MsgBox A_Args.1","MyDynaRun","Test")  ; Will display MsgBox Test in new process.