Leaderboard
Popular Content
Showing content with the highest reputation on 04/28/2019 in all areas
-
1 point
-
You're using RunWait, which means the script pauses until the program started with the Run closes. Then the rest of the script runs, so those commands aren't going to the right window, because Edge is not running any longer.1 point
-
Just disable the $Start button, then use an GuiSetOnEvent for $Option1 and $Option2 to enable the start button e.g. this way, they must choose one of the options before pushing the start button. Also for the Startallrun() function you only need to know which option is checked see example below. nb: I've prefixed my variables with $id to show that they're control ids. idOption1 = GUICtrlCreateRadio("Option 1", 10, 10, 120, 20) GUICtrlSetOnEvent($idOption1,"_EnableStart") $idOption2 = GUICtrlCreateRadio("Option 2", 10, 40, 120, 20) GUICtrlSetOnEvent($idOption2,"_EnableStart") $idStart = GuiCtrlCreateButton("Select Radio Above", 10, 70, 120, 50,bitor($BS_CENTER,0,0)) GUICtrlSetOnEvent($idStart,"Startallrun") GUICtrlSetState($idStart, $GUI_DISABLE) Func _EnableStart() GUICtrlSetState($idStart, $GUI_ENABLE) EndFunc Func Startallrun() If GUICtrlRead($idOption1) = $GUI_CHECKED Then MsgBox(4096, "Starting", "Running Option 1") ElseIf GUICtrlRead($idOption2) = $GUI_CHECKED Then MsgBox(4096, "Starting", "Running Option 2") EndIf EndFunc1 point
-
That can be any expression. It gets converted to a string if necessary.1 point
-
Only a little? You should have seen the Rube Goldberg machine I refined to that.1 point
-
ICU is a really huge hog and doesn't easily solve all the issues that arise in practice with Unicode. By mere curiosity, why do you think you need a set of functions for UTF8? As far as I can think, this is more or less all you need: Func _CodepageToString($sCP, $iCodepage = Default) If $iCodepage = Default Then $iCodepage = Int(RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Nls\Codepage", "OEMCP")) Local $tText = DllStructCreate("byte[" & StringLen($sCP) & "]") DllStructSetData($tText, 1, $sCP) Local $aResult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $iCodepage, "dword", 0, "struct*", $tText, "int", StringLen($sCP), _ "ptr", 0, "int", 0) Local $tWstr = DllStructCreate("wchar[" & $aResult[0] & "]") $aResult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $iCodepage, "dword", 0, "struct*", $tText, "int", StringLen($sCP), _ "struct*", $tWstr, "int", $aResult[0]) Return DllStructGetData($tWstr, 1) EndFunc ;==>_CodepageToString Func _StringToCodepage($sStr, $iCodepage = Default) If $iCodepage = Default Then $iCodepage = Int(RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Nls\Codepage", "OEMCP")) Local $aResult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "uint", $iCodepage, "dword", 0, "wstr", $sStr, "int", StringLen($sStr), _ "ptr", 0, "int", 0, "ptr", 0, "ptr", 0) Local $tCP = DllStructCreate("char[" & $aResult[0] & "]") $aResult = DllCall("Kernel32.dll", "int", "WideCharToMultiByte", "uint", $iCodepage, "dword", 0, "wstr", $sStr, "int", StringLen($sStr), _ "struct*", $tCP, "int", $aResult[0], "ptr", 0, "ptr", 0) Return DllStructGetData($tCP, 1) EndFunc ;==>_StringToCodepage Supply 65001 as codepage to convert to/from UTF8 to native strings. It's trivial to change the default codepage to UTF8 instead of OEM. Convert your UTF8 or codepage input data to native strings, process and massage them ad nauseam, convert them if necessary to ouput codepage and you're done.1 point
-
You examplify nested arrays, while I refer to sub-arrays: Local $a[5][3][2] = [ _ [[789, -12], [19, 41], [-1578, -320]], _ [[1476, 456], [4016, 15], [5821, 748]], _ [[-478, 687], [546, 78], [210, 65]], _ [[5641, 781], [56, 345], [2846, 45612]], _ [[-7845, 164], [14, -9], [168, 4894]], _ ] ; subarray Local $aSub = $a[2] ; that should be [[-478, 687], [546, 78], [210, 65]] Suppose you want to write an UDF that takes an array as argument, whose dimension may be anything from 1 to 24 (the practical upper number of dimensions for an AutoIt array). Say it's a sort or something that requires changing the order of elements in the array. Your code will have to look like this (don't focus on the operation actually being done here, just at the huge Switch and ridiculously nested loops):1 point
-
Native AutoIt strings use UCS2, i.e. a subset of UTF16-LE restricted to the BMP. AutoIt File* functions can detect (read) or be forced to write UTF8 files, depending on options. The resulting data read will be UCS2 encoded (except if reading binary of course). I suspect it does read UTF8 correctly. A single codepoint can use from 1 to 4 bytes in UTF8 whereas it consists of only one 16-bit word in UCS-2 and 1 to 2 16-bit words in UTF16. Hence there is no surprise that in general [UTF8 file byte count] ≠ [UCS2 codepoints] During AutoIt internal UTF-8 to UCS2 conversion, codepoints above the BMP are emasculated since they would need an extra 16-bit word to represent in UTF-16. Said otherwise, AutoIt doesn't recognize and handle UTF16 surrogates. This may be a serious problem for people who use the growing number of planes/blocks for the script (= writing script) they use (SMP, SIP, SSP, private planes). Yet the BMP allows to encode a large number of scripts: https://en.wikipedia.org/wiki/Unicode_block That said, AutoIt offers ways to convert to/from any two of {UCS2, UTF8, ANSII (any codepage), Windows(any codepage), OEM, double-byte and any codepage supported by your Windows version}. It is also possible to build strings in "beyond BMP" UTF16-LE (manually or programmatically), which Windows or other Unicode-aware applications will handle gracefully, provided the appropriate font(s) is used. But keep in mind that most AutoIt string functions won't handle UTF16 surrogates correctly. This site offers a load of information, examples, data, applets about Unicode: https://r12a.github.io/scripts/tutorial/part3 (also check docs and apps links.) Don't hesitate to post if you encounter any encoding issue. NOTE about Unicode planes: BMP = Basic Multilingual Plane SMP = Supplementary Multilingual Plane SIP = Supplementary Ideographic Plane SSP = Supplementary Special-purpose Plane1 point
-
Zag8888, Firstly, how about posting some runnable code rather then a snippet. Then, how about explaining what you are trying to do and what is not working so we can see how we might help you. At the moment it is a bit hard to offer suggestions when we have no idea where the problem actually lies. M231 point
-
Getting ProcessList of only 1Application
FrancescoDiMuro reacted to Melba23 for a topic
Bishop12, And how is this different from the thread you started yesterday and which was locked? Other than in leaving out the game references - which the Forum rules make quite clear is not allowed. M23 P.S. And just to be absolutely clear (as some still seem to have recognising what is going on) - this is the Mod team determining the legality of the thread, so everyone else please keep out.1 point -
AutoIt arrays show a number of limitations, making some algorithms really painful to code. No sub-array access Execute can't process array declarations No array literal (dismissed featured) Many array functions use a count in [0] (pointless) Possibly other points I overlook right now1 point
-
@Nine I believe the issue is related to browser restrictions limiting access to cross-domain elements. I was actually able to make it work by navigating to the domain that contains the desired data -- #include <IE.au3> #include <array.au3> $oIE = _IECreate("https://www.cmegroup.com/trading/interest-rates/countdown-to-fomc.html") _IENavigate($oIE, "https://cmegroup-tools.quikstrike.net/User/QuikStrikeView.aspx?viewitemid=IntegratedFedWatchTool") $oTable = _IETableGetCollection($oIE, 4) $aData = _IETableWriteToArray($oTable) _ArrayDisplay($aData)1 point
-
Hi guys sorry for my question i already search and search and search many t imes i did all my best but i cant see what im looking for so i decided to picture what i want to do and i dont know how can i do that too or is it possible to do in autoit im trying to get process list of application cause im trying to make like in browser or game i want to have a process list or list of games i mean is example like i have 3 games open so i want that 1 applcation to attach only that application and i will open my 2nd application to attach in to my new attach i mean i want 1 application attach to 1 autoit or it can be attouch to or more i want is that auto it will focus on 1 games even i close and i want to open new application and get process of that application so that my code will only work into that application sorry for my bad explanation cause i dont know how i will ask it and i dont know if its would work in autoit ? little bit newbie and already came little bit far on using autoit thankyou for respect and answer please help0 points