Followers 0

# Is Au3 Recorder has bug ?

## 7 posts in this topic

Hi fellas,

I used Au3 recorder to record an script for automation of an simple installer installation in windows OS.

Au3 script and that installer is placed in the same folder. but upon running the script, i made using au3 recorder. I'm getting this error.

OR
'>

HERE IS THE CODE GENERATED BY AU3 RECORDER

#region ---Au3Recorder generated code Start (v3.3.7.0)  ---

#region --- Internal functions Au3Recorder Start ---
Func _Au3RecordSetup()
Opt('WinWaitDelay',100)
Opt('WinDetectHiddenText',1)
Opt('MouseCoordMode',0)
EndFunc

Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,\$timeout)
EndFunc

AU3RecordSetup()
#endregion --- Internal functions Au3Recorder End ---

Run('E:\z_PERSONAL\AutoIT#\it.exe')
_WinWaitActivate("AutoIt v3.3.8.1 Setup","")
MouseClick("left",367,357,1)
_WinWaitActivate("AutoIt v3.3.8.1 Setup ","")
MouseClick("left",367,357,1)
_WinWaitActivate("AutoIt v3.3.8.1 Setup","")
MouseClick("left",308,362,1)
_WinWaitActivate("AutoIt v3.3.8.1 Setup ","")
MouseClick("left",308,362,1)
_WinWaitActivate("AutoIt v3.3.8.1 Setup","")
MouseClick("left",445,368,1)
MouseClick("left",260,139,1)
#endregion --- Au3Recorder generated code End ---

QUESTION - Well, Why its happening that when I use Au3 Recorder, I have to remove this code all the time in all scripts ? anyway, now after removing this line from the middle of the script generated by Au3 Recorder, My script move to next step.

AU3RecordSetup()

But here comes the irony. this script do not click on the installer windows buttons where its recorded and supposed to. instead, It do click on background and therefore, lost focus of installer screen. hence no automation.

P.S. - I cannot used keys, because the installer window do not detect any key inputs, but mouse only.

any workaround to this anyhow ?

##### Share on other sites

This: AU3RecordSetup() should be this: _AU3RecordSetup() in the script. It's a WELL documented bug that has been fixed since the last official release, it's also been asked about 100 times about it in the past couple of years so I'm surprised that you didn't find any mention of it when you searched for the problem on the forum.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

##### Share on other sites

#3 ·  Posted (edited)

This: AU3RecordSetup() should be this: _AU3RecordSetup() in the script. It's a WELL documented bug that has been fixed since the last official release, it's also been asked about 100 times about it in the past couple of years so I'm surprised that you didn't find any mention of it when you searched for the problem on the forum.

I appreciate your partial answer, and would like to bring this to your attention that I, indeed searched the forum for this query of mine and got the same answer, you posted above. but since I'm using the latest AutoIT tools release. I was just wondering as to why this error is present again.

Anyway, my main query lies on the latter part of this thread of mine, where au3 generated script is clicking out of installer window focus. although I already tried to use the set focus and _WinWaitActivate commands too, but still. this is going crazy.

Edited by incrediable

##### Share on other sites

I appreciate your partial answer, and would like to bring this to your attention that I, indeed searched the forum for this query of mine and got the same answer, you posted above. but since I'm using the latest AutoIT tools release. I was just wondering as to why this error is present again.

It isn't "present again".  It is, as BrewManNH stated, fixed "since the last official release".  So if you are running the latest official release, it is from before the fix.

Anyway, my main query lies on the latter part of my this thread, where au3 generated script is clicking out of installer window focus. although I used the set focus and _WinWaitActivate commands too, but still. this is going crazy.

The recorder is a very old tool that, in my opinion, is not so useful as it once may have been.  Your problem lies in the method the recorder uses.  It records absolute screen coordinates for mouse clicks.  If the setup window does not show up on the target machine within a small few pixels of where it originally was when you made your recording, the clicks will miss the buttons because they are now in a different location.

The better way to automate the setup would be to use the "AutoIt WIndow Info" tool to get the control names for the buttons you want to click on, or the text fields you want to fill in, then use ControlClick() and ControlSetText() to do the automation.

My UDFs

##### Share on other sites

It isn't "present again".  It is, as BrewManNH stated, fixed "since the last official release".  So if you are running the latest official release, it is from before the fix.

The recorder is a very old tool that, in my opinion, is not so useful as it once may have been.  Your problem lies in the method the recorder uses.  It records absolute screen coordinates for mouse clicks.  If the setup window does not show up on the target machine within a small few pixels of where it originally was when you made your recording, the clicks will miss the buttons because they are now in a different location.

The better way to automate the setup would be to use the "AutoIt WIndow Info" tool to get the control names for the buttons you want to click on, or the text fields you want to fill in, then use ControlClick() and ControlSetText() to do the automovemation.

Well in that case, I'm afraid, AutoIT isn't a right tool for me since I can't automate the installation with the help of keyboard inputs, because the installer I'm trying to automate is build using images in it. and does not detect "TAB" "ENTER" or alpha numeric as well as special characters key inputs. and only works through mouse clicks only to move to next installation step.

and since Au3 recorder has that functionality, that's why I was trying to use that. but now, I came to know, that Au3 recorder is become obsolute.

I just wish if someone could improve Au3 recorder functionalties and make it working again. Its really an great tool.

##### Share on other sites

What application are you trying to install?  There may be an easier way using the command line options.  Instead of automating the installer windows.

##### Share on other sites

Well in that case, I'm afraid, AutoIT isn't a right tool for me since I can't automate the installation with the help of keyboard inputs, because the installer I'm trying to automate is build using images in it. and does not detect "TAB" "ENTER" or alpha numeric as well as special characters key inputs. and only works through mouse clicks only to move to next installation step.

and since Au3 recorder has that functionality, that's why I was trying to use that. but now, I came to know, that Au3 recorder is become obsolute.

I just wish if someone could improve Au3 recorder functionalties and make it working again. Its really an great tool.

If the application you are automating does not use keyboard entries, then don't use them.  I never advised you to.  Since you did not tell us what application you are installing (based on the icon in the picture, I am assuming it is TeamViewer), I gave you commands for both mouse clicks (ControlClick) and for text fields (ControlSetText).  Read up on them in the help file.

If you only need mouse clicks, then use ControlClick, unless the program you are using does not use controls for the buttons, but most (including the last version of TeamViewer that I looked at) do.

If you still want to use the recorder, you will need to read up on WinMove so you can make sure that your window is in EXACTLY the same place it was when you recorded your script, and use it with each and every screen.

As AdamUL suggests, there may also be command line options to do what you want also.

The recorder will never be more than it is.  It has no way of knowing at record time what your human intentions are.  It only records mouse moves, mouse clicks, and keyboard input.  It will never figure out whether you were clicking somewhere to bring a window into focus, or clicking there to press a button.

The effort it would take creating that kind of intelligence into it is well beyond the returns it would yield.

I don't intend to sound harsh here.  It just is what it is.  I think you would be best served to read up on ControlClick in the help file, and look at some examples of its use here in the forums.

My UDFs