Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. qwert, After significant effort, I have a case where expanding a folder which has another folder within it shows the name of the child folder as blank. (You had this problem.) This happens every time, not just once in a while. The drive is a USB memory stick. The first level of folders show AOK but expanding any of the folders that has a child fails to show the folder name. This is when _cFileSelectFolder is called from a relatively long production script (hundreds of lines of code); however _cFileSelectFolder behaves properly when it is called with the same parameters from a short test script. The old version of the production script calls FileSelectFolder. That expands folders AOK. I have created a version of the production script that allows the user to choose a child folder by calling Mebla23's _CFF_Choose. That version shows the child folder without a name when its parent is expanded (like my _cFileSelectFolder). You have suggested that there may be a bug in AutoIt. Based on the above, I am inclined to agree. An attempt to summarize my findings: sub folder's name shows: short test script, and production script that calls FileSelectFolder sub folder's name does not show: production script that calls _cFileSlectFolder, and production script that calls _CFF_Choose I am well aware that the way of telling the developers about a possible bug is to provide a short script that demonstrates the problem; however, in this case my short script always works AOK, so I do not know how to proceed. Suggestions are most welcome!
  3. @Jos, I am already running as #RequireAdmin. @AdamUL, it give the same False result. I have loads of other validations which are all correct. It is just this file which shows opposite result. 🤨 But when I change it as: If _VersionCompare($Test_LocalFile_Ver, $Test_SourceFile_Ver) = 0 Or _VersionCompare($Test_LocalFile_Ver, $Test_SourceFile_Ver) = 1 Then     MsgBox(0, "", "True") Else     MsgBox(0, "", "False") EndIf So _VersionCompare works in this case. But as per help file it as 3 validations which is why we can't put only = 0 and Else. 0 - Both versions equal 1 - Version 1 greater -1 - Version 2 greater End of the line, this works as per my need. Thank you.
  4. Today
  5. If the error is indeed due to the MAX_LINE limit, you should be able to address it by splitting the string and use either concatenation or using the long statement convention
  6. Post some code that demostrates your issue. Otherwise, we can only speculate on the source of the issue.
  7. I fixed that issue, but now I'm getting the unterminated string error because the array exceeds the max length for a line (it was like 9000 characters) how should I approach this issue
  8. Likely a bug in your code, but no way to tell since you haven't shown us any. 🙄
  9. I have a program with an array that includes 800 items. When I try to run it, it gives me this error (that, or "unterminated string"). What could be the issue? The error goes away when I decrease the size of the array. How can I have my array contain 800 items without getting an error?
  10. Yesterday
  11. Example below seems to work (just copy-paste from here) All credits for argumentum and Melba23, both referenced in the code: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <DateTimeConstants.au3> #include <WinAPI.au3> $hGUI = GUICreate("Test", 200, 200, 800, 200) $cDate1 = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20) $cDate2 = GUICtrlCreateDate("1953/04/25", 10, 50, 185, 20) $cButton = GUICtrlCreateButton("Submit", 10, 100, 50, 50, -1, -1) ;argumentum, Nov 2017 ;https://www.autoitscript.com/forum/topic/191058-datetime-pick-coloring/ Global $g_hDTP1 = GUICtrlGetHandle($cDate1) Global $g_hDTP2 = GUICtrlGetHandle($cDate2) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) ;Melba23, March 2014 ;https://www.autoitscript.com/forum/topic/159764-reading-gui-date-control-instantly/?do=findComment&comment=1161074 ; Start by looking for the Date control Switch _WinAPI_LoWord($wParam) ; ControlID of the control Case $cDate1, $cDate2 Local $tStruct = DllStructCreate($tagNMHDR, $lParam) If DllStructGetData($tStruct, "Code") = $DTN_DATETIMECHANGE Then ConsoleWrite("1: " & GUICtrlRead($cDate1) & " - 2: " & GUICtrlRead($cDate2) & @CRLF) EndIf EndSwitch ;Melba23, March 2014 ;https://www.autoitscript.com/forum/topic/159764-reading-gui-date-control-instantly/?do=findComment&comment=1161074 ; And then see if the ListView needs attention ;~ Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView ;~ ; Local $tBuffer ;~ $hWndListView = $Timelog_form_Listview ;~ If Not IsHWnd($hWndListView) Then $hWndListView = GUICtrlGetHandle($Timelog_form_Listview) ; etc, etc ;argumentum, Nov 2017 ;https://www.autoitscript.com/forum/topic/191058-datetime-pick-coloring/ Local $hWndFrom, $iCode, $tNMHDR, $iIDFrom $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "HwndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") Switch $hWndFrom Case $g_hDTP1, $g_hDTP2 Switch $iCode Case $NM_SETFOCUS ConsoleWrite("$NM_SETFOCUS" & @CRLF & "-->hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF) Case $NM_KILLFOCUS ConsoleWrite("$NM_KILLFOCUS" & @CRLF & "-->hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF) Consolewrite("+-> GUICtrlRead:" & @TAB & GUICtrlRead($cDate1) & @CRLF) EndSwitch EndSwitch EndFunc
  12. Thank you! Much better! $iMode [optional] Integer representing reading mode. Default is 0 (charset is decoded as it is ANSI). I should have played around with that.
  13. first question is why? Is a function variable not enough to help you with the why? $c=b $c() $c=a $c() func a() ConsoleWrite("Hello a" & @CRLF) EndFunc func b() ConsoleWrite("Hello b" & @CRLF) EndFunc Functions like assign can create true variables on the fly and with eval you can get the content of them
  14. Thanks for the help but this looks to be more of a learning curve and more time needed to be invested then I am willing to. My program needs to be simple to use and work on any computer/configuration. I want to avoid installing extra pieces like W3C WebDriver for Edge. I looked at UIAWrappers.au3 and can get it to click but it moves the mouse which I cannot do. Also, it clicks the wrong refresh and I am not sure how to identify which one to click. Each user’s dashboard can be setup different and there are multiple grids each with a refresh. I have a user-friendly program that can be configured with two clicks to pull the coordinates and browser information needed to automate refreshing the correct grid every 30 seconds with ControlClick and only send ControlClick when on the Dashboard. I will stick with what I have for now and not support Edge.
  15. check your previous thread I gave a full calculator example to learn from
  16. Ok full example on how to come where you want to be Start calc.exe Start Simplespy Hover on button 1 and press ctrl+w Example for a dutch W10 system ;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=Rekenmachine;controltype:=UIA_WindowControlTypeId;class:=ApplicationFrameWindow") ;Rekenmachine _UIA_setVar("oP2","Title:=Rekenmachine;controltype:=UIA_WindowControlTypeId;class:=Windows.UI.Core.CoreWindow") ;Rekenmachine _UIA_setVar("oP3","Title:=;controltype:=UIA_GroupControlTypeId;class:=LandmarkTarget") ; _UIA_setVar("oP4","Title:=Numeriek toetsenbord;controltype:=UIA_GroupControlTypeId;class:=NamedContainerAutomationPeer") ;Numeriek toetsenbord ;~ $oUIElement=_UIA_getObjectByFindAll("Een.mainwindow", "title:=Een;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree) _UIA_setVar("oUIElement","Title:=Een;controltype:=UIA_ButtonControlTypeId;class:=Button") ;ControlType:=UIA_ButtonControlTypeId;classname:=Button") ;~ Actions split away from logical/technical definition above can come from configfiles ;~_UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") ;~_UIA_Action("oP2","highlight") _UIA_Action("oP2","setfocus") ;~_UIA_Action("oP3","highlight") _UIA_Action("oP3","setfocus") ;~_UIA_Action("oP4","highlight") _UIA_Action("oP4","setfocus") _UIA_action("oUIElement","highlight") ;~_UIA_action("oUIElement","click") Clean up to something like this I leave out the hierarchy of the different parents as mainly mainwindow is needed and leaf in ui hierarchy. If you observe speedissues it can help to put in additional layers of the hierarchy ;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=Rekenmachine;controltype:=UIA_WindowControlTypeId;class:=ApplicationFrameWindow") ;Rekenmachine _UIA_setVar("oUIElement","Title:=Een;controltype:=UIA_ButtonControlTypeId;class:=Button") ;ControlType:=UIA_ButtonControlTypeId;classname:=Button") ;~ Actions split away from logical/technical definition above can come from configfiles _UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") _UIA_action("oUIElement","highlight") _UIA_action("oUIElement","click") And play with instance property #_UIA_setVar("oUIElement","Title:=Een;controltype:=UIA_ButtonControlTypeId;class:=Button") ;ControlType:=UIA_ButtonControlTypeId;classname:=Button") _UIA_setVar("oUIElement","controltype:=UIA_ButtonControlTypeId;instance:=1") ;ControlType:=UIA_ButtonControlTypeId;classname:=Button") And transformed to a full example (hopefully works in different languages of W10 directly) AutoItSetOption("MustDeclareVars", 1) #include "UIAWrappers.au3" Example() Func Example() Local $sp=wingetprocess("[active]") ; Run calc with the window maximized. Local $iPID = Run("calc", "", @SW_SHOWMAXIMIZED) ; Wait for the calc window to appear and be active Local $maxTry=1 while ($sp=wingetprocess("[active]")) and $maxTry <= 10 sleep(1000) $maxTry=$maxTry+1 WEnd ; Wait for 2 seconds. Sleep(2000) Local $calcTitle=wingettitle("[active]") ;~ Declaration of reference definitions could be put in UIA.CFG ;~ [calc] ;~ oP1=Title:=Rekenmachine;controltype:=UIA_WindowControlTypeId;class:=ApplicationFrameWindow ;~ oUIElement=controltype:=UIA_ButtonControlTypeId;instance:=11 ;~ But will do it for demo in coding _UIA_setVar("oP1","Title:=" & $calcTitle & ";controltype:=UIA_WindowControlTypeId;class:=ApplicationFrameWindow") ;Rekenmachine _UIA_setVar("oUIElement","controltype:=UIA_ButtonControlTypeId;instance:=11") ;ControlType:=UIA_ButtonControlTypeId;classname:=Button") ;~ Actions split away from logical/technical definition above can come from configfiles _UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") _UIA_action("oUIElement","highlight") _UIA_action("oUIElement","click") ;~ Just a bunch of buttons to highlight using instance property with dynamic description for $i=10 to 34 _UIA_action("controltype:=UIA_ButtonControlTypeId;instance:=" & $i ,"highlight") Next sleep(5000) ; Close the calc process using the PID returned by Run. ProcessClose($iPID) EndFunc ;==>Example
  17. Oh, that is a given but, I am simply the script Guy, he is the money guy with the idea.. So..... I currently have to defer to him.
  18. Try _WinHttpReadData($hRequest, 1) .
  19. Updated to v2.0 (see first post for download and new screenshot). (v2.0) Upon further investigation, it seems my issue with Project Gutenberg, is not the case for everyone, so I have now made HTTP instead of HTTPS optional. The checkbox for this option, is a three state one, where you can elect to have all HTTPS changed to HTTP, or just for Project Gutenberg or no change. The third party program 'wget.exe' if placed in the program folder, can now be used instead for downloading, if enabled.
  20. you were given the way. read this FAQ as mentioned here before https://www.autoitscript.com/wiki/FAQ#Does_AutoIt_support_database_connections.2C_such_as_SQL.3F
  21. ControlClick("Start", "", "ApplicationFrameInputSinkWindow1", "left", 1, 740, 186) This does return a 1 so I guess it is clicking but Edge is not responding to it. I will look for another way to trigger the element.
  22. Use the _VersionCompare function for comparing file versions. #include <Misc.au3> Local $Test_LocalFile = "C:\Program Files\Test\App1.exe" Local $Test_LocalFile_Ver = FileGetVersion($Test_LocalFile, "ProductVersion") Local $Test_SourceFile_Ver = IniRead("c:\Test.ini", "Apps", "App1", "") If _VersionCompare($Test_LocalFile_Ver, $Test_SourceFile_Ver) = 0 Then MsgBox(0, "", "True") Else MsgBox(0, "", "False") EndIf Adam
  23. Oh the shame!... I have such a big ini that i forgot to uncomment that particular key... Please forgive me. You can remove the post, if you like. Thank you for your help and again... sorry.
  24. Sometimes when pulling text from a site to display in a msgbox, I get "garbage" characters that I need to replace/remove: $sPull = _WinHttpReadData($hRequest) $sPull = StringRegExpReplace($sPull, "’", "'") $sPull= StringRegExpReplace($sPull, "€", "'") $sPull= StringRegExpReplace($sPull, "â€", "'") $sPull= StringRegExpReplace($sPull, "—", " ") $sPull= StringRegExpReplace($sPull, "Â", "") Is there a way to avoid getting these characters as they don't appear in the text of the websites? Should I be using a different function altogether instead of _WinHttpReadData()? Thank you for your help.
  25. You can get the SQLite DLLs for AutoIt from https://www.autoitscript.com/autoit3/pkgmgr/sqlite/, as specified in the Help File for _SQLite_Startup. Adam
  1. Load more activity
  • Create New...