# #ErrorStdOut

Sends any syntax error that prevents a script from launching to stdout rather than displaying a dialog.

#ErrorStdOut

This allows fancy editors such as Textpad, Scite, Crimson, and EditPlus to jump to the offending line when a syntax error occurs. Since the #ErrorStdOut directive would have to be added to every script, it is usually better to set up your editor to use the command line switch /ErrorStdOut when launching any AutoHotkey script (see further below for setup instructions).

Although syntax errors are sent to standard output (stdout), they will not appear at the command prompt directly. Instead, such output can be captured via piping or redirection. For example:

    "C:\Program Files\AutoHotkey\AutoHotkey.exe" /ErrorStdOut "My Script.ahk" |more
    "C:\Program Files\AutoHotkey\AutoHotkey.exe" /ErrorStdOut "My Script.ahk" >"Syntax-Error Log.txt"

You can also pipe the output directly to the clipboard by downloading cb.zip (4 KB) and then following this example:

    "C:\Program Files\AutoHotkey\AutoHotkey.exe" /ErrorStdOut "My Script.ahk" |cb.exe

Instructions for specific editors:

EditPlus:
From the menu bar, select Tools > Configure User Tools.
Press button: Add Tool > Program
Menu Text: Your choice
Command: C:\Program Files\AutoHotkey\AutoHotkey.exe
Argument: /ErrorStdOut "$(FilePath)"
Initial directory: $(FileDir)
Capture output: Yes

TextPad:
From the menu bar, select Configure > Preferences.
Expand the Tools entry.
Press the Add button and select "Program".
Copy and paste (adjust to your path): C:\Windows\System32\cmd.exe -- then press OK.
Triple-click the newly added item (cmd.exe) in the ListBox and rename it to your choice (e.g. Launch Script).
Press Apply.
Select the new item in the tree at the left and enter the following information:
Command (should already be filled in): cmd.exe (or the full path to it)
Parameters (adjust to your path, if necessary): /c ""C:\Program Files\AutoHotkey\AutoHotkey.exe" /ErrorStdOut "$File""
Initial folder: $FileDir
Check the following boxes: 1) Run minimized; 2) Capture output.
Press OK. The newly added item should now exist in the Tools menu.

#### Related

FileAppend (because it can also send text to stdout)

#### Example

    #ErrorStdOut