I typically am 2-5 months behind on this task so I spend a lot of time doing this routine: loading the page, changing the date, submitting, changing the date to what it just was, submitting, changing the date to what it just was plus 1 day, submitting, repeat...
To speed things up my code begins with a manually copied a date (i.e. Jan-01-2018). I enter my activity and the page reloads with today's date. If I need to enter another activity for Jan-01, I activate the script and it figures out if I want to use Jan-01-2018, or if I want to advance to Jan-02-2018, based on whether or not I have the "01" highlighted. If its highlighted it pastes "02" in place of it and then copies the whole date for the next page load. The problem I'm having is that sometimes when I highlight "01" it crtl-A, ctrl-V's "01", instead of changing only the "01" to "02".
Examples in action (both times the clipboard started with "Jan-01-2018"
How its supposed to work: https://i.imgur.com/8N1iJYU.gifv
How it sometimes works: https://i.imgur.com/xBIye28.gifv
and the code:
Code: Select all
^j::
ClipSaved := ClipboardAll ;save clipboard
clipboard := "" ; empty clipboard
Send, ^c ; copy the selected file
if (Clipboard = "") {
Clipboard := ClipSaved ; Restore the original clipboard. Note the use of Clipboard (not ClipboardAll).
ClipSaved = ; Free the memory in case the clipboard was very large.
Send, ^a^v
} else {
RegExMatch(clipboard,"\d+$",match) ;finds number last in clipboard string, and stores it to the value "match"
match++ ;increases the value of "match" by 1
clipboard:=RegExReplace(clipboard,"\d+$",match) ;replaces the last number in clipboard string with the new value of "match"
send ^v
send, ^a^c
}
Return