lakadigital Posted April 29, 2023 Share Posted April 29, 2023 I tried to run the script/executable, for the send keys. it worked for the first run. Then after 3 seconds, I run again, it doesn't run the function. It needs to be wait a while, then the script will work again. I tried to processClose $process still can't produce consistent output. $process = ProcessList(@ScriptName) If ProcessExists($process) Then ProcessClose($process) RunKey() Else RunKey() EndIf Func RunKey() Sleep(250) Send("^!a") Exit 0 EndFunc Link to comment Share on other sites More sharing options...
lakadigital Posted April 29, 2023 Author Share Posted April 29, 2023 Anyway, anything to debug the log when the script/executable is running? I need to check the logs Link to comment Share on other sites More sharing options...
ioa747 Posted April 29, 2023 Share Posted April 29, 2023 delete everything and keep only this Send("^!a") Musashi 1 I know that I know nothing Link to comment Share on other sites More sharing options...
Developers Jos Posted April 29, 2023 Developers Share Posted April 29, 2023 4 hours ago, lakadigital said: $process = ProcessList(@ScriptName) If ProcessExists($process) Then ProcessClose($process) RunKey() Else RunKey() EndIf What is this supposed to do? the first line returns an Array when successful. So what about you start with explaining what it is you like to do exactly? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Musashi Posted April 29, 2023 Share Posted April 29, 2023 (edited) @lakadigital : A more detailed description of what you want to achieve would be beneficial, e.g. by which application your "sendkey script" is called. To avoid starting a script multiple times, you can also use _Singleton. This allows only one running instance of the script at a time. #include <Misc.au3> ; Info : to use _Singleton() ; Exit the script with the exit code -1 if another instance of the script already exists _Singleton(@ScriptName, 0) RunKey() Func RunKey() Sleep(250) Send("^!a") Exit 0 EndFunc (last but not least : please read the forum rules ) Edit : @Jos Apologies, I had already sent my reply when I saw your request. Edited April 29, 2023 by Musashi "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now