[V2.beta.3] FileAppend does not work like documented

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
T-Rock
Posts: 27
Joined: 01 Feb 2015, 09:11

[V2.beta.3] FileAppend does not work like documented

Post by T-Rock » 04 Dec 2021, 04:47

[Moderator's note: Topic moved from Bug Reports.]

The Help says about the second Parameter for using stdout for FileAppend:
However, text sent to stdout will not appear at the command prompt it was launched from. This can be worked around by 1) compiling the script with the Ahk2Exe ConsoleApp directive, or 2) piping a script's output to another command or program.
My guess is that it works like v1.
But using stdout ("*") as the second Parameter without changing the executable subsystem to Console mode the compiled program throws an error message in a message box saying "The handle is invalid".
test_sKL47QxxDN.png
test_sKL47QxxDN.png (5.09 KiB) Viewed 733 times

lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: [V2.beta.3] FileAppend does not work like documented

Post by lexikos » 08 Apr 2022, 22:05

That just means there is no stdout.
Such text can be redirected to a file, piped to another EXE, or captured by fancy text editors.
If you don't do one of those things, or set the stdout handle yourself, there will be no valid handle for FileAppend to write to.
An OSError is thrown on failure.

Post Reply

Return to “Ask for Help (v2)”