Jump to content
Sign in to follow this  
hkorchek

What if something happens?

Recommended Posts

hkorchek

Hello All-

I am new to using AutoIT and I have successfully created my first script to handle my first need. Currently, I am reading cells from an excel spreadsheet and entering that data into a 3rd party application traversing through its fields. I am wondering if there are ways to handle any unexpected events and how some of you may have gotten around them.

I do not see this happening very often, but what happens when a possible unexpected window pops up? This may throw off the script and give some undesirable results. If I have a process working in a certain order this could also completely destroy my input.

Have any of you ran into this problem trying to automate large tasks. One task will be entering new users into an application (about 100 of them) and the script is sensitive to where the cursor is (tabbing through each field)

Share this post


Link to post
Share on other sites
youknowwho4eva

A solution might be While Winactive("My Gui"). That way when the window isn't active the script stops. Play around with that. I usually use a few winactivates and winwaitactives to keep my scripts on course.


Giggity

Share this post


Link to post
Share on other sites
hkorchek

A solution might be While Winactive("My Gui"). That way when the window isn't active the script stops. Play around with that. I usually use a few winactivates and winwaitactives to keep my scripts on course.

The problem I may run into that some of the confirmation windows are windows within the application (does not show on the taskbar). I am not anticipating anything popping up, but I would like to try to work around them if they do occur.

Share this post


Link to post
Share on other sites
youknowwho4eva

The winactive commands don't depend on the taskbar


Giggity

Share this post


Link to post
Share on other sites
hkorchek

It does seem to be able to pick up child windows within an application. Any ways around this?

Share this post


Link to post
Share on other sites
youknowwho4eva

Winactivate("Notepad") will bring forward Notepad

Winactivate("Notepad","Text I have written in notepad") will bring up the instance of Notepad with that Text written in it.

Play around with it, look in the helpfile.


Giggity

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.