Hello. I'm having problems writing in a text file:
ControlGetText, FoundText, WindowsForms10.Window.8.app.0.39490e2_r9_ad1112, Realm
FileAppend, %FoundText%, %A_ScriptDir%\test.txt
I know the first line works, so the problem must be with the fileappend line (nothing is written in the text file). If possible I would like to do something like this as well:
1) +%FoundText% - Time Stamp
2) +%FoundText% - Time Stamp
3) +%FoundText% - Time Stamp
Where every line written in the text file is a new iteration of a loop. Time Stamp would be the current time on the PC. So with every loop iteration, it writes the string stored in FoundText in a line in the text file along with the # of the loop and timestamp. Every iteration should have it's own line (same format as above). The most important thing for me however is to at least write the text down in the text file (each loop 1 line below the previous). I've looked at documentation and will continue to look in case there is no replies. Thanks a lot!
Writing in a text file Topic is solved
-
- Posts: 25
- Joined: 24 Jun 2017, 22:17
Re: Writing in a text file
What did you do to confirm that the first line works? Did you put a MsgBox, %FoundText% in between the first and last line to make sure the text was in the variable? If there is text in that variable, the second line will write it to the file.
- divanebaba
- Posts: 805
- Joined: 20 Dec 2016, 03:53
- Location: Diaspora
Re: Writing in a text file
If your first line works and fills variable FoundText with content, than your issue is just how to get a new line. Writing into new line can be done as shown below:`n creates a new line. UTF-8 format is recommended.
Code: Select all
FileAppend, `n%FoundText%, %A_ScriptDir%\test.txt, UTF-8
Einfach nur ein toller Typ.
Re: Writing in a text file Topic is solved
Here's how to get the time stamp in your loop:
FileAppend, +%FoundText% - %A_Now%`n, %A_ScriptDir%\test.txt
FileAppend, +%FoundText% - %A_Now%`n, %A_ScriptDir%\test.txt
Who is online
Users browsing this forum: Google [Bot], Lamron750 and 241 guests