Can AHK apply a dynamic filename to a file it makes?
Can AHK apply a dynamic filename to a file it makes?
For example, can FileAppend()
be set to create something like %COMPUTERNAME%test.txt
? I have no idea of what the code for this would be like, if so.
Yes, computer name and date are both easily pulled by ahk.
https://www.autohotkey.com/docs/v1/Variables.htm
Right, thanks (also v2 so that'd be https://www.autohotkey.com/docs/v2/Variables.htm), but I'm wondering about the syntax to actually use
A_ComputerName
when the directory is involved. I don't know how to dynamically include this variable inside the filename of a new .TXT that AutoHotkey would create.You would either concatenate it or use the format command. That is explained at the beginning of the document. You could assign the filename to a variable.
filename := A_ComputerName. ".txt"
I am on mobile so it is much easier to link to examples. What have you tried?