Ok I have resolved the problem as Draco suggested I left the AHK scripting and went back to working on a batch file to launch both xpadder and the borderlessDMD AHK script. Its weird, to get it working correctly I had to put an instance check in for the borderlessDMD script but not for xpadder. Anyway, it is all working smoothly now For anyone else having the same problem here is the batch script code I am using. I am not a programmer just pieced it together with google's help so probably not very elegant coding but it does the job Create a txt file, paste this code/txt into it, and change the file extension to .bat and you have your batch file @echo offcd "C:\Program Files (x86)\xpadder"start Xpadder.exe"tasklist | find "Borderless_DMD.exe"if errorlevel 1 goto :Borderless_DMD:Endexit:Borderless_DMDcd "C:\Program Files\AutoHotkey" start Borderless_DMD.exegoto :End