Jump to content

Mouseclick Commands


Recommended Posts

I am struggling to learn this language. I intend to use it to automate some rather tedious mouse-driven tasks. Are there some programming steps that I should take to insure that the MouseClick commands are as universal as possible? I don't want to require that everybody who uses my results will have first to become proficient in this language. Is there a simple way to set everything to a uniform scale, or to calibrate positions automatically?

Arthur Jay

Link to comment
Share on other sites

That's a pretty broad question, so I have no idea what you're interacting with, or your intentions, so I can really only suggest one or maybe two things.

Try using Au3Info.exe to check out the application (or whatever it is you're working with) to see if it has any controls, or anything else that may be acted upon directly. If so, you're going to want to look at Control* commands in the helpfile. They're much more direct, because they don't actually use the mouse, but do the same actions that the mouse would do.

The second tip would be to post more details. Include any code you've written, the name of the program, maybe a screenshot if it's an obscure program, and any details from Au3Info.exe.

As for actual MouseClicks, they're fairly unreliable... so finding another method would be much better.

Link to comment
Share on other sites

That's a pretty broad question, so I have no idea what you're interacting with, or your intentions, so I can really only suggest one or maybe two things.

Try using Au3Info.exe to check out the application (or whatever it is you're working with) to see if it has any controls, or anything else that may be acted upon directly. If so, you're going to want to look at Control* commands in the helpfile. They're much more direct, because they don't actually use the mouse, but do the same actions that the mouse would do.

The second tip would be to post more details. Include any code you've written, the name of the program, maybe a screenshot if it's an obscure program, and any details from Au3Info.exe.

As for actual MouseClicks, they're fairly unreliable... so finding another method would be much better.

My primary object is to download some student data from an environment called WebCT, and then to process the data in Excel. The programs I have written so far are quite simple, consisting almost entirely of clicks on tabs or buttons. My concern is that if I give this program to other teachers with a different screen set-up, nothing much will happen. I need to look into the Control issue you brought up. I'll get back to you after I do.

Arthur Jay

Link to comment
Share on other sites

My primary object is to download some student data from an environment called WebCT, and then to process the data in Excel. The programs I have written so far are quite simple, consisting almost entirely of clicks on tabs or buttons. My concern is that if I give this program to other teachers with a different screen set-up, nothing much will happen. I need to look into the Control issue you brought up. I'll get back to you after I do.

Arthur Jay

I tried a few things - tell me if I'm on the right track. I loaded au3info and then got onto the webpage I will be working on. When the mouse was on a box, a Contol ID appeared in the Autoit box. So I can access this box by invoking that number? Learning how to do that will be my next step.

I am attaching a screen shot of the entry page for the instructor I am working with. Notice the little News icons on the first and third course. These appear when the instructor has mail, and so lower the position of the desired course if it is not first on the list. The mouse is on the third one for this shot. The control ID in the Autoit message box does not have a value at this point, but the required string is in item 1 of the Status Bar Test. So I could write a do loop that starts at the highest possible location , indexes down until that string is right, and then clicks the mouse. OK?

Thanks for the help. This little program could be very powerful. or dangerous

Arthur Jay

WebCTAutoit.doc

Link to comment
Share on other sites

I tried a few things - tell me if I'm on the right track. I loaded au3info and then got onto the webpage I will be working on. When the mouse was on a box, a Contol ID appeared in the Autoit box. So I can access this box by invoking that number? Learning how to do that will be my next step.

I am attaching a screen shot of the entry page for the instructor I am working with. Notice the little News icons on the first and third course. These appear when the instructor has mail, and so lower the position of the desired course if it is not first on the list. The mouse is on the third one for this shot. The control ID in the Autoit message box does not have a value at this point, but the required string is in item 1 of the Status Bar Test. So I could write a do loop that starts at the highest possible location , indexes down until that string is right, and then clicks the mouse. OK?

Thanks for the help. This little program could be very powerful. or dangerous

Arthur Jay

I worked a little more. I haven't yet mastered the art of directly opening the site where this program will be used, so I did it manually and then minimized it. The MouseClick command maximizes it. The first operation is to go to a button called Control Panel. I've written a little If statement that will be used eventually to home in on the button. If the text in the Status bar is not right. I will spiral out until it is. For now, I just tried to load a string variable with the text in the first position. I had the info box open while it was executing, and the appropriate text was there. However, my string was blank.

Here is my program:

MouseClick( "left", 190, 580)

Sleep(2000)

MouseMove(70, 170)

Sleep(2000)

Global $string1

$string1 = StatusbarGetText("Status Bar Text, item 1")

If $string1 = "Control Panel" Then

MouseMove(100, 100)

Else

MouseMove(500, 100)

Endif

MsgBox(0,"String1 contents",$string1)

Where did I go wrong?

Arthur Jay

Link to comment
Share on other sites

So is the whole automation process online? If so, you're definitely a candidate for IE.au3 (Internet Explorer Automation Library). You can find it here:

http://www.autoitscript.com/forum/index.php?showtopic=13398

Greenmachine

I am trying to develop an enhanced teaching module that can be used in a convetional classroom delivery as well as an Internet course. Short-term, it will use WebCT, which is a commercial product. To me, this product does not have enough reporting automatic features to do an effective job. My current module is being used right now, but with mixed results.

My short-term goal is to write programs that will help the over-worked instructors to do a better job of showing today's confused students how to better use their time. I would like to be able to launch my module, download student data, process this data in Excel, and upload results back to the website. The module can be used to inform the students of the results. This process goes well beyond the bounds of the conventional options available to the instructor.

I can do all of these things manually, but the tasks are much too tedious and tricky to expect other instructors to buy into the process. I would like to write programs that do this work automatically. At the same time, I will provide these programs to IT experts who may be willing to develop a more refined platform. I have specifics in mind, but conveying these ideas in code for an existing system seems to work best with such individuals to trigger better approaches.

Hope this answers your question, and that it is not too over-whelming.

Arthur Jay

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