Jump to content

Interacting with applications


Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

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").

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.

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...