I am trying to track how many times I push F2 and F3. I would like to build a daily log of this information. Should I use IniWrite, FileAppend or some other method?
Question: How can i make a new line every day and log the total number of key presses?
I would like the information to be saved to a .txt or .ini file and appear something like this.....
(date) = ( Number of Keypress)
20190906 = 50
20190907 = 182
20190908 = 76
Here's some code that I started working on, but I'm not to sure how to make a new line every day.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance Force Count := 1 Today := SubStr(A_Now, 1, 8) ; Date format YYYYMMDD 20190920 F2:: GoSub, Stats return F3:: GoSub, Stats return Stats: FKeysPress := count++ IniWrite, %FKeysPress%,A_WorkingDir.ini , %Today%, KeyPresses return esc:: msgbox, Number of time the F Keys was pushed = %FKeysPress% return
All help is appreciated, Thank you.