Jump to content

SorryButImaNewbie

Active Members
  • Posts

    551
  • Joined

  • Last visited

  • Days Won

    1

SorryButImaNewbie last won the day on January 16 2015

SorryButImaNewbie had the most liked content!

Recent Profile Visitors

496 profile views

SorryButImaNewbie's Achievements

  1. Thank you Master LarsJ, I have that very thread open in my browser and to be honest its the source of like 75-85% of my work Inspect (and SimpleSpy) was able to detect every control I will need for the automatization. The only bump is that two pretty important control can't be detected, but the text on them can, so I plan to click on the text, which should translate to a click on the button, right? (since the textbox is on the button or the pic is on the button) Unfourtunetly, Inspect treeview isnt giving back as a straight forward "clean" view as with the Intel Example and I'm not that experienced (let say this is my second day of using it) with them. Edit: I post a few pic with the Inspect results momentarly Edit2: Attaching the returned values of Inspect x64 on an icon of the target software (sorry for the redout, but I have to follow regulations, I think its still usefull) This is what I get back
  2. Yes, it was my first try, It only saw the main window, nothing else, no control, text, or pictures Edit: Then I tried SimpleSpy and Inspector, they seems to find all the relevant controls but I can't act upon their information yet (I don't know the handle or ID or something that I can use, maybe text alone, but that could be problematic). Thats my goal right now, make a click command on a control without mouseclick by found coordinates or handle or title or something. It seems a few button can't be found by Inspector/SimpleSpy (fleshy design I guess), but lucky for me these buttons have text or text and pic on them, which can be found, so I think i will be able to click on them in the future.
  3. I would like to get the controls handels or IDs or something, but so far the controlClick seems not to work, or maybe the coordinates of them, so I can move the mouse there to click on them. Not with predefined coordinates, but the script would find it on its own,
  4. Its a software my new company is developing, I try to make an automatic tester program, I'm now able to write code that click on the given coordinates where the controls should be (maxsizeing the window before), so I can technicly make it happen, but I would like to write one that finds the controls in the given window, for A) code don't needs to know coordinates of controls beforhand and B ) I would like to better myself in automatization with AutoIT brb trying your proposed code changes with highlights Edit: it highlights the softwarewindow and an additional control (language change options) and I think the windows startmenu? trying to look at them with SimpleSpy soon Edit2: Ohh it should highlight an icon on a button btw at least the code I copied from simplespy was highlighted an icon
  5. Thank you, I added the UIAWrappers.au3 already with no problems. I'm reading junkew post about how to use it. Its a bit hard but not impossible to follow. I try to get somehandels on the controls the program is using with SimpleSpy or Inspectx64 version, but so far not so good. once _UIA_setVar has set itslef to oP1,2 etc, shouldn't the above code _UIA_Action part do some given action? (I tried with click, but nothing so far) Thank you for your help! (code is from SimpleSpy) #include <UIAWrappers.au3> #include <EditConstants.au3> #include <AutoItConstants.au3> #include <GUIConstantsEx.au3> #include <CUIAutomation2.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPI.au3> #include <Misc.au3> #AutoIt3Wrapper_UseX64 Opt("TrayIconDebug", 1) Opt("MustDeclareVars", 1) consolewrite("*** Some important settings you can find in " & @scriptdir & "\UIA.CFG ***" & @CRLF) consolewrite("*** " & _UIA_getVersionInfoString() ) consolewrite("*** If logging is turned on you can find it here :" & _UIA_getVar("logFileName") & @CRLF) _UIA_setVar("oP1","Title:=Program;controltype:=UIA_WindowControlTypeId;class:=Window") ;Program _UIA_setVar("oP2","Title:=;controltype:=UIA_CustomControlTypeId;class:=MainView") ; _UIA_setVar("oP3","Title:=;controltype:=UIA_CustomControlTypeId;class:=TileNavigationView") ; ;~ $oUIElement=_UIA_getObjectByFindAll(".mainwindow", "title:=;ControlType:=UIA_ImageControlTypeId", $treescope_subtree) _UIA_setVar("oUIElement","Title:=;controltype:=UIA_ImageControlTypeId;class:=Image") ;ControlType:=UIA_ImageControlTypeId;classname:=Image") ;~ Actions split away from logical/technical definition above can come from configfiles ;~_UIA_Action("oP1","highlight") _UIA_Action("oP1","click") ;setfocus ;~_UIA_Action("oP2","highlight") _UIA_Action("oP2","click") ;setfocus ;~_UIA_Action("oP3","highlight") _UIA_Action("oP3","click") ;setfocus ;~_UIA_action($oUIElement","highlight") ;~_UIA_action($oUIElement,"click") ;~_UIA_action("oUIElement","highlight") ;~_UIA_action("oUIElement","click")
  6. ohhh.....Ohh... ohhh.... No I only added CUIAutomation2 so far
  7. Hello, I try to add a new UDF to my AutoIT library, and it seems I fail. I started to work following the insturctions found on the wiki . I made an extra folder just next to my AutoIT folder, called ExtraUDF, and copied the file CUIAutomation2.au3 in it (I try to use this UDF for automating a program) then I run sciteconfig, set this folder up as User Include Folder, applied the changes, then run the calltip manager and got a msg when I tried to parse it. I attach a few pictures for better present the problem. I think I miss something here, should i put anything else on the ExtraUDF folder? I dont think that the CallTip manager added the udf to scite, If I try to run it i get a msg saying that I Scite cant open the include file and naturally after that, It can't use the functions called from it. Thank you for your help and insight as always! Please ask, if anything is fuzzy about the problem
  8. Thanks Lars! I do what you told me regarding the Inspects.exe-s, CUIAutomation2.au3 was already on my computer, I just didn't know... I placed it to the UDF folder thank you directing me to find it (upsy) Edit: I have a little problem, I cant seem to add the UDF to the Scite CallTip manager (see picture), I choose the folder and the UDF, I think it should have the Header mode, but if I click Parse I get a Msg that reads: Parsing Complete (title), Please select another UDF or Exit(text) and an OK button. M'i done? I thought (according to the help file) that I have to click Add and thats bothers me, giving me a feeling that something isn't as it should be. pic:
  9. I'm sorry, but I downloaded SDK 10, and run into a "little problem" with inspect.exe After I was unable to find it manually, (was looking around in the wrong folder, Microsoft SDK I think) I used the good old, search the entire C drive for "ApplicationName" method. It was somewhat successful, I found 4 Inspect.exe from which 2 of them gave me an error message, and 2 others are working. I guess it has something to do about my windows 10 (x86) version. My questions: why are there 4 of them? What do I need to keep to keep one of the working inspects running? Do I need to save any files other then the Inspect.exe? Thank you for your insight Edit: Also this is my first time (be gentel) when I would like to add additional UDFs to autoIT, I created the extra folder outside autoit3, and used sciteconfig to connect it to scite, but I cant find the CUIAutomation2.au3 UDF to download, where can I find it? (Sorry for the basic questions, but maybe someone else will be happy to find the anserws too )
  10. Thank you all Larsj, junkew, jpm! I will start to look into UI Automation framework, I don't recall that i used it before. This isn't really my first automatization project, I did the calculator for my own joy, and a few years ago another program automatization like this, now a days I have a few excel autoformating scripts that also get info from exchange rates given the dates from the line, and calculating a few stuffs and order them etc. I'm not a fresh starte (I wouldn't say I'm a good one neither ) Highlighted areas are usually good around the buttons, but it see the icons and textboxes on the buttons as stand alone components, I'm not sure how it should work, or how it is written, and I can't upload pictures, sorry jpm, thanks, the moment I read your comment I knew this will be the problem, it seems like its working (I only tried to use it once, it worked and I wanted to get back to you guys as fast as possible)
  11. I was able to move the coursor. I still have a problem with clicking. How can I test if the click has been sent? I share the code Im working on: ;more includes then i use... #include <EditConstants.au3> #include <AutoItConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPI.au3> #include <Misc.au3> AutoItSetOption("MustDeclareVars", 1) Opt("TrayIconDebug", 1) ; Opt is equal to AutoItSetOption Global $TestHandle ;[50006] ID of the picture from SimpleSpy CompassHandelSearch() ;Try WinList to get compass win handel? ;WinSetState('Compass', '', @SW_MAXIMIZE) ; To Restore it if its minimized ;WinActivate('Compass') ;WinWaitActive('Compass') ;wait till its active Window ;WinSetOnTop('Compass', "", $WINDOWS_ONTOP) WinActivate($TestHandle) MsgBox($MB_SYSTEMMODAL, "Test Interaction Test", "WinActivate done", 2) Sleep(1500) ;If there is no Sleep, mouseMove doesn't work MouseMove(15, 40, 0) Sleep(1500) MouseClick($MOUSE_CLICK_LEFT) ;trying doubleclick, not working, Controls changes color, but menu that should apper doesn't appear MouseClick($MOUSE_CLICK_LEFT) Sleep(1500) ;MouseDown($MOUSE_CLICK_LEFT) ;Sleep(500) ;MouseUp($MOUSE_CLICK_LEFT) ;Sleep(1500) ;SendKeepActive -- Same as Send, attempts to Keep Window active after each SendkeepActive MsgBox($MB_SYSTEMMODAL, "Tracer message", "MouseMove and MouseClickLeft done", 2) MouseClick("left",60,70,1,10) ;On monitoring, doesn't work, mouse stay at original position Sleep(1000) MsgBox(1,"Tracer message", 'MouseClick has happened',2) Sleep(1000) ControlClick('Test', '', '[50006]') Sleep(1000) ControlClick($TestHandle, '', '[50006]') Sleep(1000) MsgBox(1,"Tracer message", 'ControlClick has happened',2) If @error Then MsgBox($MB_SYSTEMMODAL, 'Error', 'ControlClick error') EndIf Sleep(1000) ;Functions------------------------------------------------- Func CompassHandelSearch() ; Retrieve a list of active-window handles. Local $aList = WinList() ; Loop through the array until find one titeld Test, Save handel. For $i = 1 To $aList[0][0] If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then ;MsgBox($MB_SYSTEMMODAL, "", "Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1]) If $aList[$i][0] = 'Test' Then $TestHandle = $aList[$i][1] MsgBox($MB_SYSTEMMODAL, "", "Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1],2) EndIf EndIf Next EndFunc thanks for your help
  12. Hello, This could be a problem with the installation since MouseMove(60, 70, 0) or MouseMove(60, 70) doesn't do anything. Should I just start with reinstalling AuotIT or SciTe? Edit: Could it be that since the development is going on, using MVVM method, the click is not registered somehow on the View (it turned out I didn't gave Sleep() and the script just run to fast to do the mousemovment i guess), the control I target changes color, but nothing happens. (a menu should be displayed).
  13. Hello, I'm developing again (everybody ruuun! ) I would like to develope a script that goes through basicly every user control on a window, and log things that happens, and maybe do some screenshots. I did something like this before. My problem, which I would like to avoid this time (to improve my understanding and skill) , was that when I was unable to get a ControlID or handler or anything, I simply did some math and clicked on the coordinates it should have been (for example, maxing the window, and knowing the initial set up I was ablo to calculate given control position). I know that this is a bad solution for a number of reasons. Now I got authorization to install autoIT here, and i started to the work, AU3Info was unable to find anything on the window (this could be a problem, since autoIT doesn't see anything on it then, if I understood the help file) So I got the SimpleSpy script (source: ) I added a bit of code to the original to display ID as well, what I received is this: Mouse position is retrieved 115-207 At least we have an element title: [ADD] class: [Button] ID: [50000] (<-- coded this to display ID here as well) Having the following values for all properties: Title is: <ADD> Class := <Button> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) 10;187;120;35 *** Parent Information top down *** 3: Title is: <Compass> Class := <Window> controltype:= <UIA_WindowControlTypeId> ,<50032> , (0000C370) -8;-8;1936;1056 "Title:=Compass;controltype:=UIA_WindowControlTypeId;class:=Window"" 2: Title is: <> Class := <MainView> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 0;23;1920;1017 "Title:=;controltype:=UIA_CustomControlTypeId;class:=MainView"" 1: Title is: <> Class := <TileNavigationView> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 0;23;1920;967 "Title:=;controltype:=UIA_CustomControlTypeId;class:=TileNavigationView"" 0: Title is: <> Class := <AreasView> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 0;132;1920;858 "Title:=;controltype:=UIA_CustomControlTypeId;class:=AreasView"" so far I wrote this script: WinActivate('Test') ;It works!! :D first official interaction Sleep(1000) ;1 sec sleep to be sure ControlClick('Test', '', '50000') If @error Then MsgBox($MB_SYSTEMMODAL, 'Error', 'ControlClick error') EndIf Sleep(1000) MsgBox(1,"Tracer message", 'ControlClick has happened') ;MouseClick() ;ControlCommand() AutoIt activates the window, but the click on the given button doesnt happen (I tried to write 50000 without ' ' on ID). M'I doing the @error part correctly ? (no error Msg has been displayed), sorry I rarely use AutoIT and seems to forget less and less after each neglect, but still I'm far from a proffessional Any help or suggestion is welcome, thank you for your time and insight!
  14. Hello all! I wrote a little script to automate some of my work (for which I'm greatfull). I have little problem now. My script get data of currency values from specified time period. The problem, if XY day is a holiday or something, then the bank doesn't have new values for that day, thus my script can ask for "till that date" if there is only data for "till that date-1". I should be done with this for tomorrow and I should learn for my test paper tomorrow, make a genetic algorhytm homework, and at least look at a ppt... So here is my code, pleas ask if you need more information! InternetRead2() ;Creating Date and Arfolyam arrays, using DateInterval read from above (_ArraysDisplayed and function is "tested") ;Calculate and write HUF*OSSZEG Do Local $SZAMLATELJOlvaso = _Excel_RangeRead($ExcelObject, Default, $SZAMLATELJoszlop & $CellaOlvasoSzamlalo) Local $Time = StringTrimRight($SZAMLATELJOlvaso, 6) $DateArrayTimeIndex = _ArraySearch($DateArray, $Time, 0, 0, 0, 0, 1) ;MsgBox(64, "Értesítés", $DateArrayTimeIndex) If @error = 6 Then $DateArrayTimeIndex = _ArraySearch($DateArray, $Time-1, 0, 0, 0, 0, 1) ;MsgBox(64, "Értesítés", $DateArrayTimeIndex) EndIf If @error = 6 Then $DateArrayTimeIndex = _ArraySearch($DateArray, $Time-2, 0, 0, 0, 0, 1) ;MsgBox(64, "Értesítés", $DateArrayTimeIndex) EndIf If @error = 6 Then $DateArrayTimeIndex = _ArraySearch($DateArray, $Time-3, 0, 0, 0, 0, 1) ;MsgBox(64, "Értesítés", $DateArrayTimeIndex) EndIf If @error = 6 Then $DateArrayTimeIndex = _ArraySearch($DateArray, $Time-4, 0, 0, 0, 0, 1) ;MsgBox(64, "Értesítés", $DateArrayTimeIndex) EndIf $DateArrayTimeIndex = $DateArrayTimeIndex+1 ;Egyébként arraysearch -1et ad vissza, 0nál. Passz Sleep(200) If Not $SZAMLATELJOlvaso = "" Then _Excel_RangeWrite($ExcelObject, $ExcelObject.Activesheet, "=" & $OSSZEGoszlop & $CellaOlvasoSzamlalo & "*" & String($ArfolyamArray[$DateArrayTimeIndex]) & "", String($sHUFBeszurOszlop) & $CellaOlvasoSzamlalo) If @error Then _Excel_RangeWrite($ExcelObject, $ExcelObject.Activesheet, "=" & $OSSZEGoszlop & $CellaOlvasoSzamlalo & "*" & String($ArfolyamArray[$oXML_Node.Length]) & "", String($sHUFBeszurOszlop) & $CellaOlvasoSzamlalo) MsgBox(64, "Értesítés", "Valamilyen okból, nem találok az adott dátumhoz árfolyamot, a keresési idők közül a legutolsó árfolyammal töltöttem ki!" & @CRLF & Number($oXML_Node_Datum)) EndIf EndIf $CellaOlvasoSzamlalo = $CellaOlvasoSzamlalo + 1 Until $SZAMLATELJOlvaso = "" also my internetread2 function : Func InternetRead2() ;ezt használja az excelmove ;----------------------------------- ;Original Source: https://www.autoitscript.com/forum/topic/184884-solved-basic-com-help-working-on-string-returned-from-api-mi-doing-this-okey/ ;by Genius257 ;TO DO: Some error handling maybe: what if there is no $MinTime/$MaxTime? ;Read the returns in to array for future use --> Right now, 2 arrays one with the dates and one with the exchangerates ;----------------------------------- ;Globals decleared to avoid warnings Global $MinTime ;20160601000000 Global $MaxTime ;20160610000000 Global $MinTimeFormated = StringTrimRight($MinTime, 6) Global $MaxTimeFormated = StringTrimRight($MaxTime, 6) $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") If $MaxTimeFormated = "" and $MinTimeFormated = "" Then MsgBox(64, "Értesítés", "Nincsenek beolvasott dátumok a memóriában, dummy dátumokat adok meg!" & @CRLF & "20160901, 20160910") $MinTimeFormated = "20160901" $MaxTimeFormated = "20160905" EndIf $oHTTP.Open("GET", "http://api.napiarfolyam.hu/?bank=mnb&valuta=eur&datum="&$MinTimeFormated&"&datumend="&$MaxTimeFormated&"", False) $oHTTP.Send() $sXML = $oHTTP.responseText Global $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.loadXML( $sXML ) $oXML_Nodes = $oXML.SelectNodes("./arfolyamok/deviza/item") Global $ArfolyamArray[$oXML_Nodes.Length] ;MsgBox(64, "Title", "" & $oXML_Nodes.Length & "") ;_ArrayDisplay($ArfolyamArray) Global $DateArray[$oXML_Nodes.Length] For $i=0 To $oXML_Nodes.Length-1 Global $oXML_Node = $oXML_Nodes.Item($i) $oXML_Node_Bank = $oXML_Node.SelectNodes("./bank") $oXML_Node_Bank = $oXML_Node_Bank.Length>0?$oXML_Node_Bank.Item(0).text:"" Global $oXML_Node_Datum = $oXML_Node.SelectNodes("./datum") $oXML_Node_Datum = $oXML_Node_Datum.Length>0?$oXML_Node_Datum.Item(0).text:"" $oXML_Node_Penznem = $oXML_Node.SelectNodes("./penznem") $oXML_Node_Penznem = $oXML_Node_Penznem.Length>0?$oXML_Node_Penznem.Item(0).text:"" $oXML_Node_Kozeps = $oXML_Node.SelectNodes("./kozep") $oXML_Node_Kozep01 = $oXML_Node_Kozeps.Length>0?$oXML_Node_Kozeps.Item(0).text:"" $oXML_Node_Kozep02 = $oXML_Node_Kozeps.Length>1?$oXML_Node_Kozeps.Item(1).text:"" $ArfolyamArray[$i] = $oXML_Node_Kozep01 $DateArray[$i] = StringTrimRight(StringReplace($oXML_Node_Datum, "-", ""), 8) ConsoleWrite( "Match [" & StringFormat("%02i", $i+1) & "]:"&@CRLF& _ @TAB&"Bank: "&@TAB&$oXML_Node_Bank&@CRLF& _ @TAB&"Datum: "&@TAB&$oXML_Node_Datum&@CRLF& _ @TAB&"Penznem: "&@TAB&$oXML_Node_Penznem&@CRLF& _ @TAB&"Kozep01: "&@TAB&$oXML_Node_Kozep01&@CRLF& _ @TAB&"Kozep02: "&@TAB&$oXML_Node_Kozep02&@CRLF _ ) Next ;_ArrayDisplay($ArfolyamArray) ;_ArrayDisplay($DateArray) EndFunc My problem is that I have dates in my excel till 2016.10.30, but I only have dates till 28. (see the api, according to aoutit console, I have the same data: http://api.napiarfolyam.hu/?bank=mnb&valuta=eur&datum=20161001&datumend=20161030 ) My idea/goal (with the If @error then... after @SZAMLATELJolvaso part) is that if this happens, I want it to automaticly jump to the last date of the array (I will be able to write something more elaborate, but for now thats my goal, to save the sinking ship ) Thank yu for your help and insight!
  15. I don't get it. If I write something (a string) in to a cell like: =SUM(range) and then I want to instruct the cell to display the value as a kind of currency, how do I do it? If I read the value, it gives back the function, like =SUM(range) I cant transformt that to integer and Round() it. and add regex USD at the end.
×
×
  • Create New...