Need help with an automatic click macro

I have an odd track away my work that is simple but time consuming. Once every week or two i need to process gift card prizes for employees.
This week there were 3000 of them.
The process is simple i literally click a button next to each persons name.

So what i want to do is create a macro that simply clicks a spot, waits about 4 seconds, which is about the time it takes for the load screen to vanish, then click the same spot again.

But i can’t even get the click part to work. And i can’t find any help on this macro.

Not a direct answer to your question but maybe an alternative. If it’s the same process that never changes, you can probably just have PowerShell do that for you (or any scripting language). You’d have to tweak it for how long to wait and when to stop; it would help if you knew how many times you want it to run the loop.

I’d probably do something like have the script start, wait 5 seconds so I could click in the web page (to bring it into focus), then make a loop to alt+D (Or w/e your browsers command to go to the address bar is), then TAB the exact amount of times from the address bar to the submit button (You’ll have to do this to find the amount of times you want it to tab)

Here’s a script I created to do the above. It creates a COM object to automate keystrokes as if you did it. I’d run it from PowerShell ISE and run it from that so you can see the countdown in the console from the total you tell it to run. I defaulted it to 5 for testing and you’d just change it to how many times you want it to loop. I tried preformatted text but it was all over the place so here it is without indents:

Before you run it you will want to go to your website, hit alt+D or click the address bar and count exactly how many times it takes you to hit the TAB key for the submit button you’re talking about to be highlighted so you can hit the ENTER key (alternative to clicking on the button). Once you have the number, replace the number 6 below where it says " $wshell.SendKeys(’{TAB 6}’) " to the number you counted. And when you run the script, make sure you click in the web page so it’s in focus.

Press ctrl+c or ctrl+break to stop the script, or just hit the big red square in the ISE GUI.
-Copy starting below this line into a txt file and rename it from .txt to .ps1 right click it and open with PowerShell ISE because likely you won’t be able to just run scripts (by design as a security feature)

$wshell = New-Object -ComObject wscript.shell

#Change the value of $i to the number of times you want this to run
$i = 5

function tabenter{

#Waits 5 seconds, change to what you want for the site to refresh.
Start-Sleep -Seconds 5

#Hits Alt+D to go to the address bar of the browser, change if this is not the shortcut for the browser you’re using, it works in IE, Chrome, and Firefox for me.
$wshell.SendKeys(’%d’)
Start-Sleep -milliseconds 1

#Hits the Tab key a certain amount of times, change the number as needed for your site to get to the submit button you want to hit enter on.
$wshell.SendKeys(’{TAB 6}’)
Start-Sleep -milliseconds 1

#Hits the enter key, you can also use {’{ENTER}’} but this is actually the numpad so sometimes has mixed results. ~ is carriage return / the main enter key.
$wshell.SendKeys(’~’)
Start-Sleep -milliseconds 1
}

#Loop until $i is 0
do{
Write-Output $i
Start-Sleep -milliseconds 1

#Runs the function
tabenter
Start-Sleep -milliseconds 1

#This subtracts from the total number of times to run
$i–

}while($i -gt 0)

Forgot to mention that I tested the above with a local html page I created with a clock and anchor link to check against the seconds to make sure the timing was right. Needed to make one for my testing anyways.