https://autohotkey.com/docs/commands/Run.htm#Examples
Then We will get error:
Code: Select all
ExecScript(Script, Wait:=true)
{
shell := ComObjCreate("WScript.Shell")
exec := shell.Exec("AutoHotkey.exe /ErrorStdOut *")
exec.StdIn.Write(script)
exec.StdIn.Close()
if Wait
return exec.StdOut.ReadAll()
}
; Example:
expr = Asc("✓")
result := ExecScript("FileAppend % (" expr "), *")
MsgBox % "Result: " result