SorryButImaNewbie Posted November 26, 2014 Share Posted November 26, 2014 (edited) Hi! I try to communicate with a QueryGrid, I'm not sure but I think the query is custom built. I can navigate with Send and other functions, but I would like to find a string or something (with I want to use to specify a Line and select it after) I don't use Send because there isn't the same number of elements in the query so it can't be used here. Also I'dont know what else should I post to help you helping me (which I'm very thankfull for) please ask anything and If I can i post it My codes I tried (not all, I modified these couple of times, trying to get it run) Thank you! Local $LineCount = ControlCommand('Folyószámla', "", "[CLASSNN:TAdvQueryGrid1]", "GetLineCount", "") MsgBox(0, "Zero", $LineCount) ;$LineCount = 0, while there are 2 lines) ;If ControlCommand('Folyószámla','','[CLASSNN:TAdvQueryGrid1]','FindString','AZBY') <> 0 Then ;ControlCommand('Folyószámla','','[CLASSNN:TAdvQueryGrid1]','GetSelected','AZBY') ;not working ;EndIf Edited November 26, 2014 by SorryButImaNewbie Link to comment Share on other sites More sharing options...
water Posted November 26, 2014 Share Posted November 26, 2014 To check if the ControlCommand has run successfully you should check the value of @error. According to the help file "In case of an error (such as an invalid command or window/control), @error=1" My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 26, 2014 Author Share Posted November 26, 2014 Hi water! MsgBox(0, "Zero", @error) showed 0 in the message, shouldn't I specify to check ControlCommandError? Link to comment Share on other sites More sharing options...
water Posted November 26, 2014 Share Posted November 26, 2014 The last executed function sets @error and @extended. So it is fine as long as the MsgBox statement immediately follows the ControlCommand My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 26, 2014 Author Share Posted November 26, 2014 (edited) I dont think its a problem if there is a variable like this Local $LineCount = ControlCommand('Folyószámla', "", "[CLASSNN:TAdvQueryGrid1]", "GetLineCount", "") MsgBox(0, "Zero", @error) So this means, there is no error message from ControlCommand? Yet it does exactly noting Is there anydifferenc between "GetLineCount" and 'GetLineCount' ? or between " " and ' ' in general? Edited November 26, 2014 by SorryButImaNewbie Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 26, 2014 Author Share Posted November 26, 2014 I thought these Pictures can help 1. is a picture from the grid, 2. is the Window Info data bout the control Link to comment Share on other sites More sharing options...
water Posted November 26, 2014 Share Posted November 26, 2014 No. ' and " are valid string delimiters. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 26, 2014 Author Share Posted November 26, 2014 Tried with WinSelectMenuItem, got 0 for error message, menu is not found. Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 26, 2014 Author Share Posted November 26, 2014 Now I'm trying to do the same thing with another control (taking an alternate approach) It's a ListView , tried with WinMenuSelectItem ,ControlListView ,ControlCommand. None of them worked. (same code with different windowhandle and classNN) Is there any other Command I should try? Link to comment Share on other sites More sharing options...
water Posted November 26, 2014 Share Posted November 26, 2014 I didn't find anything on the web so I'm not sure you can automate this controls. AutoIt is focused on Windows controls. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 26, 2014 Author Share Posted November 26, 2014 So if the guys who made this program, played around a bit in the listview/querygrid I wont be able to automate it? Unless I somehow make it, that my script find the "picture" of what I'm looking for then do clicks with coordinates? (at least the window always popup the same place so theoraticly it can be done,I read somewhere in the forum that autoit can find pictures in the monitor so its possible right?) Link to comment Share on other sites More sharing options...
water Posted November 26, 2014 Share Posted November 26, 2014 AutoIt seems to find the Control, hence @error = 0. But if the control does not handle the "GetLineCount" command then you are out of luck My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 26, 2014 Author Share Posted November 26, 2014 Can't I just somehow search and click for a specific string on the window? (guess not if control doesnn't handle the GetLineCount why would it handle anything else) Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 26, 2014 Author Share Posted November 26, 2014 (edited) Good news everyone! After some other matters I had to take care of, I tried to prove your assumption, I selected an item in the "Ügyfél" window and run the following code Test() Func Test() WinActivate("Ügyfél") ;WinMenuSelectItem("Ügyfél","","AZBY","AZBY") ControlListView("Ügyfél","","[CLASSNN:TListView1]","SelectClear","") ;Local $LineCount = ControlCommand('Ügyfél', "", "[CLASSNN:TListView1]", "GetLineCount", "") ;MsgBox(0, "Zero", $LineCount) ;ControlGetFocus EndFunc It deselected the item, it means the Listview should be able to handle the AutoIt commands right? (Edited for some grammatic error, as usual) Edited November 26, 2014 by SorryButImaNewbie Link to comment Share on other sites More sharing options...
water Posted November 26, 2014 Share Posted November 26, 2014 Does the GetItemCount command work and return a valid result? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 27, 2014 Author Share Posted November 27, 2014 Hi! (sorry when i read your response, i wasn't in the office anymore, so couldn't test it) Local $ItemCount = ControlListView("Ügyfél","","[CLASSNN:TListView1]","GetItemCount","") MsgBox (0, "ItemCount", $ItemCount) Returns 2 (in a list with 2 items) so I think the list is reachable by ControlListView. (ControlCommand with getlinecount returns 0 in the same list, so I'm going to ditch that for this function) I had a few idea what to do if I reach and can get the itemcount of the list, but i need my coffee to remember any of that. Good morning everyone Link to comment Share on other sites More sharing options...
water Posted November 27, 2014 Share Posted November 27, 2014 Sounds good If you have further questions we will be happy to assist. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 27, 2014 Author Share Posted November 27, 2014 (edited) How can I invoke a Subitem (column) with listview? I tried to give it numbers, and the name of the column with string. The help file says "FindItem", "string to find" [, SubItem] do I really need to place the [] open before the coma? It gave a syntax error, tried with simple "" and other variatons of [] and combinations with "". Forum search give threads about GUI building, near nothing about working on other forms. (I try to find my new list item, by its ID, first row and its a number, but not sure about its data type) (edit) Most of my tries resulted in either error or MsgBox not popint up Full code is: Test() Func Test() WinActivate("Folyószámla") $index = ControlListView("Folyószámla", "","[CLASSNN:TAdvQueryGrid1]","FindItem", "255836926"[0]) MsgBox(0, "ItemCount", $index) EndFunc (/edit) PS.: (data type = string double etc. )Sorry I realize that many time i use incorrect offical terminology, i was always bad at that, hope that I'm still understandable most of the time Edited November 27, 2014 by SorryButImaNewbie Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 27, 2014 Author Share Posted November 27, 2014 I'm stupid... In the new window where i try to work its not a list but a querygrid (just tested ItemCount again + AU3Info)... I will work around that, but still don't know how to invoke SubItem Sorry 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