Java Mac Download

Hello, I'm fairly new to auto hot key. I'm trying to control two computers automatically, remotely. All I need to do is send several clicks(fairly easy to script in AHK), run an exe, and loop. All of this was easy to put together, however whenever I minimize my connection(I'm using Remote Desktop Connection), the script stops working. I can't tell if it's because the coordinates I previously mapped for clicks are no longer correct, or if something else is going on.