Sign in to follow this  
Followers 0
Shaitan

AutoIt doesn't recognize active window elements

10 posts in this topic

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}")

Share this post


Link to post
Share on other sites



its a Windows batch file I wrote to launch the Notepad++ installer

start /wait C:\Users\Raphael\Desktop\Appz\Notepad\npp.6.7.4.Installer
exit

Share this post


Link to post
Share on other sites

I just noticed this problem is somehow related with Class #32770

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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.

Share this post


Link to post
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 :(

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

This solution didnt work either... :(

Nevermind, I'll use the silent switch wherever I can

Thanks!

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

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