Leaderboard
Popular Content
Showing content with the highest reputation on 03/30/2019 in all areas
-
Execute the script directly via PHP and supply the data as command line parameters, that is how I always do it. Make sure you sanitize all user input before passing it into the command.2 points
-
UIASpy - UI Automation Spy Tool
LarsJ reacted to AtomicSeek for a topic
Dear LarsJ, For me there still seems to be a problem related to screen scaling. I'm using the latest version of UIASpy (from March 23), and my screen scaling is set to 125% (because at 100% everything is too small). After selecting the same scaling in UIASpy: 1. If I'm pressing F1-F4 to detect the element, then the correct (scaled) red rectangle is shown but only for a fraction of a second, and afterwards the wrong (not scaled) red rectangle is shown and remain visible. 2. If I'm selecting the element in UIASpy by clicking it in the left pane, then only the wrong (not scaled) red rectangle is shown and remain visible. I tested also with other scalings and I have the same problem. At 100% the red rectangle is shown correctly. Does this happens also to anyone else? Thank you, AtomicSeek1 point -
StringRegExp match bigger string first than smaller
GordonFreeman reacted to Bowmore for a topic
This pattern will give you the correct result if I have understood your requirement correctly $pattern = '(ZA|WA|VA|Z|W|V)([0-9]{1,3})(?:[-])([0-9]{1,3})([y,Y]{0,1})'1 point -
Automation is just 1. Identify your object of interest 2. Do an action on it Difficulty only starts when you need more flexibility in recognition. Uia from microsoft is nicely documented but you need some dev skills to deal with this. Larsj made in this thead excellent examples on the raw coding. My uiawrappers as it says wrapped away some complexity. Comparing to selenium or mobile automation it all comes back to above 2 points and a decent spy tool to help you out.1 point
-
How to read unicode utf8 string from sub process (Run) with StdoutRead()?
GillesMaisonneuve reacted to jchd for a topic
"Courier New" definitely handles unicode characters. Ω is 0xCE 0xA9 = 0x03A9 = 'Ω' encoded in UTF8. You need to convert the UTF8 string to the native encoding used by AutoIt (a subset of UTF16-LE named UCS2). #include <StringConstants.au3> Local $sOutput = Chr(0xCE) & Chr(0xA9) If $sOutput <> '' Then $sOutput = BinaryToString($sOutput, $SB_UTF8) ;~ GUICtrlSetData($Edit1, $sOutput) MsgBox(0, "", $sOutput) EndIf1 point -
FordFinest, We have some issues with a few of the commands in the GuiTreeView UDF under Windows 10 64 bit. I had temporarily forgotten that in your previous post about the same subject a month ago. Sorry. The problem is obvious if you try the example of _GUICtrlTreeView_ClickItem in the help file under Windows 10 64 bit. The _GUICtrlTreeView_ClickItem command (here a double click) simply does not work. Make a copy of the example. Add the two functions here to the code and replace _GUICtrlTreeView_ClickItem with _GUICtrlTreeView_ClickItem64. Func _GUICtrlTreeView_ClickItem64($hWnd, $hItem, $sButton = "left", $bMove = False, $iClicks = 1, $iSpeed = 0) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local $tRECT = _GUICtrlTreeView_DisplayRectEx64($hWnd, $hItem, True) If @error Then Return SetError(@error, @error, 0) ; Always click on the left-most portion of the control, not the center. A ; very wide control may be off-screen which means clicking on it's center ; will click outside the window. Local $tPoint = _WinAPI_PointFromRect($tRECT, False) _WinAPI_ClientToScreen($hWnd, $tPoint) Local $iX, $iY _WinAPI_GetXYFromPoint($tPoint, $iX, $iY) Local $iMode = Opt("MouseCoordMode", 1) If Not $bMove Then Local $aPos = MouseGetPos() _WinAPI_ShowCursor(False) MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed) MouseMove($aPos[0], $aPos[1], 0) _WinAPI_ShowCursor(True) Else MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed) EndIf Opt("MouseCoordMode", $iMode) Return 1 EndFunc ;==>_GUICtrlTreeView_ClickItem Func _GUICtrlTreeView_DisplayRectEx64($hWnd, $hItem, $bTextOnly = False) Local $tRECT = DllStructCreate($tagRECT) Local $iRet If IsHWnd($hWnd) Then ; RECT is expected to point to the item in its first member. ;DllStructSetData($tRECT, "Left", $hItem) $iRet = @AutoItX64 ? DllStructSetData( DllStructCreate( "ptr", DllStructGetPtr( $tRect ) ), 1, $hItem ) _ : DllStructSetData( $tRect, "Left", $hItem ) If _WinAPI_InProcess($hWnd, $__g_hTVLastWnd) Then $iRet = _SendMessage($hWnd, $TVM_GETITEMRECT, $bTextOnly, $tRECT, 0, "wparam", "struct*") Else Local $iRect = DllStructGetSize($tRECT) Local $tMemMap Local $pMemory = _MemInit($hWnd, $iRect, $tMemMap) _MemWrite($tMemMap, $tRECT) $iRet = _SendMessage($hWnd, $TVM_GETITEMRECT, $bTextOnly, $pMemory, 0, "wparam", "ptr") _MemRead($tMemMap, $pMemory, $tRECT, $iRect) _MemFree($tMemMap) EndIf Else If Not IsHWnd($hItem) Then $hItem = _GUICtrlTreeView_GetItemHandle($hWnd, $hItem) ; RECT is expected to point to the item in its first member. DllStructSetData($tRECT, "Left", $hItem) $iRet = GUICtrlSendMsg($hWnd, $TVM_GETITEMRECT, $bTextOnly, DllStructGetPtr($tRECT)) EndIf ; On failure ensure Left is set to 0 and not the item handle. If Not $iRet Then DllStructSetData($tRECT, "Left", 0) Return SetError($iRet = 0, $iRet, $tRECT) EndFunc ;==>_GUICtrlTreeView_DisplayRectEx You haven't shown much code, but I think the two functions will solve your problem. If the code doesn't help then add a new post. The problem can certainly be solved. For one reason or another, Microsoft has stopped supporting the focused state of a treeview item. However, the dotted focus rectangle is still displayed. This is not an AutoIt problem.1 point
-
Options for passing data to compiled script
Earthshine reacted to TheDcoder for a topic
@Rhidlor My pleasure, you may also find it useful to know how to directly execute scripts via the AutoIt3.exe interperter without compiling them: https://www.autoitscript.com/autoit3/docs/intro/running.htm1 point -
You could use: Command line parameters The clipboard The edit box in the hidden Autoit window An INI file. These should get you started.1 point
-
Portability, speed of authorship, and the ease with which you can move data into various shapes is where i find the beauty. Speed of execution is the least of my concerns when i start an .au3. And if you are going to do all the legwork, why try and bring that back through an interpreter?1 point
-
mseidel, Disgraceful! Well, we are certainly not going to encourage such appalling behaviour - thread closed. And can we please have the name of your company to make sure we have nothing to do with it in the future. M231 point
-
or this $a = StringRegExp($data, '(?ims)^\h*(?|(?:local|Global)\h+(\N+)|((?|\$|GUICtrl[cs])\N+))(?=.*guisetstate)', 3) Checking the "=" is not mandatory as "Local $array[3][2]" or "Local $var" are valid declarations Note that it won't work clean for multiple declarations on the same line "Local $var1 = 1, $var2 = 2, $var3 = 3"1 point
-
1 point