trof Posted July 31, 2016 Author Share Posted July 31, 2016 That's Button2. The script is blocked as I said previously. No console message Link to comment Share on other sites More sharing options...
kcvinu Posted July 31, 2016 Share Posted July 31, 2016 Can you post your code ? Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only) Link to comment Share on other sites More sharing options...
trof Posted July 31, 2016 Author Share Posted July 31, 2016 I use only one executable to test the script expandcollapse popup#RequireAdmin $sUserName = @UserName Local $aArray[1] $aArray[0] = "Brush.exe" For $vElement In $aArray Run($vElement) WinWait("Seleziona la lingua dell'installazione") WinActivate("Seleziona la lingua dell'installazione") ControlClick("Seleziona la lingua dell'installazione", "", "Button1") WinWait("Installazione di CyberLink", "InstallShield Wizard per CyberLink", 10) Local $sTitle = WinGetTitle("[ACTIVE]") if "Installazione di in corso ..." = $sTitle then WinWait("Installazione di in corso", "InstallShield Wizard per CyberLink") WinActivate("Installazione di in corso", "InstallShield Wizard per CyberLink") ControlClick("Installazione di in corso", "", "Button1") WinWaitActive("Installazione di in corso", "Contratto di Licenza per l'Utente") ControlClick("Installazione di in corso", "", "Button2") Sleep(2000) Local $sText = WinGetText("[ACTIVE]") Local $aSplit = StringSplit($sText, '\n') For $i = 1 To $aSplit[0] if $aSplit[$i] = "Informazioni sul cliente" then If WinActivate("Installazione di in corso", "Informazioni sul cliente") Then ControlClick("Installazione di in corso", "", "Button2") Else ConsoleWrite("The window is not activated") Endif WinWaitActive("Installazione di in corso", "Cartella di destinazione") ControlClick("Installazione di in corso", "", "Button1") WinWaitActive("Installazione di in corso", "L'installazione aggiungerà le icone dei programmi") ControlClick("Installazione di in corso", "", "Button2") WinWaitActive("Installazione di in corso", "Il Setup ha completato l'installazione CyberLink") ControlClick("Installazione di in corso", "", "Button4") else WinWaitActive("Installazione di in corso", "Cartella di destinazione") ControlClick("Installazione di in corso", "", "Button1") WinWaitActive("Installazione di in corso", "L'installazione aggiungerà le icone dei programmi") ControlClick("Installazione di in corso", "", "Button2") WinWaitActive("Installazione di in corso", "Il Setup ha completato l'installazione CyberLink") ControlClick("Installazione di in corso", "", "Button4") EndIf Next Else WinWait("Installazione di CyberLink", "InstallShield Wizard per CyberLink") WinActivate("Installazione di CyberLink", "InstallShield Wizard per CyberLink") ControlClick("Installazione di CyberLink", "", "Button1") WinWaitActive("Installazione di CyberLink", "Contratto di Licenza per l'Utente") ControlClick("Installazione di CyberLink", "", "Button2") Sleep(2000) Local $sText = WinGetText("[ACTIVE]") Local $aSplit = StringSplit($sText, '\n') For $i = 1 To $aSplit[0] if $aSplit[$i] = "Informazioni sul cliente" then If WinActivate("Installazione di CyberLink", "Informazioni sul cliente") Then ControlClick("Installazione di CyberLink", "", "Button2") Else ConsoleWrite("The window is not activated") Endif WinWaitActive("Installazione di CyberLink", "Cartella di destinazione") ControlClick("Installazione di CyberLink", "", "Button1") WinWaitActive("Installazione di CyberLink", "L'installazione aggiungerà le icone dei programmi") ControlClick("Installazione di CyberLink", "", "Button2") WinWaitActive("Installazione di CyberLink", "Il Setup ha completato l'installazione CyberLink") ControlClick("Installazione di CyberLink", "", "Button4") else WinWaitActive("Installazione di CyberLink", "Cartella di destinazione") ControlClick("Installazione di CyberLink", "", "Button1") WinWaitActive("Installazione di CyberLink", "L'installazione aggiungerà le icone dei programmi") ControlClick("Installazione di CyberLink", "", "Button2") WinWaitActive("Installazione di CyberLink", "Il Setup ha completato l'installazione CyberLink") ControlClick("Installazione di CyberLink", "", "Button4") EndIf Next EndIf Next Link to comment Share on other sites More sharing options...
junkew Posted July 31, 2016 Share Posted July 31, 2016 Is au3inf or simplespy giving you highlights of the recognized windows and elements. That will proof if your elements are identifiable. See more in faq 31 of frequently asked questions. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
trof Posted July 31, 2016 Author Share Posted July 31, 2016 (edited) I installed the executable brush.exe (PowerDirector title template) with an autoit script but to do so I removed Local $sText = WinGetText("[ACTIVE]") Local $aSplit = StringSplit($sText, '\n') For $i = 1 To $aSplit[0] if $aSplit[$i] = "Informazioni sul cliente" then function. So, imho, the elements are correctly recognized Edited July 31, 2016 by trof Link to comment Share on other sites More sharing options...
JohnOne Posted July 31, 2016 Share Posted July 31, 2016 5 hours ago, trof said: Nothing Then the line... if $aSplit[$i] = "Informazioni sul cliente" then ...will never be reached, because $aSplit[0] == "" Back to the drawing board and investigate what WinGetText is actually returning. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
kcvinu Posted July 31, 2016 Share Posted July 31, 2016 trof, did you tried with @CRLF instead of "\n" ? Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only) Link to comment Share on other sites More sharing options...
trof Posted July 31, 2016 Author Share Posted July 31, 2016 2 hours ago, kcvinu said: trof, did you tried with @CRLF instead of "\n" ? Yes, I did. Nothing changes Link to comment Share on other sites More sharing options...
kcvinu Posted July 31, 2016 Share Posted July 31, 2016 Are you sure that your array $aSplit is populated properly ?. Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only) Link to comment Share on other sites More sharing options...
trof Posted July 31, 2016 Author Share Posted July 31, 2016 No I'm not. I tried another function taken from autoit help Local $sText = WinGetText("[ACTIVE]") Local $aArray = StringSplit($sText, @CRLF) For $i = 1 To $aArray[0] ; Loop through the array returned by StringSplit to display the individual values. MsgBox($MB_SYSTEMMODAL, "", "$aArray[" & $i & "] - " & $aArray[$i]) The array is blank. Here the result Link to comment Share on other sites More sharing options...
kcvinu Posted July 31, 2016 Share Posted July 31, 2016 If you are not sure then you need to check that. Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only) Link to comment Share on other sites More sharing options...
trof Posted July 31, 2016 Author Share Posted July 31, 2016 I tried this simple script to investigate the array output #RequireAdmin #include <MsgBoxConstants.au3> #include <StringConstants.au3> Example() Func Example() Run("Brush.exe") Sleep(3000) Local $sText = WinGetText("[ACTIVE]") Local $aArray = StringSplit($sText, @CRLF) For $i = 1 To $aArray[0] ; Loop through the array returned by StringSplit to display the individual values. MsgBox($MB_SYSTEMMODAL, "", "$aArray[" & $i & "] - " & $aArray[$i]) Next EndFunc ;==>Example The result is multiple instances of popup. Every time I click OK it appears another popup until are showed all the phrases of Visible Text. Is there a way to show all phrases of the Visible Text in a single popup? Link to comment Share on other sites More sharing options...
kcvinu Posted July 31, 2016 Share Posted July 31, 2016 Try this if it is a testing purpose #RequireAdmin #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <Array.au3> Example() Func Example() Run("Brush.exe") Sleep(3000) Local $sText = WinGetText("[ACTIVE]") Local $aArray = StringSplit($sText, @CRLF) _ArrayDisplay($aArray) EndFunc ;==>Example Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only) Link to comment Share on other sites More sharing options...
trof Posted July 31, 2016 Author Share Posted July 31, 2016 Your output is I tried this in my script (not the test one) Local $sText = WinGetText("[ACTIVE]") Local $aArray = StringSplit($sText, @CRLF, $STR_ENTIRESPLIT) For $i = 1 To $aArray[0] ; Loop through the array returned by StringSplit to display the individual values. MsgBox($MB_SYSTEMMODAL, "", "$aArray[" & $i & "] - " & $aArray[$i] and the output is when I write Local $sText = WinGetText("[ACTIVE]") Local $aArray = StringSplit($sText, @CRLF) For $i = 1 To $aArray[0] ; Loop through the array returned by StringSplit to display the individual values. MsgBox($MB_SYSTEMMODAL, "", "$aArray[" & $i & "] - " & $aArray[$i] the output is one only popup It should be a popup for every phrase of the Visible Test, as it happened in my test script. Maybe this is the issue Link to comment Share on other sites More sharing options...
JohnOne Posted July 31, 2016 Share Posted July 31, 2016 Try just @CR or @LF AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
trof Posted July 31, 2016 Author Share Posted July 31, 2016 (edited) @LF output is only one popup @CR output is Edited July 31, 2016 by trof Link to comment Share on other sites More sharing options...
kcvinu Posted July 31, 2016 Share Posted July 31, 2016 As per the code you should get atleast 10 msgboxs. Just check what is the ubound of that array right after StringSplit statement. Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only) Link to comment Share on other sites More sharing options...
JohnOne Posted July 31, 2016 Share Posted July 31, 2016 17 minutes ago, kcvinu said: As per the code you should get atleast 10 msgboxs. Just check what is the ubound of that array right after StringSplit statement. Not if only one @cr is present. Try... StringSplit($sText, Chr(11)) ; vertical tab AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
trof Posted July 31, 2016 Author Share Posted July 31, 2016 I tried to get array dimensions with this Local $sText = WinGetText("[ACTIVE]") Local $aArray = StringSplit($sText, @CRLF) For $i = 1 To $aArray[0] ; Loop through the array returned by StringSplit to display the individual values. UBound($aArray, $UBOUND_DIMENSIONS) MsgBox($MB_SYSTEMMODAL, "", "$aArray[" & $i & "] - " & $aArray[$i]) but the script closes himself without show any output. I also tried many other combinations with no luck Link to comment Share on other sites More sharing options...
kcvinu Posted July 31, 2016 Share Posted July 31, 2016 (edited) trof, Wrong, not inside the loop. Right after the string split and above the for loop. And Ubound($aArray) is enough Edited July 31, 2016 by kcvinu Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now