KillaB Posted April 9, 2020 Share Posted April 9, 2020 Hello, Please help me with a command to select "Date and time" option from the drop down menu below. i tried several commands from this forum, but none with success. Thanks in advance ! Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 9, 2020 Share Posted April 9, 2020 Hi @KillaB, and welcome to the AutoIt forums Could you please post the entire script you are using? 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...
KillaB Posted April 9, 2020 Author Share Posted April 9, 2020 Hello, thanks for your quick answer. Here's the partial script i wrote. If i would manage to select the option from the drop down menu, the rest of the script runs smooth (it fills the date now, but in different location because "Z reports" is selected), It also clicks the Set connection button as well. Link to comment Share on other sites More sharing options...
KillaB Posted April 9, 2020 Author Share Posted April 9, 2020 ; Start anaf_Download.exe Run("C:\Users\s009pos10\Desktop\anaf_Download.exe") ; Wait until the window with ANAF files - downloader title becomes active Local $hWnd = WinWaitActive("ANAF files - downloader","") ; Expand Range type, Search for Date and time and Select it ControlCommand($hWnd, "", "TNewComboBox1", "SelectString", "Date and time") ; Write From and to Send("01.03.2020") Send("{TAB}") Send("31.03.2020") Sleep(2000) ; Define members Local $clicked = 0 Local $buttonName = "Set connection" Local $timeout = 10 ; Wait recursively 5 seconds for active button For $i = 1 To $timeout Step 1 ; Check if the Set connection button is active If ControlCommand($hWnd, "", $buttonName, "IsEnabled", "") <> 0 Then ; Click the button and end the loop $clicked = ControlClick($hWnd, "", "[TEXT:" & $buttonName & "]") If $clicked = 1 Then ExitLoop EndIf EndIf Sleep(1000) Next Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 9, 2020 Share Posted April 9, 2020 @KillaB You could try to use ControlGetHandle() to get the handle of the ComboBox, and then use _GUICtrlComboBox_SetCurSel() to set the selected item in it. Try those and post the result. By the way, use the code tag <> to post the code, so it is correctly formatted 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...
KillaB Posted April 9, 2020 Author Share Posted April 9, 2020 I'm sorry, i am confused, it's my first time using commands, can you give me an example, please?Would be so kind of you Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 9, 2020 Share Posted April 9, 2020 @KillaB There you go: #include <GuiComboBoxEx.au3> ; This include is needed in order to use _GUICtrlComboBox* functions Global $hWnd, _ $hdlComboBox ; Start anaf_Download.exe Run("C:\Users\s009pos10\Desktop\anaf_Download.exe") ; Wait until the window with ANAF files - downloader title becomes active $hWnd = WinWaitActive("ANAF files - downloader","") ; Getting the Handle of the ComboBox control $hdlComboBox = ControlGetHandle($hWnd, "", "[CLASSNN:TNewComboBox1]") If IsHWnd($hdlComboBox) Then If _GUICtrlComboBox_SetCurSel($hdlComboBox, 0) <> -1 Then MsgBox(0, "", "Item selected!", 5) EndIf Study the sample 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...
KillaB Posted April 13, 2020 Author Share Posted April 13, 2020 I tried your solution but it doesn't work. i don't know what else to do...Thank you so much, anyway Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 13, 2020 Share Posted April 13, 2020 @KillaB Could you please post the entire code using the <> code tag here above? By the way, the MsgBox doesn't show up? 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...
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