CreateScript

Creates a script from main script that can be passed to AutoHotkey.dll, BinRun or DynaRun.

OutputVar := CreateScript(Script , Password)
Function Example: MyScript := CreateScript("a:=1`nStart:End`nfun{}")

Parameters

OutputVar

The name of the variable in which to store the created script.

Script

Label or function in main Script to include.
Syntax for including label is tartingLabelName:EndingLabelName
Syntax for including function is FunctionName{}

Password (optional)

Password used to compile in Ahk2Exe.

General Remarks

You can have any code between included labels and functions. Script is also loaded from Resource if A_IsCompiled.

Related

AutoHotkey.dll, BinRun, DynaRun

Examples

DynaRun(CreateScript("
(
Gui,Add,Button,g
func{}
)"),"Dynamic script")
ExitApp
:
Return
func(){
  Return "test trough pipe"
}