1

I am new to using AutoIt, and I am trying to use it to automatically click buttons on Windows programs. I have been able to access some functions using import win32com.client and win32com.client.Dispatch("AutoItX3.Control").

But I am wondering if anyone knows of another way of doing this without downloading something else. The thing is, I had to download Pywin32 to do this. Is there something within the native Python libraries that can use AutoIt or its COMs module to run the functions?

1 Answer 1

1

Probably, you can use ctypes. For example, follow code sends message Hello to active window:

from ctypes import windll
path = r"C:\Program Files\AutoIt3\AutoItX\AutoItX3.dll"
autoit = windll.LoadLibrary(path)
autoit.AU3_Send(u"Hello{!}", 0)

Also, you can run autoit scripts by using os.system or subprocess.call modules. With os.system:

import os
os.system(r'lowerchange.au3')

With subprocess.call:

import subprocess
subprocess.call(['C:\Program Files\AutoIt3\AutoIt3.exe',r'lowerchange.au3'])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.