caramen Posted October 8, 2018 Share Posted October 8, 2018 (edited) Hello guy, can you lead me on how to read the "Done!" Stat please thanks. My Actual code for this partion. ; Script Start - Add your code below here #include <Constants.au3> #include <Array.au3> #RequireAdmin ShellExecute ( "SslvpnClient.exe","","\\*******\********$\VPN\Client lourd Fortigate\sslvpnclient64" ) Sleep (500) If ProcessExists ( "SslvpnClient.exe" ) Then $cHNW1 = WinWait ( "FortiClient SSLVPN Installer" ) WinActivate ( $cHNW1 ) WinMove ( $cHNW1 , "" , 0 , 0 ) Endif $cUACDefaut = RegRead ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" , "ConsentPromptBehaviorAdmin" ) RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System","ConsentPromptBehaviorAdmin" , "REG_DWORD" , "0" ) ControlClick ( "FortiClient" , "" , "[CLASS:Button; INSTANCE:4]" , "left" , 1 );Run admin Sleep ( 10000 ) If WinExists ("FortiClient SSLVPN Installer") Then $cHNW2 = WinActivate ("FortiClient SSLVPN Installer") WinMove ( $cHNW2 , "" , 0 , 0 ) EndIf ControlClick ( $cHNW2 , "" , "[CLASS:Button; INSTANCE:1]" , "left" , 1 );Install $cPixel = "0" Sleep (1000) ;HERE IS DONE ;HERE IS DONE ;HERE IS DONE ;~ ControlClick ( $cHNW2 , "" , "[CLASS:Button; INSTANCE:2]" , "left" , 1 ) ;Close Edited October 8, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted October 8, 2018 Share Posted October 8, 2018 @caramen ControlGetHandle() to retrieve the handle of the ListBox; _GUICtrlListBox_GetCount() to retrieve the count of the items in the ListBox; _GUICtrlGetText() to get the text of the item ( looped in a For...Next...Step loop, using the value returned from _GUICtrlListBox_GetCount(). Cheers Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted October 8, 2018 Author Share Posted October 8, 2018 Trying this after my cigare**e My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
caramen Posted October 9, 2018 Author Share Posted October 9, 2018 (edited) @FrancescoDiMuro Tyou mate like always you leaded me correctly. But i got one or two questions... I reduced the snipet code. to : If WinExists ("FortiClient SSLVPN Installer") Then $cHNW2 = WinActivate ("FortiClient SSLVPN Installer") WinMove ( $cHNW2 , "" , 0 , 0 ) EndIf ;~ ControlClick ( $cHNW2 , "" , "[CLASS:Button; INSTANCE:1]" , "left" , 1 );Install $cControlIDForti = ControlGetHandle($cHNW2, "" , "[CLASS:ListBox; INSTANCE:1]") MsgBox (0,"",$cControlIDForti) $cControlIDFortiCount = _GUICtrlListBox_GetCount($cControlIDForti) MsgBox (0,"",$cControlIDFortiCount) $cFortiDoneStat= _GUICtrlGetText($cControlIDFortiCount) MsgBox (0,"",$cFortiDoneStat) With an existing finished windows of forti client. I can have my script work by checking until i have 54 counts and i ll be OK with that but i am questionning my mind on how to go further. MsgBox (0,"",$cControlIDFortiCount) Return 54 so i understand my value Done! is at the line 54 But how can i check that since $cFortiDoneStat= _GUICtrlGetText($cControlIDFortiCount) ;Return noting MsgBox (0,"",$cFortiDoneStat) $cFortiDoneStat= _GUICtrlGetText($cControlIDFortiCount[54]) ;Return noting MsgBox (0,"",$cFortiDoneStat) ;Unfortunatly i dont have the error checking console becose of #RequireAdmin and cant try without it. Edited October 9, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
caramen Posted October 9, 2018 Author Share Posted October 9, 2018 _GUICtrlGetTex ==> Unknown function name.: My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted October 9, 2018 Share Posted October 9, 2018 5 minutes ago, caramen said: _GUICtrlGetTex ==> Unknown function name.: The script is telling you that the function does not exist. Where did you define that function? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted October 9, 2018 Author Share Posted October 9, 2018 (edited) This is what i got actualy. I guess you was confused with _GUI_GetText and ControlGetText So i am trying... expandcollapse popup; Script Start - Add your code below here #include <Constants.au3> #include <Array.au3> #include <GuiListBox.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #RequireAdmin ;~ ShellExecute ( "SslvpnClient.exe","","\\******\******$\VPN\Client lourd Fortigate\sslvpnclient64" ) ;~ Sleep (500) ;~ If ProcessExists ( "SslvpnClient.exe" ) Then ;~ $cHNW1 = WinWait ( "FortiClient SSLVPN Installer" ) ;~ WinActivate ( $cHNW1 ) ;~ WinMove ( $cHNW1 , "" , 0 , 0 ) ;~ Endif ;~ $cUACDefaut = RegRead ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" , "ConsentPromptBehaviorAdmin" ) ;~ RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System","ConsentPromptBehaviorAdmin" , "REG_DWORD" , "0" ) ;~ ControlClick ( "FortiClient" , "" , "[CLASS:Button; INSTANCE:4]" , "left" , 1 );Run admin ;~ Sleep ( 10000 ) If WinExists ("FortiClient SSLVPN Installer") Then $cHNW2 = WinActivate ("FortiClient SSLVPN Installer") WinMove ( $cHNW2 , "" , 0 , 0 ) EndIf ;~ ControlClick ( $cHNW2 , "" , "[CLASS:Button; INSTANCE:1]" , "left" , 1 );Install $cControlIDForti = ControlGetHandle($cHNW2, "" , "[CLASS:ListBox; INSTANCE:1]") ; Return expected handle 0x000000000004043E $cControlIDFortiCount = _GUICtrlListBox_GetCount($cControlIDForti) ; Return 54 lines MsgBox (0,"",$cControlIDFortiCount); MsgBox : 54 ;$cFortiDoneStat = ControlGetText($cHNW2,"", $cControlIDForti[30] ) ;??????? HERE I AM STUCKING $cFortiDoneStat = ControlGetText($cHNW2,"", $cControlIDForti ) ;??????? HERE I AM STUCKING _ArrayDisplay ($cFortiDoneStat) MsgBox (0,"",$cFortiDoneStat) ; Return : "" ;~ ControlClick ( $cHNW2 , "" , "[CLASS:Button; INSTANCE:2]" , "left" , 1 ) ;Close Edited October 9, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted October 9, 2018 Share Posted October 9, 2018 (edited) @caramen Once you have the handle of the ListBox, why don't you use _GUICtrlListBox_GetText as I've already suggested to you? $cControlIDForti = ControlGetHandle($cHNW2, "" , "[CLASS:ListBox; INSTANCE:1]") MsgBox (0,"",$cControlIDForti) ; Handle of the ListBox $cControlIDFortiCount = _GUICtrlListBox_GetCount($cControlIDForti) ; Items count in the ListBox MsgBox (0,"",$cControlIDFortiCount) ; $cFortiDoneStat= _GUICtrlGetText($cControlIDFortiCount) ; _GUICtrlGetText, a function that you may dreamed? ; Taking a text from a number? What the ?! For $i = 1 To $ControlIDFortiCount ConsoleWrite("Item " & $i & " text is '" & _GUICtrlListBox_GetText($cControlIDForti, $i) & "'." & @CRLF) Next Try it and let us know. Edited October 9, 2018 by FrancescoDiMuro caramen 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted October 9, 2018 Author Share Posted October 9, 2018 (edited) Damn it i did not see that one ! haha since it s not in the post Edited October 9, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
caramen Posted October 9, 2018 Author Share Posted October 9, 2018 Working like a charm, solved! Thanks My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted October 9, 2018 Share Posted October 9, 2018 (edited) Happy to have helped And, always remember that the Help file, is, and will always be, the most complete source of information for coding with AutoIt Edited October 9, 2018 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted October 9, 2018 Author Share Posted October 9, 2018 I used it maybe 15 times for that thread My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
caramen Posted October 9, 2018 Author Share Posted October 9, 2018 I fall into a dark problem My reproducer is working... I copy past into my script it s not working anymore. I am not exiting that loop. For unknow reason. And as you can see i added array security to be sure... Do $cControlIDFortiCount = _GUICtrlListBox_GetCount($cControlIDForti) $cFortiDoneStat0 = _GUICtrlListBox_GetText($cControlIDForti, $cControlIDFortiCount) $cFortiDoneStat1 = _GUICtrlListBox_GetText($cControlIDForti, $cControlIDFortiCount-1) $cFortiDoneStat2 = _GUICtrlListBox_GetText($cControlIDForti, $cControlIDFortiCount-2) ;~ MsgBox (0,"",$cFortiDoneStat) Sleep (2500) Until $cFortiDoneStat0 = "Done!" Or $cFortiDoneStat1 = "Done!" Or $cFortiDoneStat2 = "Done!" My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted October 9, 2018 Share Posted October 9, 2018 @caramen Could you post, in a Spoiler tag if it is too long, the result you get reading ALL the items from your ListBox? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted October 9, 2018 Author Share Posted October 9, 2018 Na na it s ok ... The difficult thing is to dev without a console to say me what's going on. It was a include forget since i added your function sorry. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki 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