Leaderboard
Popular Content
Showing content with the highest reputation on 12/22/2014 in all areas
-
RegExp Quick Tester
pixelsearch reacted to Lazycat for a topic
Since I start using RegExp more and more, I need a tool for quickly testing patterns. I tried script, created by steve8tch and w0uter, it's works fine, but I was bored to click Test button after 5 minutes So, here is my version. It's concept is a bit different, this is not work with big files, because it's goal - quick testing. But it can: Results are showing instantly while editingSupport replace pattern testing as wellText and patterns are automatically saving between sessionsMiddle mouse button click on search pattern editbox show menu with characters quick referenceEdit: updated code, fixed noticeable probs. Most likely this will be last version, if I would tried w0uter's version first (which suitable my needs), this would not appear Edit: 2006-07-22: small fix - middlebutton context menu will show only when window active. 2007-10-09: version 2.5, updated to new PCRE and so on RegExpQuickTester25.zip1 point -
_IEJS has been deprecated, please see: These are a few functions I've put together either for current necessity, past necessity, or looking forward at possible future necessity (and no, I didn't see how many lines of code it was until I was putting this together to upload). Issues with interacting with all types of IE versions and in all types of modes (standard or quirks), and trying to develop the means to successfully drag and drop automated are what started me on this javascript injection method. But keep in mind, not all functions make use of JS. I tried to make it as inline with the IE.au3 library as I was comfortable with. Right now, there are no only a few example codes, there are headers for each function other than internal functions. Some functions (specifically the position ones) are either untested, have proven to be a pain with visible document area only issues, or are in conflict with other types of position functions. I've not had time to debug those and see where their benefit lie at the moment. I've not been able to successfully implement a drag and drop (moving one object to another objects location, firing all necessary events) scenario using the JS move/drag events or even postmessage + WM_[TYPE]BUTTONMOVE/DOWN/UP, etc, as of yet. The issue with the position functions above have been somewhat the issue. So, if you find a solution to that, let me know, if you find issues with the code, please provide a reproducer, IE version, OS Type/Arch, and AutoIt version you're running. I will not respond to "I get this error" or "It doesn't work" with nothing else. If you have javascript code and you'd like to implement, explain what it is, why it's a great idea, and we'll get it in there. Other than that... I'll get examples up as soon as I get a chance, I just knew if I didn't get it up today, I'd forget for another month or 2 years . [some Examples in Zip] Functions: _IEJS_CallObjEval() _IEJS_CallObjExecScript() _IEJS_CheckAppVersionAlways() _IEJS_ClickObjByPoint() _IEJS_CreateWithParams() _IEJS_EmbeddedGetVersion() _IEJS_EmbeddedSetVersion() _IEJS_GetAppMajorVersion() _IEJS_GetObjEval() _IEJS_GetObjParentWindow() _IEJS_GetObjPos() _IEJS_GetObjType() _IEJS_GetScroll() _IEJS_GetScrollPoint() _IEJS_GetWindowSize() _IEJS_MouseEventExec() _IEJS_JSClassNameGetArray() _IEJS_JSClassNameGetCollection() _IEJS_JSClickObj() _IEJS_JSClickObjById() _IEJS_JSClickObjByName() _IEJS_JSClickObjByPoint() _IEJS_JSDragEventObj() _IEJS_JSEnable() _IEJS_JSGetObjByClassName() _IEJS_JSGetObjPos() _IEJS_JSIsEnabled() _IEJS_JSMouseEventObj() _IEJS_JSMouseEventObjById() _IEJS_JSMouseEventObjByName() _IEJS_JSObjQuerySelector() _IEJS_JSObjQuerySelectorAll() _IEJS_JSTypeOf() _IEJS_TabAttach() _IEJS_TabCount() _IEJS_TabCreate() _IEJS_TabGetInstance() _IEJS_VersionInfo() _IEJS_WinGetBrowserObjArray() Changes: Changes from 0.0.3 - 0.0.5 have been lost! 2014-12-30 B0.0.6 Added: _IEJS_EmbeddedGetVersion(); Get the embedded version used from something like _IECreateEmbedded 2014-12-30 B0.0.6 Added: _IEJS_EmbeddedSetVersion(); Set the embedded version used from something like _IECreateEmbedded (see example) 2014-12-30 B0.0.6 Added: _IEJS_TabAttach(); Similar to _IEAttach(), but browser specific and different string cases 2014-12-30 B0.0.6 Added: _IEJS_TabCount(); Get a count of the tabs open in a specific browser session 2014-12-30 B0.0.6 Added: _IEJS_TabGetInstance(); Get the tab instance number from the specific browser session 2014-12-30 B0.0.6 Added: _IEJS_WinGetBrowserObjArray(); Get all the browser objects (tabs) from a specific browser window handle/title Fixes for next version (B0.0.7): ; I mistakenly left out interacting with 3 params (attach/visible/takefocus) Func _IEJS_CreateWithParams($sURL, $sParams = "", $iTryAttach = 0, $iVisible = 1, $iWait = 1, $iTakeFocus = 1) Local Static $sHKCR = ((@AutoItX64) ? "HKCR64" : "HKCR") Local Static $szCOMIE = FileGetShortName(RegRead($sHKCR & _ "\CLSID\{0002DF01-0000-0000-C000-000000000046}\LocalServer32","")) If Not FileExists(StringReplace($szCOMIE, '"', "")) Then $szCOMIE = FileGetShortName(RegRead($sHKCR & _ "\CLSID\{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}\LocalServer32","")) If Not FileExists(StringReplace($szCOMIE, '"', "")) Then Return SetError($_IESTATUS_NoMatch, 1, 0) EndIf EndIf Local $oRet If $iTryAttach Then $oRet = _IEJS_TabAttach($sURL, "URL") If IsObj($oRet) Then $oRet.visible = $iVisible If $iVisible And $iTakeFocus Then WinActivate($oRet.hwnd) EndIf Return SetError($_IESTATUS_Success, 1, $oRet) EndIf EndIf ; get current shell windows open and their count Local $oShell = ObjCreate("Shell.Application") Local $oWin, $nCount = $oShell.windows.count() $sParams = (StringLen($sParams) > 0) ? " " & $sParams : "" Local $iTimer = TimerInit() ; set a 5 minute timeout Local $iPID = Run($szCOMIE & $sParams & ' "' & $sURL & '"') While 1 $oWin = $oShell.windows() If $oWin.count() <> $nCount Then $nCount = $oWin.count() $oRet = $oWin($nCount - 1) If $oRet.TopLevelContainer Then ExitLoop EndIf If (TimerDiff($iTimer) / 1000) >= 300 Then ; timed out waiting, close IE instance ProcessClose($iPID) Return SetError($_IESTATUS_LoadWaitTimeout, 2, 0) EndIf Sleep(10) WEnd If Not $iVisible Then $iTakeFocus = 0 $oRet.visible = False EndIf If $iTakeFocus Then WinActivate($oRet.hwnd) EndIf If $iWait Then _IELoadWait($oRet) If @error Then Return SetError(@error, 3, $oRet) EndIf EndIf Return SetError($_IESTATUS_Success, 2, $oRet) EndFunc ;==>_IEJS_CreateWithParams 2014-12-21: IEJS.B003.zip 2014-12-23: IEJS.B004.zip 2014-12-29: IEJS.B005.zip 2014-12-30: IEJS.B006.zip1 point
-
You are about the 3rd or 4th person to complain about frames no longer working. You may want to review some of the recent threads. I believe someone may have identified an update from MS that is causing this issue.1 point
-
binhnx, I didn't see you edited your post in #13. Yet what you say there is wrong: Unicode ™ (codepoint 0x2122) does not become t in any case. What a conversion (normalization is a different beast) to ANSI yields depends on the ANSI codepage you're using. If your ANSI codepage actually contains the ™ character (e.g. the "western" Windows codepage) then its ASC('™') is returned (0x99 for western Windows) but if your codepage doesn't contain ™ then the conversion gives ? i.e. a question mark. Any Unicode character which doesn't have its exact counterpart in the ANSI codepage you're currently using will convert to ? That's true for Ω and ℣ as well of course. Zohar, This isn't the correct way to handle the situation. Switch is clearly designed to handle strings in conditions and works correctly in all simple cases. Only when several compound condition using strings ranges appear does it go astray. This is definitely a bug and must be raised on Trac and acted upon by Devs.1 point
-
SHA-256
iamtheky reacted to kaesereibe for a topic
#2296 - SHA2 for Crypt.au3 Erweiterung Crypt.au3 um SHA2 (.de) $CALG_SHA_256 = 0x0000800c $CALG_SHA_384 = 0x0000800d $CALG_SHA_512 = 0x0000800e1 point -
Excluding unknown letters/numbers in StringReplace
Marzupilami reacted to Gianni for a topic
... sorry, you are right, I write "minutes" and "seconds" where them are "hours" and "minutes" instead... it's just a typo, but it works as well, passing 2 as second parameter it returns hours (and not minutes) passing 3 it returns minutes (and not seconds) sorry in short it works like this: stringsplit() "dissects" your input string passing each part separated by a space or a colon in single elements into an array where first part on the left of your string (the day) goes to the first element of the array (first element is element 0) $aParts[0] in this case... and so on1 point -
SmOke_N, From the specification of For found in the help file: For $i = "A" To "Z" is equivalent to: For $i = 0 To 0 Why? Because <start>, <stop> and <step> are defined to be numeric values. Passing string datatype(s) will force conversion to numeric by means of an implied Number() call. Switch and Select don't have such a limitation, as Switch is defined (remember the help file plays the role of a loose specification document) to be case-insensitive (i.e. will handle strings in conditions) and Select example shows a string condition tested. Chimp, You and SmOke_N seem to regard Switch as something magical or esoterical but it's not so, even if it is currently buggy in some Case(s) [pun intended]. Your example is no different than: Local $sMsg = "orange" Switch $sMsg Case "apple" To "banana" $sMsgx = "It's a fruit" Case "table" To "bed" $sMsgx = "It's a furniture" Case "Tricycle" To "Car" $sMsg = "It's a vehicle" Case Else $sMsgx = "What's that?" EndSwitch MsgBox(0, $sMsg, $sMsgx) If "apple" <= $sMsg And $sMsg <= "banana" Then $sMsgx = "It's a fruit" ElseIf "table" <= $sMsg And $sMsg <= "bed" Then $sMsgx = "It's a furniture" ElseIf "Tricycle" <= $sMsg And $sMsg <= "Car" Then $sMsg = "It's a vehicle" Else $sMsgx = "What's that?" EndIf MsgBox(0, $sMsg, $sMsgx) Strings are compared lexicographically over case-insensitive UTF-2 character set. How is that difficult to understand? Conditions where <begin> is greater than <end> in a range are simply ignored, irrelevant of datatype(s). Only the implementation --possibly using a buggy jump table or something fancy but wrong-- differs from a sequence of tests. Change "banana" into "zebra" and see by yourself that is works fine, neglecting the fact that a zebra is not a fruit. SmOke_N, Thanks for providing an example which demonstrates that Switch unsurprisingly behaves exactly as common sense would expect: _Test(65) _Test("A") Func _Test($v) Switch $v Case 65 MsgBox(64, "Info", "There are " & $v & " things I want to do today.") Case "A" ; if "A" To "Z" worked even, I just wanted a single char example MsgBox(64, "Info", "My name has an " & $v & " in it.") EndSwitch EndFunc1 point
-
pixelsearhch, do.. until...
Bert reacted to Blue_Drache for a topic
Searching to exclude black and red pixels because they make his program go to a wrong function? Poker bot anyone? His prior posts were locked because he was interacting with a game. Which is why he will be as vague as possible. Which is also why no one should help him.1 point