Jump to content
Sign in to follow this  
Tidetracker

A newbie needs a kickstart

Recommended Posts

Tidetracker

Hi, I'm just beginning to learn AutoIt, and have managed to make it through the tutorials, but I'm very quickly stuck.

I'm trying to write a script to launch the Microsoft Bluetooth GUI and automate it's use, and I can't seem to either 1) figure out where to move the mouse to, or 2) reposition the window so that the mouse position will equal the screen position.

Here's the beginnings of my script:

AutoItSetOption("MouseCoordMode",0)

AutoItSetOption("PixelCoordMode",0)

RunWait(@COMSPEC & " /c Start bthprops.cpl")

WinMove("Bluetooth","",0,0)

MouseMove(50,380,30)

I figured that I could either get the MouseMove procedure to accept it's arguments as relative to the Bluetooth window, or, if not, at least I could move the window to screen position 0,0 so that the position of the buttons within the window would be easily defined. I'm using AutoIt v3 Window Info to determine the mouse positions.

When run this, the window doesn't move,and the mouse doesn't end up where I intended it to end up.

It doesn't seem as if either of the first two statements, where I'm selecting the options to make the mouse and/or pixel to be relative to the active window, are working... maybe I'm misundertanding them?

Can someone point out the error of my ways?

Thanks in advance!

Share this post


Link to post
Share on other sites
somdcomputerguy

Try this. Set both the CoordModes to 2, also use AutoItSetOption("WinTitleMatchMode", 2).


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
Tidetracker

That didn't help... but I realized that I wasn't waiting for the window to be 'active'. The aguments of the coord functions do need to be 0.

This script works:

AutoItSetOption("MouseCoordMode",0)

AutoItSetOption("PixelCoordMode",0)

AutoItSetOption("WinTitleMatchMode", 2)

RunWait(@COMSPEC & " /c Start bthprops.cpl")

WinWaitActive("Bluetooth")

WinMove("Bluetooth","",0,0)

MouseMove(60,380,30)

Anyhow, thanks for the help. Sometimes a little prodding is all that is needed! :mellow:

Share this post


Link to post
Share on other sites
somdcomputerguy

Alright, glad you got it!


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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.