Sign in to follow this  
Followers 0
ryushi5

AutoIt and Python - Limited Functions

8 posts in this topic

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?

1 person likes this

Share this post


Link to post
Share on other sites



Nevermind, I simply did not research well enough. Please disregard. :mellow:

Share this post


Link to post
Share on other sites

but it is a very good idea Python call Autoit.

Share this post


Link to post
Share on other sites

Sooooo what was the problem?

Posted Image

Share this post


Link to post
Share on other sites

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 !

Share this post


Link to post
Share on other sites

Hello!

I face the same problem, when try to launch message box from Python:

autoIT.MsgBox(0, "Strange", "Hello!")

AttributeError: AutoItX3.Control.MsgBox

What is the solution?

Could you, please, provide it.

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  
Followers 0

  • Similar Content

    • dynamitemedia
      xmldom into array and then use outside function
      By dynamitemedia
      i have the following snippet...   now its working but i have it inside a function and want to be able to use   $aThumb[$i]  outside the function in the rest of the script, i tried return and keep getting this error  "Invalid keyword at the start of this line.:"  
      Global $iRows = UBound($a, $UBOUND_ROWS) Global $iCols = UBound($a, $UBOUND_COLUMNS) $oID = $oID + 1 $oURL = $oString.selectSingleNode("./url") $oName = $oString.selectSingleNode("./name") $oCategory = $oString.selectSingleNode("./category") $oThumb = $oString.selectSingleNode("./image") $oLanguage = $oString.selectSingleNode("./language") $aThumb = [$iRows] _ArrayAdd($aThumb, $oThumb.text) For $i = 1 To UBound($aThumb) - 1 ConsoleWrite($oID & @TAB & $aThumb[$i] & @CRLF) Next Next ConsoleWrite( "rows: " & $iRows & @CRLF) Thanks for your help
    • kcvinu
      How can i change the page background color in word
      By kcvinu
      Hi all,
      I am trying to change the background color of a page in word document. But i am getting error. This is my code.
      Local $owObj = ObjGet("","word.application") If @error Then ConsoleWrite("Obj Error " & @CRLF) Local $odoc = $owObj.ActiveDocument Local $colorArray = [136,151,109] ; Olive Green $odoc.Background.Fill.ForeColor.RGB = _ColorSetRGB($colorArray) $odoc.Background.Fill.Visible = True $odoc.Background.Fill.Solid() If @error Then ConsoleWrite("Error in Color change - " & @error & @CRLF) $owObj = 0 ExitAnd this is the error msg
      Error in Color change - -2147352571EDIT : I would like to know about using rgb colors in autoit. 
    • Quantumation
      How do you make UDF's?
      By Quantumation
      I'm new to scripting and Autoit, but i've already found some things that I would like to create. Where do you start when creating a UDF?
      For instance, if I wanted to make a UDF for Excel(I know one exists) Where would I start? What would I need to start researching?
      Any input would be appreciated
    • JohnOne
      Python total noob
      By JohnOne
      I fancy having a go at python.
      Looking for advice for what environment I need, good web resources etc...
      Ultimate goal is to create a kodi video addon.
    • timepp
      What's the next step after "QueryInterface"
      By timepp
      I already have a COM object. I want to query another interface and call method from that interface. I expect something like this:
      Local $pp $app.QueryInterface($tRIID_IServiceProvider, $pp) Bind($pp, $dtag_IServiceProvider) $pp.QueryService(...)in line 3, I want to bind a vtable to this variable (or something similar) but currently there seems no such mechanism.
      or something like this:
      Local $pp = QueryInterface($app, $tRIID_IServiceProvider, $dtag_IServiceProvider) $pp.QueryService(...)but no such thing either.
       
      The only workable solution I know is the following:
      Local $pp $app.QueryInterface($tRIID_IServiceProvider, $pp) Local $provider = ObjCreateInterface($pp, $sIID_IServiceProvider, $dtag_IServiceProvider) $provider.QueryService(...)but apparently there is a duplication for IID_IServiceProvider, which violates the DRY(don't repeat yourself) principle.
      Is there any other better solution?