Sign in to follow this  
Followers 0
mark76

Interacting with applications

4 posts in this topic

Hi,

Im new to Auto It .

I've written a couple of simple programs to interact with some third party windows software.

My program opens the software waits for the window to become active, moves the mouse over a few buttons with in the application and presses them.

When the buttons are pressed the application has to go out across a network and connect to a server. This process takes a variable amount of time. To make the script work I have just stuck a couple of long sleep statements in there. The problem with this is that if the network was ever really really slow the program would fail.

Is there a better way of doing this ?

When the application is finished loading it comes back with a message window and an ok button but this all happens within the applications main window. In otherwords its not windows xp pop window like you see in word excel and IE.

1) Rather that moving the mouse to a fixed set of cordinates X,Y and hoping theres a button there to press is it possible to just say go to the button labled "Foooo" in window "barrr" and press it.

2) Is there a better way of figuring out when an application has finished doing something rather that just using a time delay and hoping.

Thanks,

Mark.

Share this post


Link to post
Share on other sites



Hi,

Im new to Auto It .

I've written a couple of simple programs to interact with some third party windows software.

My program opens the software waits for the window to become active, moves the mouse over a few buttons with in the application and presses them.

When the buttons are pressed the application has to go out across a network and connect to a server. This process takes a variable amount of time. To make the script work I have just stuck a couple of long sleep statements in there. The problem with this is that if the network was ever really really slow the program would fail.

Is there a better way of doing this ?

When the application is finished loading it comes back with a message window and an ok button but this all happens within the applications main window. In otherwords its not windows xp pop window like you see in word excel and IE.

1) Rather that moving the mouse to a fixed set of cordinates X,Y and hoping theres a button there to press is it possible to just say go to the button labled "Foooo" in window "barrr" and press it.

2) Is there a better way of figuring out when an application has finished doing something rather that just using a time delay and hoping.

Thanks,

Mark.

Using the AutoIt Window Info Tool, you could take a look at ControlClick() and ControlCommand() ("IsVisible").

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

WinWaitActive?

Share this post


Link to post
Share on other sites

moves the mouse over a few buttons with in the application and presses them.

You could also make the button presses happen using ControlClick:

ControlClick ( "title", "text", controlID [, button][, clicks]] )

Again, as SmOke_N points out, you will need the "AutoIT Window Info Tool" to determine button numbers, control id's, visible text values, etc.

To make full use of these tools, you must read the help files, especially the examples and the links to related functions. AutoIT is very rich and without studying it, you miss the important fine points. Enjoy!


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

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  
Followers 0