Leaderboard
Popular Content
Showing content with the highest reputation on 10/02/2018 in all areas
-
2 points
-
IUIAutomation MS framework automate Problem
JLogan3o13 and one other reacted to Jos for a topic
@faustf, Sorry for my Dutch bluntness, but you really have an issue using your brain when you are around this forum ... don't you? In which Forum did you post this? Jos2 points -
[NEW VERSION] - 2 Aug 18 Added: When specifying the icon to use, if the $vIcon parameter is set to the name of an ico or exe file, the main icon within will be displayed, but if a trailing "|" followed by the icon index is added to the name, that icon from within the file is used New UDF and example in the zip below. Details of previous versions: Changelog.txt A forum query about the small pop-ups that some apps produce from the systray led me to create my version of how this can be done. By the way, I call these small GUIs "Toasts" for obvious reasons! A zip containing the UDF, an example script and my StringSize UDF (which is also required): Toast.zip As always, kind comments and constructive criticisms welcome - particularly the former! M231 point
-
There is a lot of snippets on this forum about this, with examples BTW If php can do it, then AutoIt can too #Include <Array.au3> $txt = '<h3 itemprop="name" class="entry-title"><a itemprop="url" href="http://www.mywebsite.com/1/" rel="bookmark" title="hello world 1</a></h3>' & @crlf & _ '<h3 itemprop="name" class="entry-title"><a itemprop="url" href="http://www.mywebsite.com/2/" rel="bookmark" title="hello world 2</a></h3>' ; Msgbox(0,"", $txt) $res = StringRegExp($txt, '(?:href|title)="([^"<]+)', 3) _ArrayDisplay($res)1 point
-
It actually is pretty strait forward: With AdlibRegister() you "schedule" a Func to be run each xxx msecs as defined in the second parameter. The only thing to remember is that Autoit3 is single threaded, so the current process is interrupted for the period the Func runs. Jos1 point
-
I have a really noob problem about my script! I NEED HELP :( - (Locked)
imooongkey reacted to Melba23 for a topic
Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team1 point -
Maybe adding an AdlibRegister() after having created the GUI with Controls, and have that Func update the power reading each xxxx mseconds? Jos1 point
-
Change the instance Index local $objectSecondInstace=_IEGetObjByClass($oIE, "select2-selection select2-selection--single",1) Saludos1 point
-
Here is an example without Danp2's suggestion. #include <IE.au3> Local $oIE = _IECreate("https://www.truckpooling.it/", 0, 0) Local $oObject1 = _IEGetObjByClass($oIE, "select2-selection select2-selection--single") ConsoleWrite(IsObj($oObject1) & @CRLF) _IEAction($oObject1, "focus") ControlSend(_IEPropertyGet($oIE, "hwnd"), "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{ENTER}") Local $oObject2 = _IEGetObjByClass($oIE, "select2-search__field") ConsoleWrite(IsObj($oObject2) & @CRLF) _IEAction($oObject2, "focus") ControlSend(_IEPropertyGet($oIE, "hwnd"), "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "00010") Sleep(2000) ;wait load ControlSend(_IEPropertyGet($oIE, "hwnd"), "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{ENTER}") WinSetState(_IEPropertyGet($oIE, "hwnd"), "", @SW_SHOW) MsgBox(0, "", "00010 should be selected") Func _IEGetObjByClass(ByRef $o_object, $s_Class, $i_index = 0) If Not IsObj($o_object) Then __IEConsoleWriteError("Error", "_IEGetObjByClass", "$_IEStatus_InvalidDataType") SetError($_IEStatus_InvalidDataType, 1) Return 0 EndIf ; If Not __IEIsObjType($o_object, "browserdom") Then __IEConsoleWriteError("Error", "_IEGetObjByClass", "$_IEStatus_InvalidObjectType") SetError($_IEStatus_InvalidObjectType, 1) Return 0 EndIf ; Local $i_found = 0 ; $o_tags = _IETagNameAllGetCollection($o_object) For $o_tag In $o_tags If String($o_tag.className) = $s_Class Then If ($i_found = $i_index) Then SetError($_IEStatus_Success) Return $o_tag Else $i_found += 1 EndIf EndIf Next ; __IEConsoleWriteError("Warning", "_IEGetObjByClass", "$_IEStatus_NoMatch", $s_Class) SetError($_IEStatus_NoMatch, 2) Return 0 EndFunc ;==>_IEGetObjByClass Saludos1 point
-
Nasty bug in AutoIt comparison operation - (Moved)
user4157124 reacted to Jos for a topic
Maybe it means you are assuming things? If you would have taken the time to read some of the basics in the helpfile you would understand why this is happening. In this case you can find the details in the Helpfile/Language Reference - Operators: So...No Bug. Jos1 point -
Array nightmare
FrancescoDiMuro reacted to Subz for a topic
So whats the question? You can just use _ArrayAdd or you can use ReDim to change the array dimensions, can you post the code you have now?1 point -
I didn't post earlier as you said you wanted Regex. However, if you're willing to use https://www.autoitscript.com/autoit3/docs/libfunctions/_IECreate.htm Then you can try using something like this (not tested): Local $h3Tags = _IETagNameGetCollection($ie, "h3") For $h3Tag In $h3Tags Consolewrite(_IEPropertyGet($h3Tag, "InnerText") & @CRLF) Consolewrite(_IEPropertyGet($h3Tag, "InnerHTML") & @CRLF) Consolewrite($h3Tag.Title & @CRLF) Next Edit: Whoops, sorry. I just realised Juvigy isn't the OP.1 point
-
I think you will need to have a look at the : StringRegExp StringRegExpReplace The IE functions would work too, but it will be different way , and most likely more complicated.1 point
-
Have you looked at the IE functions in the help file?1 point
-
I see you did get the crystal ball out since you seem to know already that function wasn't use.1 point
-
Here are non-array and non-RE methods. Local $s = "146, 147, 148, 150, 151, 152, 153, 154" Local $iStart = 147 While StringInStr($s, $iStart) $iStart += 1 WEnd MsgBox(0, "", $iStart) ;or Local $s = "1/3/2:5" & @CRLF & "1/3/2:7" Local $iStart = "1/3/2:5" While StringInStr($s, $iStart) $iStart = StringLeft($iStart, 6) & (StringTrimLeft($iStart, 6) + 1) WEnd MsgBox(0, "", $iStart)1 point
-
Hi @taylansan and also to all of you who have come to read ... after some debugging I've found the cause of the issue you reported. The 'subtle' problem was not in the javascript function that retrieves the CSS selector, it was instead caused by a "div" element that I injected into the page, to be used as an highlighter on the element where the right-click was performed. To highlight the right-clicked element, Instead of poisoning the page by injecting the div element, now I use an innocuous colored 5px dotted outline well, the "debuged" listing is now posted in first post replacing the previuos one. Bug reports, suggestion and improovements are welcome. Thank You1 point
-
Want to restrict input to specific words/characters
Cyborg5000 reacted to FrancescoDiMuro for a topic
@Cyborg5000 I think that there are some other ways to do it, but take a look at this one: #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= $frmMainForm = GUICreate("A Form", 285, 162, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitApplication") $txtInput = GUICtrlCreateInput("", 20, 24, 249, 24) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUISetState(@SW_SHOW, $frmMainForm) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func ExitApplication() Exit EndFunc Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $hdlWindowFrom, _ $intControlID_From, _ $intMessageCode, _ $strInputText = "" $intControlID_From = BitAND($wParam, 0xFFFF) $intMessageCode = BitShift($wParam, 16) Switch $intControlID_From Case $txtInput Switch $intMessageCode Case $EN_CHANGE $strInputText = GUICtrlRead($txtInput) If StringInStr($strInputText, "*.domain.com") Or StringInStr($strInputText, "*.domain.domain.com") Then ConsoleWrite("This wildcard is not accepted!" & @CRLF) ; If you want to clear the user input ; GUICtrlSetData($txtInput, "") ; If you want to make the input read-only GUICtrlSetStyle($txtInput, $ES_READONLY) EndIf ; ConsoleWrite($strInputText & " ") EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Cheers1 point