Leaderboard
Popular Content
Showing content with the highest reputation on 11/18/2021 in all areas
-
[Question] Why `send('#L') ` does not work?
SkysLastChance and one other reacted to Nine for a topic
I do not know why Send("#L") does not work. I remember a previous discussion about it. And it seems it is still not working (tested on Win7). But you can use : _WinAPI_LockWorkStation()2 points -
Works well on 2 advanced WD automation also with my capabilities UDF.1 point
-
Decibel, Glad you like it - I will release a new version soon. M231 point
-
I assume you tested it and all is working so just updated the first post in the thread with your update.1 point
-
@Jos The topic below, posted by @zeehteam, identified a slight flaw in the json_get and json_put functions as it relates to handling key names that are provided using a string. The regular expressions used to identify dot and bracket notations are a little too narrow. Basically, the current regular expressions do not allow valid key names that have embedded right brakets ("[") in them. Although such key names are odd and rare, they are valid. The attached json udf has slightly modified versions of json_get() and json_put() for your review. The only modification to the 2 functions is in how they identify and parse the notations in order to be more fully compliant with the standard. Basically, it assumes that there are 4 types of notations: Dot-notation using a literal value (ex. .name) Dot-notation using a string value (ex. ."name") Bracket-notation using a literal value (ex. [name]) Bracket-notation using a string value (ex. ["name"]) Indexes that are passed are correctly handled as bracket-notation using a literal (ex. [0]). To make it easier to maintain in the future, the only modifications to the 2 functions are at the very beginning where the notations are identified. The rest of the logic in json_get and json_put remained the same. The following example and output, using the modified functions, shows that the functions are correctly handling existing functionality and the ability to handle the new functionality. #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d #include <Constants.au3> #include <MyIncludes\json\json (modified).au3> ;<== change to your location Const $JSON = _ '{ ' & _ ' "project": "Listing droids", ' & _ ' "version": "1.0", ' & _ ' "hasErrors": false, ' & _ ' "author": { ' & _ ' "name": "Luke", ' & _ ' "mail": "luke@2080.org" ' & _ ' }, ' & _ ' "[[[/script/droids]]]": [ ' & _ ' { ' & _ ' "name": "R2D2", ' & _ ' "type": "Astromecano", ' & _ ' "size": "0,96m" ' & _ ' }, ' & _ ' { ' & _ ' "name": "BB8", ' & _ ' "type": "Astromecano", ' & _ ' "size": "0,67m" ' & _ ' } ' & _ ' ] ' & _ '} ' json_example() Func json_example() Local $oJSON Local $Key, $Value $oJSON = Json_Decode($JSON) If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Decode error - @error = " & @error) ;Get values $Key = '."[[[/script/droids]]]"[0].name' $Value = Json_Get($oJSON, $Key) ConsoleWrite($Key & " = " & $Value & @CRLF) $Key = '["[[[/script/droids]]]"][0][name]' $Value = Json_Get($oJSON, $Key) ConsoleWrite($Key & " = " & $Value & @CRLF) $Key = '.author."name"' $Value = Json_Get($oJSON, $Key) ConsoleWrite($Key & " = " & $Value & @CRLF) $Key = '[author]["name"]' $Value = Json_Get($oJSON, $Key) ConsoleWrite($Key & " = " & $Value & @CRLF) ;Put values $oJSON = "" json_put($oJSON, '.description', "test json dataset") json_put($oJSON, '.author', "TheXman") json_put($oJSON, '."[[test]]"[0].name', "test name 1") json_put($oJSON, '."[[test]]"[0].number', 1) json_put($oJSON, '."[[test]]"[0].boolean', True) json_put($oJSON, '."[[test]]"[0].null_value', Null) json_put($oJSON, '["[[test]]"][1][name]', "test name 2") json_put($oJSON, '["[[test]]"][1][number]', 2.5) json_put($oJSON, '["[[test]]"][1][boolean]', False) json_put($oJSON, '["[[test]]"][1][null_value]', Null) ConsoleWrite(@CRLF) ConsoleWrite(Json_Encode($oJSON, $JSON_PRETTY_PRINT) & @CRLF) EndFunc Output ."[[[/script/droids]]]"[0].name = R2D2 ["[[[/script/droids]]]"][0][name] = R2D2 .author."name" = Luke [author]["name"] = Luke { "description": "test json dataset", "author": "TheXman", "[[test]]": [ { "name": "test name 1", "number": 1, "boolean": true, "null_value": null }, { "name": "test name 2", "number": 2.5, "boolean": false, "null_value": null } ] } Json (modified).au31 point
-
(Solved) Need help with Variabel to numbers
SkysLastChance reacted to JockoDundee for a topic
I could see this coming in handy1 point -
.. and attached to your underarms.1 point
-
How to convert an Autoit project to C++ or python
argumentum reacted to RTFC for a topic
Yes, you can find it between your ears.1 point -
OK, thanks for the advice on _WD_Window. I think i got it working: _WD_Window($sSession, 'Switch', '{"handle":"' & $sTab1 & '"}') $Source = _WD_GetSource($sSession) FileWrite("in1.temp", $Source) _WD_Window($sSession, 'Switch', '{"handle":"' & $sTab2 & '"}') $Source = _WD_GetSource($sSession) FileWrite("ri1.temp", $Source) _WD_Window($sSession, 'Switch', '{"handle":"' & $sTab3 & '"}') $Source = _WD_GetSource($sSession) FileWrite("re1.temp", $Source) You talked about retrieving InnerText property of the body element, can you give me a generic example on how to do that? Sorry, I'm new to this UDF and am trying to integrate it in an alder script that used _IE Another question, i noticed the when i use _WD_Window($sSession, "minimize", "") It minimizes the window, but as soon as i focus on another tab it shows the window again. Is there a property to keep it minimized or even hidden?1 point
-
@Danp2 If I connect to a new tab and reconnect to the previous tab I can not get the text of the alert My Code: _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, 'http://google.com') _WD_ExecuteScript($sSession, 'window.open()','{}') $Handle = _WD_Window($sSession, 'handle', '') ;Sleep(500) _WD_NewTab($sSession, True) Sleep(500) _WD_Window($sSession, 'Switch' ,'{"handle":"' & $Handle & '"}') Sleep(500) _WD_ExecuteScript($sSession, "alert('testing 123')") Sleep(1000) $aHandles = _WD_Window($sSession, 'handles', '') $sTabHandle = $aHandles[UBound($aHandles) - 1] _WD_Window($sSession, 'Switch', '{"handle":"' & $sTabHandle & '"}') Sleep(1000) _WD_Window($sSession, 'Switch' ,'{"handle":"' & $Handle & '"}') Sleep(1000) $Text = _WD_Alert($sSession, 'gettext') _WD_Alert($sSession, 'accept') MsgBox(0,'Test Alert Text',$Text) My Console: _WD_Alert: {"value":{"error":"no alert open","message":"(Session infochrome=64.0.3282.140)","stacktrace":"Backtrace:\n\t(No symbol) [0x0117C2F0]\n\t(No symbol) [0x0116473D]\n\t(No symbol) [0x01133D93]\n\t(No symbol) [0x0113045D]\n\t(No symbol) [0x010F3CA3]\n\t(No symbol) [0x01115B6A]\n\t(No symbol) [0x010F38F7]\n\t(No symbol) [0x011159FB]\n\t(No symbol) [0x011006B4]\n\t(No symbol) [0x01101C86]\n\t(No symbol) [0x01101C09]\n\tGetHandleVerifier [0x01196C37+62007]\n\t(No symbol) [0x01180453]\n\t(No symbol) [0x0114CF76]\n\t(No symbol) [0x0114D365]\n\t(No symbol) [0x0114D47E]\n\t(No symbol) [0x01182527]\n\t(No symbol) [0x0114CCBF]\n\t(No symbol) [0x0114DFBF]\n\t(No symbol) [0x01149D6B]\n\t(No symbol) [0x01149EC3]\n\t(No symbol) [0x0115BEB9]\n\tBaseThreadInitThunk [0x7703336A+18]\n\tRtlInitializeExceptionChain [0x77569882+99]\n\tRtlInitializeExceptionChain [0x77569855+54]\n"}}1 point
-
A long time afterwards, thanks a lot for your script! I needed the same functions, so I made some improvments to your tool: - some CommandLine arguments added - Horizontally merge available - One file can be self-merged - Fixed the case one file was missing, _GDIPlus_ImageGetWidth($h) reported 4294967295 (-1), now manually set to 0 - Deprecation of attached IniFile, replaced by CommandLine arguments To be done : - Better "help" CommandLine message (obtained by "?", "/?", "-?", "--?", "h", "/h", "-h", "--h", "help", "/help", "-help", or "--help" parameter) - Transformations on the merged files (mirroring, inverting colours) - (English translation of some line comments ^^) [Removed Code block, too long] ~ http://pastebin.com/NbtbJvfK Thanks a lot for all !1 point