make it work while i use other apps ex while i use other apps it executes in backrgtound foreground


Loop
{





; Activate Chromium window
If WinExist("ahk_exe chrome.exe") {
    WinActivate  ; Activate the found window
} else {
    MsgBox, Chromium window not found!
    return
}

; Wait for the window to be active
WinWaitActive, ahk_exe chrome.exe
Sleep, 100  ; Ensure the window is fully ready




    ; Perform the specified actions
    SendInput {Tab 6}  ; Press Tab 6 times
    Sleep, 100  ; Sleep for 1 second.

    SendInput {Enter}  
    Sleep, 100  ; Sleep for 1 second.

    SendInput +{Tab 1}  ; Shift+Tab 1 time
    Sleep, 100  ; Sleep for 1 second.

SendInput +{Tab 1}  ; Shift+Tab 1 time
    Sleep, 100  ; Sleep for 1 second.

    SendInput {Enter}  
   Sleep, 100  ; Sleep for 1 second.

    SendInput +{Tab 1}  ; Shift+Tab 1 time
    Sleep, 100  

    SendInput {Enter}  
    Sleep, 100  

    SendInput +{Tab 1}  ; Shift+Tab 1 time
    Sleep, 100  

SendInput +{Tab 1}  ; Shift+Tab 1 time
    Sleep, 100  

    SendInput {Enter}  
    Sleep, 100  

    SendInput {Esc}  
    Sleep, 100  


    SendInput ^{r}  ; Ctrl+R
    Sleep, 100  ; Sleep for 1 second.

SendInput {Enter}  
    Sleep, 4000  

    SendInput {F6}  
    Sleep, 100  

    SendInput https://floodmail.net/signup
    SendInput {Enter}  
    Sleep, 4000  

    SendInput {Tab}  ; Tab 1
    Sleep, 100  

    ; Generate random username and password
    username := GenerateRandomString(6)  ; Random username
    password := GenerateRandomString(8)  ; Random password

    SendInput %username%  ; Paste random username
    Sleep, 100  

    SendInput {Tab}  
    Sleep, 100  

    SendInput %password%  ; Paste random password
    Sleep, 100  

    SendInput {Tab}  
    Sleep, 100  

    SendInput {Enter}  
    Sleep, 5000  ; Sleep for 5 seconds.

 SendInput {Tab}  
    Sleep, 100  

SendInput {Enter}  
    Sleep, 4000  

   




SendInput {Tab 1} 
    Sleep, 100  

SendInput {Tab 1} 
    Sleep, 100  

SendInput {Tab 1} 
    Sleep, 100  


SendInput {Tab 1} 
    Sleep, 100  


SendInput {Tab 1} 
    Sleep, 100  


SendInput {Tab 1} 
    Sleep, 100  
   


    SendInput {Enter}  
    Sleep, 4000  




    SendInput +{Tab 1} 
    Sleep, 100  

SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 


SendInput +{Tab 1} 
    Sleep, 100 


    SendInput test


    SendInput {Enter}  
    Sleep, 4000  




SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 


SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 



 SendInput test
Sleep, 100 

SendInput {Enter}  
    Sleep, 4000  




SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 


SendInput +{Tab 1} 
    Sleep, 100 

SendInput +{Tab 1} 
    Sleep, 100 


 SendInput test
Sleep, 100 

SendInput {Enter}  
     







    Sleep, 120000  
}



; Function to generate random strings
GenerateRandomString(length) {
    letters := "abcdefghijklmnopqrstuvwxyz"
    randomString := ""
    Loop, %length%
    {
        Random, randomIndex, 1, StrLen(letters)  ; Generate a random index
        randomString .= SubStr(letters, randomIndex, 1)  ; Append the character at that index
    }
    return randomString
}