Jump to content

AutoIt doesn't recognize active window elements


Shaitan
 Share

Recommended Posts

hey there.

I'm running Windows 10 x64 and try to make a few software installation scripts but Im facing a few weird problem (at least to me).

For instance, when I try to run the following script absolutely nothing happens. I can only start the Notepad++ installer with a batch script and even after it starts, AutoIt runs the script and active the correct window. Nothing after that, the script simply quits like if there was nothing after that.

What am I doing wrong? I already tried to use CLASS, ControlClick, ControlSend and even MouseClick but nothing changes.

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

Run('Notepad\Notepad.cmd')
WinWait("[CLASS:#32770]","")
If Not WinActive("[CLASS:#32770]","") Then WinActivate("[CLASS:#32770]","")
WinWaitActive("[CLASS:#32770]","")
ControlSend("[CLASS:#32770]","", 1,"{ENTER}")
Link to comment
Share on other sites

  • Moderators

Don't worry about the controls and use the silent install option:

Global $gsDir = "C:\Users\Raphael\Desktop\Appz\Notepad"
Global $gsExe = "npp.6.7.4.Installer.exe"
RunWait('"' & $gsDir & "\" & $gsExe & '" \S', $gsDir)
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

 

Don't worry about the controls and use the silent install option:

Global $gsDir = "C:\Users\Raphael\Desktop\Appz\Notepad"
Global $gsExe = "npp.6.7.4.Installer.exe"
RunWait('"' & $gsDir & "\" & $gsExe & '" \S', $gsDir)

 

I would love to but I'm building a complete unattended Windows setup and there's some softwares without a silent switch :(

Link to comment
Share on other sites

  • Moderators

Well, you're having a specific problem with this application... So, the silent switch works.  I would use the silent switches for all programs that had them (keep your coding errors to a minimum).

Other than that... if this doesn't work, you'll have to look for a different solution:

Global $ghWnd = WinWait("[CLASS:#32770;TITLE:Installer Language]")
ControlFocus($ghWnd, "", "[CLASS:Button; INSTANCE:1]")
ControlClick($ghWnd, "", "[CLASS:Button; INSTANCE:1]")

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Shaitan, I replied to your last thread which you had a similar question...regarding windows with class:#32770.  Try what I said here:

Note, you'll need to change the "visible text" portion, the width and height to match the window, and you'll need the mouse click coords under the "Mouse" section if all fails.

Edited by jack71
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...