I made a script (with help from here) to automate the uploading of files to a site. After every file uploaded, it sends me to this exact page that never changes, let's call this page "Success". I've set a Sleep that I feel is enough for Success to load, then it clicks a button to go back to the uploading page, looping this process until all the files are uploaded. My issue is that sometimes Success takes more than I had set, screwing it all over. I could set a even more longer Sleep time, but generally it takes only a split second to load it, but sometimes it doesn't.
Can someone guide me to what I should look into?
Code: Select all
Global MyCounterVar := 14084
Loop, 825
{
MyCounterVar+=1
Tooltip % MyCounterVar
Sleep 81
SendInput {Raw}2015
SendInput {Tab}
SendInput {Raw}%MyCounterVar%
SendInput {Tab}
SendInput {Raw}File n. %MyCounterVar%
SendInput {Tab}
SendInput {Raw}%MyCounterVar%
Sleep, 20000
SendInput {Tab}
SendInput {Enter}
Continue
}
return ;
#x::Pause
#c::Reload
Esc::ExitApp