Jump to content

AutoIt and Python - Limited Functions


ryushi5
 Share

Recommended Posts

I'm using Python to call AutoIt functions, but some functions don't work. Is there a reason for this? If so, can I fix it?

from win32com.client import Dispatch
Auto = Dispatch("AutoItX3.Control")
def autoTest():
    print Auto.MsgBox('')

When I run it I get this error:

line 516, in __getattr__
    raise AttributeError("%s.%s" % (self._username_, attr))
AttributeError: AutoItX3.Control.MsgBox

It seems like it's reading 'MsgBox' as an attribute and not a function. Any thoughts?

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...
  • 1 year later...

Hello everyone, I'm new here and experiencing the same problem as Ryushi, using Python to call COM automating AutoIt

But even with these parameters,

from win32com.client import Dispatch
Auto = Dispatch("AutoItX3.Control")
def autoTest():
    print Auto.MsgBox( 0, "title", "text" )

I got that error

line 516, in __getattr__
    raise AttributeError("%s.%s" % (self._username_, attr))
AttributeError: AutoItX3.Control.MsgBox

Maybe i didn't understood something clearly,

Thank you for your help !

Link to comment
Share on other sites

  • 6 months later...
  • 7 years later...
  • Developers

Like your other post: What exactly do you want to ask? Be way more explicit than this and show the full source that demonstrates your issue.

Jos 

PS: for clarity: Have a look at the appropriate helpfile (AutoItX.chm) for the available functions in AutoItX!

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I don't really know why you are using autoit at all. There are TONS of native python libraries you can use for automation.

 

I use this with Python when needed.

https://pywinauto.readthedocs.io/en/latest/

 

and for native Python UIAutomation I recommend 

https://github.com/xcgspring/AXUI

Edited by Earthshine

My resources are limited. You must ask the right questions

 

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

×
×
  • Create New...