Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/07/2019 in all areas

  1. Done! Version 0.4.0.0 has a new function: _OLT_CSV_Import
    2 points
  2. @robertocm Here how I would simplify your GUIs : #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPISysWin.au3> ;Create a GUI. Local $hGUI1 = GUICreate("Example GUI1") ;Create a button. Local $iButton1 = GUICtrlCreateButton("Button1", 10, 10, 80, 22) ;Display the GUI GUISetState(@SW_SHOW, $hGUI1) ;Set the accelerator key Global $aAccelKeys[1][2] = [["{TAB}", $iButton1]] GUISetAccelerators($aAccelKeys) ;Create a GUI. Local $hGUI2 = GUICreate("Example GUI2", 300, 300, -1, -1, -1) ;, $WS_EX_MDICHILD, $hGUI1) $cInput_1 = GUICtrlCreateInput("", 10, 10, 100, 20) $cInput_2 = GUICtrlCreateInput("", 10, 50, 100, 20) ;Create a button. Local $iButton2 = GUICtrlCreateButton("Button2", 10, 80, 80, 22) ;Set the accelerator key Local $aAccelKeys2[1][2] = [["{TAB}", $iButton2]] GUISetAccelerators($aAccelKeys2) ;Initialize a Local variable. Local $aMsg = 0 While 1 ;Assign to $aMsg the advanced GUI messages. $aMsg = GUIGetMsg(1) ;Switch from GUIs Switch $aMsg[1] Case $hGUI1 ;The event comes from the GUI1 ;Switch from event ID Switch $aMsg[0] Case $GUI_EVENT_CLOSE ExitLoop Case $iButton1 GUISwitch($hGUI2) GUISetState(@SW_DISABLE, $hGUI1) GUISetState(@SW_SHOW, $hGUI2) GUICtrlSetState($iButton2, $GUI_FOCUS) EndSwitch Case $hGUI2 ;The event comes from the GUI2 ;Switch from event ID Switch $aMsg[0] Case $GUI_EVENT_CLOSE, $iButton2 If $aMsg[0] = $GUI_EVENT_CLOSE or _WinAPI_GetFocus() = GUICtrlGetHandle($iButton2) Then GUISwitch($hGUI1) GUISetState(@SW_HIDE, $hGUI2) GUISetState(@SW_ENABLE, $hGUI1) GUICtrlSetState($iButton1, $GUI_FOCUS) Else ControlSend ($hGUI2, "", "", "^{TAB}") EndIf EndSwitch EndSwitch WEnd
    1 point
  3. But I think he tries to automate the GUI again by activating the found cell. Using _Excel_RangeCopyPaste is the way I'd suggest.
    1 point
  4. @water I assumed he was copying from a third-party product, since the copy occurred prior to Excel being opened. @_leo_ Just use $sFinal[0][2] to get the result local $aResult = _Excel_RangeFind ($oWorkbook, $sNummername, "A3:A56") sleep(1000) $oWorkBook.ActiveSheet.Range ($aResult[0][2]).Activate
    1 point
  5. local $aSuchergebnis = _Excel_RangeFind ($oWorkbook, $sNummername, "A3:A56") If @error Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error finding value") $oWorkBook.ActiveSheet.Range ($aSuchergebnis[0][2]).Activate Try this
    1 point
  6. I strongly suggest to not mix the Excel UDF (uses COM to interact with Excel) and GUi automation like Send, ControlSend etc. Most (if not all) things you can do with GUI automation can be done using COM. But COM does not interfere with the user and is much easier to debug. Just my 2 cents worth
    1 point
  7. To make your script more robust, you can use excel method instead of using Send to maximize the window like this : Const $xlMaximized = -4137 $oExcel.WindowState = $xlMaximized
    1 point
  8. I am being serious so do not see any reason why to tag my last post with a HAHA smiley!
    1 point
  9. Seriously? So you simply want to override the existing file and you couldn't find the solution yourself when looking at Please learn to open the helpfile before posting questions as you have been around long enough to be able to solve stuff yourself. remember? : Jos
    1 point
  10. oemript, And if you look in the Help file for FileOpen what flags can you see which you might use other than $FO_APPEND and which might do what you want? M23
    1 point
  11. Why are you searching for a colllection when you only want to get the Classname of a specific ID? Isn't this what you want: Global $oIE = _IECreate("https://financials.morningstar.com/ratios/r.html?t=0P0001648D&culture=en&platform=sal") Local $oID = _IEGetObjById($oIE, "star_span") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $oID.ClassName = ' & $oID.ClassName & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Jos
    1 point
  12. _Excel_RangeFind returns either a 2D Array of the results or error (see help file for return values). Use _ArrayDisplay (requires #include <Array.au3> to show you the results. Also try to use ControlSend rather than Send, Send can have be unpredictable, whereas ControlSend is targeted and less likely to have any issues.
    1 point
  13. Here, ASCII means ASCII, i.e. [0x00..0x7F] and not "Extended ASCII". What the StrngRegexp doc doesn't say is that in UCP mode [:print:] cover the whole range of printable codepoints of UCS2 charset (= Unicode BMP). Local $s For $i = 0x00 To 0x3FF ; put some low limit $s &= ChrW($i) Next $s = StringRegExpReplace($s, "(*UCP)[[:^print:]]", "") Local $a = StringToASCIIArray($s) For $c In $a $cw(Hex($c, 4) & @TAB & ">" & ChrW($c) & "<") Next Edit1: Other POSIX classes change when UCP is enabled, something which is not explicitely mentionned in our doc: [:space:] [:graph:] [:punct:] Edit2: It's noticeable that [:cntrl:] even in UCP mode doesn't cover the range of C1 control characters [0x80..0x9F] ∪ [0xAD]. That may have changed with more recent versions of PCRE1 and all PCRE2 versions. Edit3: ticket #3725 posted in Trac
    1 point
  14. jackylee0908, Certainly it is possible - look at the ScreenCapture library in the standard includes. M23
    1 point
  15. Modified the Readme.txt. What do you think?
    1 point
  16. Referring to following link, I would like to know on how to write string into file without append option, so the file should only contain "Line 4". Local Const $sFilePath = "D:\test.txt" Local $hFileOpen = FileOpen($sFilePath, $FO_APPEND) ; Write data to the file using the handle returned by FileOpen. FileWrite($hFileOpen, "Line 2") FileWrite($hFileOpen, "This is still line 2 as a new line wasn't appended to the last FileWrite call." & @CRLF) FileWrite($hFileOpen, "Line 3" & @CRLF) FileWrite($hFileOpen, "Line 4") ; Close the handle returned by FileOpen. FileClose($hFileOpen) Does anyone have any suggestions? Thanks in advance for any suggestions https://www.autoitscript.com/autoit3/docs/functions/FileWrite.htm
    0 points
×
×
  • Create New...