Page 1 of 1

run documentation

Posted: 28 Apr 2018, 16:20
by malcev
If We run last example with character ✓ here:
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
May be it will be good to make a note that wscript does not understand correctly all characters?