Page 1 of 1

Using AutoIt

Posted: 20 Nov 2010, 09:55
by admin
Maybe some of you know great program for automating tasks in Windows - AutoIt
This nice freeware tool is based on its own scripting language and it has really good control possibilities: windows management, process management, mouse & keyboard operations etc.
What is important for me is that it provides most of those possibilities wrapped in COM object called AutoitX.
And you guess right, this object can be easily used in HIDmacros scripts.

So you know that HIDMacros author is quite lazy and didn't provide for example GetMousePos method or GetWindowPos. And how can you then script your mouse clicks to specific autopilot window when this window can be moved on your screen?
Try using autoitX.

In routines:

Code: Select all

Dim oAutoIt
Set oAutoIt = CreateObject("AutoItX3.Control")
In macro code:

Code: Select all

x = oAutoIt.WinGetPosX("AP")
y = oAutoIt.WinGetPosY("AP")
HIDMacros.MouseClick x+20, y+50, 1
PS: If someone wants to write more sophisticated tutorial how to install & register AutoitX, please feel free. I'm just announcing the possibility.

Re: Using AutoIt

Posted: 21 Mar 2012, 10:16
by friedrich
Thank you for this information.

Anyhow before adding a new external program i will try to find a possibility to get the current x,y position when moving the external program on the screen. Maybe it is possible.

Meanwhile best regards,

Friedrich

Re: Using AutoIt

Posted: 27 Oct 2019, 13:46
by israelz74
Hi

Why am i getting "Activex could not be found" on compilation of the createobject in the routines?

Sorry if it is a beginner question. I double checked that a vbs with these commands can create the object autoitx3 and it does.

Thanks

Re: Using AutoIt

Posted: 28 Oct 2019, 17:53
by admin
No idea and don't use/have HidMacros any more. You can try to run as admin.