How to restart macro when it stalls?
-
- Posts: 27
- Joined: 27 Mar 2017, 07:45
How to restart macro when it stalls?
If there is a problem while running the macro it currently stalls when I'm running it as an exe file. Then I would need to close it and restart it. Is there a way to automatically restart the macro when it stalls?
Re: How to restart macro when it stalls?
Once it gets 'brain-dead' I doubt that there's a kind of self-healing option. Let's guess it needs a little help from a friend eg another script that monitors it in parallel (probably you can detect a stalled scripts status/process like using the task manager).
Good luck.
Good luck.
Re: How to restart macro when it stalls?
What do you mean it stalls? I think you have other tasks at hand if that's the case.
Re: How to restart macro when it stalls?
Maybe he is using RunWait on something that does not end?
-
- Posts: 27
- Joined: 27 Mar 2017, 07:45
Re: How to restart macro when it stalls?
I have a macro that searches a database and when it finds the record then it opens it up and everything runs smoothly. But when the macro can't find the record and it continues with the script to open the record but the record doesn't exist and the macro stops working.
Re: How to restart macro when it stalls?
Still does not give us much information to go on as to what the root cause is.
Why does it stop working? You said something about an EXE file - does it run an EXE which never exits because of the problem?
Can you not just detect if the search didn't return anything and then not try to do the next bit?
You said "Everything opens up" - What opens up? Some windows?
Can you not check for existence of the window before trying to do the 2nd step?
Why does it stop working? You said something about an EXE file - does it run an EXE which never exits because of the problem?
Can you not just detect if the search didn't return anything and then not try to do the next bit?
You said "Everything opens up" - What opens up? Some windows?
Can you not check for existence of the window before trying to do the 2nd step?
-
- Posts: 27
- Joined: 27 Mar 2017, 07:45
Re: How to restart macro when it stalls?
Yes, the exe file does not exit when there is a problem.
How do you check the existence of a window before the next step?
I was hoping for the macro to stop running or reset itself after a certain time period of waiting.
How do you check the existence of a window before the next step?
I was hoping for the macro to stop running or reset itself after a certain time period of waiting.
Re: How to restart macro when it stalls?
IfWinExist / IfWinActive etc
Re: How to restart macro when it stalls?
Also, how do you do the search?
If you use an EXE, the EXE may return a code to indicate if it succeeded or failed, you could maybe read that instead of having to check for windows
If you use an EXE, the EXE may return a code to indicate if it succeeded or failed, you could maybe read that instead of having to check for windows
Re: How to restart macro when it stalls?
Once the script fails to find a record it has to quit/get out of the loop/offer an alternative ... so where's your script?ParisPulvinar wrote:I have a macro that searches a database and when it finds the record then it opens it up and everything runs smoothly. But when the macro can't find the record and it continues with the script to open the record but the record doesn't exist and the macro stops working.
-
- Posts: 27
- Joined: 27 Mar 2017, 07:45
Re: How to restart macro when it stalls?
How do you know when you can't find a record?
Re: How to restart macro when it stalls?
We don't even know what database you are using, the AHK code you run the query with, how you issue the query, what the SQL of the query is...ParisPulvinar wrote:How do you know when you can't find a record?
Who is online
Users browsing this forum: Google [Bot], Raymondbit and 378 guests