Automatically Abort On Error

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
tommystery
Junior Coder
Posts: 26
Joined: Fri May 16, 2008 12:30 pm

Automatically Abort On Error

Post by tommystery » Fri Jun 06, 2008 2:08 pm

Hello again;

The good news is that I've gotten Macro Scheduler to do what I want it to do flawlessly now. {Meaning that I'll most likely be purchasing the software some time next week :P }

But I have one more concern. The windows which my script manages will sometimes disappear if they lose connection to the internet; the program automatically reconnects in 60s so this isn't a problem - or so I thought. Yet, if the script tries to run at this time it shows an error message because it is unable to find the window. Is there a way to disable these messages or set the script to auto abort and rerun at the next scheduled time?

Thanks.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Fri Jun 06, 2008 5:36 pm

Try setting IGNOREERRORS to 1. Does not apply to VBScript errors (use on error next etc for VBScript errors). Set back to 0 for default behaviour.

Code: Select all

let>IGNOREERRORS=1

tommystery
Junior Coder
Posts: 26
Joined: Fri May 16, 2008 12:30 pm

Post by tommystery » Fri Jun 06, 2008 7:26 pm

That's exactly what I wanted... well almost...

Is there a variable that will abort instead of ignore these errors?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sat Jun 07, 2008 1:24 am

Hi tommystery,

If you want the script to abort if your windows are not there (because your PC disconnected from the internet)... just have the script check for the presence of your window (or windows) and if they are not there... abort the script... or have the script wait for 60 seconds then try again.

By then if your PC has auto-reconnected to the internet and your windows are there... then the script should now work. If not, have the script wait another 60 seconds and try again. You could have it keep retrying every 60 seconds or add a loop that counts the failures and aborts the script for good after X tries... sounds an audible alarm, etc.

Let us know how you do and take care...
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

tommystery
Junior Coder
Posts: 26
Joined: Fri May 16, 2008 12:30 pm

Post by tommystery » Sat Jun 07, 2008 4:56 am

That is a viable solution; however there are a couple of windows which are called under different circumstances and it would require some reworking of loops within the script.

That's why I was wondering if there is a simple global variable I can set.

I guess there isn't though.

Thanks for all your help.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Sat Jun 07, 2008 10:39 am

You could run a 2nd script in the background that looks for the window with abort button and have it push push the abort button.

Code: Select all

Label>Error Window Loop
Wait>1
IfWindowOpen>ERROR_WINDOW_NAME*
PushButton>ERROR_WINDOW_NAME*,Abort
PushButton>ERROR_WINDOW_NAME*,&Abort
Goto>Exit
Endif
goto>Error Window Loop

Label>Exit
Or

Code: Select all

WaitWindowOpen>ERROR_WINDOW_NAME*
PushButton>ERROR_WINDOW_NAME*,Abort
PushButton>ERROR_WINDOW_NAME*,&Abort

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts