How to continue running Macro without "Abort", &qu
Moderators: Dorian (MJT support), JRL
How to continue running Macro without "Abort", &qu
Hi,
I would like always to ignore any errors and continue running Macro, if any error occurs midway. That is, I need "Ignore" to be always as default. How can I do that?
Thanks
I would like always to ignore any errors and continue running Macro, if any error occurs midway. That is, I need "Ignore" to be always as default. How can I do that?
Thanks
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Code the macro so that those warnings never appear in the first place.
E.g. you will get a warning like that if you issue a SetFocus but the window doesn't exist. Avoid this by doing:
Code your own Else condition as required - e.g. it could loop back to beginning, start the app, email you a notice, exit the script, or whatever.
Equally to avoid warnings/errors when accessing files:
In short you can code your script to avoid error conditions and handle them as necessary.
E.g. you will get a warning like that if you issue a SetFocus but the window doesn't exist. Avoid this by doing:
Code: Select all
ifWindowOpen>window_title
SetFocus>window_title
.. bla bla
Endif
Equally to avoid warnings/errors when accessing files:
Code: Select all
IfFileExists>filename
DeleteFile>filename
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Ignore Macro scheduler errors
Hi,
I need to ignore macro scheduler errors by default. For example in my looped script sometimes , " Invalid Mouse move occurs", which I need to ignore by default. The same script had many times looped succesfully but at certain times this error occurs. hence what I should do to " Ignore" Macro scheduler program errors by default, as my script does not produce any errors even if ignored.
Thanks for your valuable reply
I need to ignore macro scheduler errors by default. For example in my looped script sometimes , " Invalid Mouse move occurs", which I need to ignore by default. The same script had many times looped succesfully but at certain times this error occurs. hence what I should do to " Ignore" Macro scheduler program errors by default, as my script does not produce any errors even if ignored.
Thanks for your valuable reply
-
- Junior Coder
- Posts: 24
- Joined: Mon Nov 01, 2004 1:30 pm
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
The only time you will get this message is if the values passed to the MouseMove command are not numeric. The message is only ever produced by the MouseMove command when the values are not numbers.
So to avoid it simply make sure the values are numeric. Non numeric mouse moves are clearly non-sensical and would have no effect.
If you get this error on shut down then you must have a macro running at the time. Since the message is only ever produced by the MouseMove function then you must have a macro running when you shut down the computer, and the values must also be non-numeric.
There's a function here which checks whether a value is numeric or not:
http://www.mjtnet.com/forum/viewtopic.php?t=3552
Using that before passing the value to MouseMove would prevent ever getting an invalid mouse move message. But I'd also debug the code that is creating the values to determine why you're ending up with non numeric values in the first place.
So to avoid it simply make sure the values are numeric. Non numeric mouse moves are clearly non-sensical and would have no effect.
If you get this error on shut down then you must have a macro running at the time. Since the message is only ever produced by the MouseMove function then you must have a macro running when you shut down the computer, and the values must also be non-numeric.
There's a function here which checks whether a value is numeric or not:
http://www.mjtnet.com/forum/viewtopic.php?t=3552
Using that before passing the value to MouseMove would prevent ever getting an invalid mouse move message. But I'd also debug the code that is creating the values to determine why you're ending up with non numeric values in the first place.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Junior Coder
- Posts: 24
- Joined: Mon Nov 01, 2004 1:30 pm
Thank you, I wasn't exactly sure how to track the error down. I'll find the culprit now.
My mistake. It isn't an mousemove error I'm getting at shutdown. It's a
" invalid pointer operation " I get some times at shutdown. After searching google looks my best way to find the culprit is to uninstal my most recent software one at a time and do a few shutdowns to find which one has the problem. If it turns out to be MS, I'll try reinstalling it first. If I still get the error I'll let you know.
My mistake. It isn't an mousemove error I'm getting at shutdown. It's a
" invalid pointer operation " I get some times at shutdown. After searching google looks my best way to find the culprit is to uninstal my most recent software one at a time and do a few shutdowns to find which one has the problem. If it turns out to be MS, I'll try reinstalling it first. If I still get the error I'll let you know.
Last edited by thaumaturgy on Sun Sep 16, 2007 3:44 pm, edited 1 time in total.
As I told earlier . in my case, the script has run the same thing many times successfully, but at times and at random " Invalid Mouse move occurs"
The Mousemove command is
MouseMoveRel>443,67
Please also note, that my orginal question was how to Ignore all Macro scheduler errors by default, without human intervention.
Thanks
The Mousemove command is
MouseMoveRel>443,67
Please also note, that my orginal question was how to Ignore all Macro scheduler errors by default, without human intervention.
Thanks
-
- Junior Coder
- Posts: 24
- Joined: Mon Nov 01, 2004 1:30 pm
-
- Junior Coder
- Posts: 24
- Joined: Mon Nov 01, 2004 1:30 pm