Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. ; https://www.autoitscript.com/forum/topic/211837-gui-richedit-control-showing-symbols/#comment-1533262 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiRichEdit.au3> Global $hGUI, $btnRemoveTabs, $editBox Local $sTxt = "" $sTxt &= "Func Example()" & @CRLF $sTxt &= "" & @CRLF $sTxt &= @TAB & "$hGUI = GUICreate(""Remove Tabs"", 1000, 800)" & @CRLF $sTxt &= "" & @CRLF $sTxt &= @TAB & "$editBox = _GUICtrlRichEdit_Create($hGUI,"""", 10, 10, 980, 700)" & @CRLF $sTxt &= @TAB & @TAB & @TAB & "_GUICtrlRichEdit_SetFont($editBox, 12)" & @CRLF $sTxt &= @TAB & "GUICtrlSetData(-1, """")" & @CRLF $sTxt &= "" & @CRLF $sTxt &= @TAB & "$btnRemoveTabs = GUICtrlCreateButton(""Remove Tabs & CRLFs"", 400, 730, 200, 30)" & @CRLF $sTxt &= @TAB & "GUICtrlSetState(-1, $GUI_FOCUS)" & @CRLF $sTxt &= "" & @CRLF $sTxt &= @TAB & "GUISetState(@SW_SHOW)" & @CRLF $sTxt &= "" & @CRLF $sTxt &= @TAB & "While 1" & @CRLF $sTxt &= @TAB & @TAB & "Switch GUIGetMsg()" & @CRLF $sTxt &= @TAB & @TAB & "Case $GUI_EVENT_CLOSE" & @CRLF $sTxt &= @TAB & @TAB & @TAB & "ExitLoop" & @CRLF $sTxt &= @TAB & @TAB & "Case $btnRemoveTabs" & @CRLF $sTxt &= @TAB & @TAB & @TAB & "Local $sInput = GUICtrlRead($editBox)" & @CRLF $sTxt &= @TAB & @TAB & @TAB & "RemoveTabs($sInput)" & @CRLF $sTxt &= @TAB & @TAB & "EndSwitch" & @CRLF $sTxt &= @TAB & "WEnd" & @CRLF $sTxt &= "" & @CRLF $sTxt &= @TAB & "GUIDelete()" & @CRLF $sTxt &= "EndFunc" & @CRLF Example($sTxt) ;-------------------------------------------------------------------------------------------------------------------------------- Func Example($sTxt) $hGUI = GUICreate("Remove Tabs", 1000, 800) $editBox = _GUICtrlRichEdit_Create($hGUI, $sTxt, 10, 10, 980, 700) _GUICtrlRichEdit_SetFont($editBox, 12) GUICtrlSetData(-1, "") $btnRemoveTabs = GUICtrlCreateButton("Remove Tabs & CRLFs", 400, 730, 200, 30) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btnRemoveTabs Local $sInput = RemoveTabs(_GUICtrlRichEdit_GetText($editBox)) EndSwitch ConformEdit() Sleep(50) WEnd GUIDelete() EndFunc ;==>Example ;-------------------------------------------------------------------------------------------------------------------------------- Func RemoveTabs($sInput) Local $sOutput = $sInput $sOutput = StringReplace($sOutput, "→", "") $sOutput = StringReplace($sOutput, "↭", "") ClipPut($sOutput) SplashTextOn("Done", "Tabs removed and saved to clipboard!", 300, 50, -1, -1, 3) Sleep(1000) SplashOff() Return $sOutput EndFunc ;==>RemoveTabs ;-------------------------------------------------------------------------------------------------------------------------------- Func ConformEdit() Local Static $sCurTxt Local $sNewTxt, $aiSel $aiSel = _GUICtrlRichEdit_GetSel($editBox) $sNewTxt = _GUICtrlRichEdit_GetText($editBox) If $sCurTxt = $sNewTxt Then Return ConsoleWrite("..." & @CRLF) $sNewTxt = StringReplace($sNewTxt, @TAB, "→") $sNewTxt = StringReplace($sNewTxt, " ", "↭") ; ↭ ⇝ ↝ $sCurTxt = $sNewTxt _GUICtrlRichEdit_SetText($editBox, $sCurTxt) _GUICtrlRichEdit_SetSel($editBox, $aiSel[0], $aiSel[1]) EndFunc ;==>ConformEdit ;--------------------------------------------------------------------------------------------------------------------------------
  3. Today
  4. It's probably not a great way of going about things, but as a quick and dirty you could pop this in an adlib! Func UpdateEdit() Local $sNewTxt, $aiSel $aiSel = _GUICtrlRichEdit_GetSel($editBox) $sTxt = _GUICtrlRichEdit_GetText($editBox) $sNewTxt = StringReplace($sTxt, " ", ChrW(0x00B7)) $sNewTxt = StringReplace($sNewTxt, @TAB, ChrW(0x2192)) If $sTxt <> $sNewTxt Then _GUICtrlRichEdit_SetText($editBox, $sNewTxt) _GUICtrlRichEdit_SetSel($editBox, $aiSel[0], $aiSel[1]) EndIf EndFunc
  5. Hi all, here is release 1.7 of the UDF The main focus of this release was to bring in some MSC support, which is mainly used with lighting consoles. MSC can also (potentially) control things like fireworks, and flys/trusses etc. So in the unlikely event anyone is trying to do that, dont! (i.e. read the disclaimer in the helpfile) Changelog: - Added some Midi Show Control (MSC) support - Fixed issue where _midi_CloseOutput failed to close non-stream handles. - Fixed example scripts for sequence functions. - Updated reference list links in the helpfile. The midi.org site has been updated, which broke hyperlinks. - Modified internals for _midi_PackSize
  6. Yesterday
  7. can you set up you program to search for multiple files with different names then copy them to another folder. i.e. *dog123 *dog542 *dog126 *dog1123
  8. woudl this program have the ability to search for multple files using a set oif searches? i.e. *filename1234.txt *filename1235.txt *filename1247.txt *filename1248.txt *filename2240.txt find all 5 of theses files then give you an option to copy them to another folder?
  9. Is there a way to show symbols in the rich edit control. In this case I'd like to create a richedit control that shows tabs and spaces: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiRichEdit.au3> Example() Func Example() Local $hGUI, $btnRemoveTabs, $editBox $hGUI = GUICreate("Remove Tabs", 1000, 800) $editBox = _GUICtrlRichEdit_Create($hGUI,"", 10, 10, 980, 700) _GUICtrlRichEdit_SetFont($editBox, 12) GUICtrlSetData(-1, "") $btnRemoveTabs = GUICtrlCreateButton("Remove Tabs & CRLFs", 400, 730, 200, 30) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btnRemoveTabs Local $sInput = GUICtrlRead($editBox) RemoveTabs($sInput) EndSwitch WEnd GUIDelete() EndFunc Func RemoveTabs($sInput) Local $sOutput $sOutput = StringReplace($sInput, @TAB, "") ClipPut($sOutput) SplashTextOn("Done", "Tabs removed and saved to clipboard!", 300, 50, -1, -1, 3) Sleep(1000) SplashOff() Return $sOutput EndFunc
  10. I am writing a script that needs to activate then move a Virtual Machine (using Hyper-V) window. The WinActivate function works fine. The window in question is brought to focus when that function is executed. Then I try to use WinMove to move the window. Even though the $success variable returns the $hWnd of the window (I would expect a zero if it didn't move the window), the window doesn't move. Then I try to use WinSetState to maximize the window without success. Same as with WinMove, $success returns the $hWnd of the window, not 0 and the window doesn't maximize. If I change the code to activate a non VM window it works fine and does everything in the script. Any ideas why the VM window won't move or resize via Autoit? Grab Codes Snippt.au3
  11. New Version -- v0.1.0 ** Added ** Spell Checker now can mark lines with misspelled words using a Margin marker also. Single Word check now will check the currently selected word. Script check now will be restrained to a selected portion if a selection exists. ClearSpChk function will now clear only a selection if one exists. ClearSpChk function now also clears the new Margin Markers also. Selected words that are single word spell checked can also be replaced using the drop down. ** Fixed ** Some apostrophied words not being correctly selected, such as "I'll". Some markings incorrectly included as part of the word at the beginning or end, such as dashes, quotations etc. Two if blocks in the program were incorrectly testing for nill, instead of nil. ** Changed ** Rewrote the word recognition method to work better and quicker. Seconds read out at end of Script is now maximum 4 characters long. Words to spell check are now directly written to the file, instead of to a table and then to a file, saving several milliseconds.
  12. I would download the portable version of AutoIt and SciTE. Then with the magic of ... ( I guess magic don't exist ). I would write a script that sets whatever I want. Edit: Couldn't see the picture hence my answer
  13. Hello, thanks for the response. I could see the registry key to select default option for .au3 files. But in 64bit machine, I get this below option to select native x64 or x86. How to select between these two options when installing silently? And how do we know which option is installed in the machine? Also, there is option to select required components in UI mode. How to select these components in Silent installation? Any switch to pass while installing?
  14. Last week
  15. inspired by AutoIt Help v3.3.16.1 with external CSS loading AutoItHelp.7z
  16. Ow, thanks for that. I am looking forward to check that UDFs. Have not been around much lately. I have to start learning RegEx proper way but I like also what you said about JSON UDFs...
  17. The string appears to be a JSON string. Have you already tried one of the corresponding JSON UDFs? This should be easier to understand and more stable than using RegEx.
  18. Hi Nine and thanks for trying to help. This version of a solution of yours leave ", "like_count" and , "author_id" after every line. I am very bad at regex so i dont know why but would like to see if you can correct it because your solution looks much more clear to me.
  19. Global $InputDatab = StringRegExp($InputDataa, '(?<="text": )(.+?)(?|, "like_count"|, "author_id")', 3) Try this.
  20. Hi sorry for bumping an old post but again i have a problem because site code changed. Everything worked fine but now there is a new line of code which unable this regex to work. Instead of "author_id" as closure now there is sometimes "like_count" instead of author_id which is still there but after much more code I dont need to extract. I did try to use delimiter in RegEx but I guess regex is not easy for me... Can someone just give me a suggestion how to make a regex which will say: Get text from here to (here or here). I did try to put it like this: Global $InputDatab = StringRegExp($InputDataa, '(?<=\"text\": \").*?(?=\", \"author_id\|like_count\")', 3) ...but it didnt work. Line instead of this was taking data from "text:" to "timestamp" Global $InputDatab = StringRegExp($InputDataa, '(?<=\"text\": \").*?(?=\", \"timestamp\")', 3) Here is an example of text which is in .info.json: So, now there are two lines which can be a closure for getting text: ', "like_count":' and ', "author_id":' How can I add in RegEx code that would do what i want? I did try it on my own with examples I found online but it does not work... Again much thanks in advance for this. Sorry, I just tried a bit more and solved a problem. Correct line is: Global $InputDatab = StringRegExp($InputDataa, '(?<=\"text\": \").*?(?=\", \"author_id|\", "like_count\")', 3) Thanks, sorry!
  21. @baselz, No sure why you quote my post? I gave you the reason why this must be failing, and you didn't respond at all to it. Try reading the answer again and in case you do not understand simply ask. PS: My comment isn't about the validity of the json, but the validity of the command you have formed. Cut and Paste the full command into a CMD window and check if it works.
  22. @baselz have you tried using: ?
  23. Again. If it runs well from the command line, it will do the same from a function in AutoIt but to believe that the failure is due to AutoIt is wrong. Humor me and run it at the command prompt. Basic troubleshooting.
  24. I run curl command using this function Local $result = Run(@ComSpec & " /c " & $curlCommand, "", @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($result) the Json is valid
  25. Have you checked what the contents of $curlCommand is and did you think it was valid? This runable version of your snipped: ; Construct JSON data $exitStatus = 0 $pluginOutput = "x" Local $jsonData = '{"exit_status": ' & $exitStatus & ', "plugin_output": "' & $pluginOutput & '"}' ; Send CURL command Local $curlCommand = 'curl -X POST -k -H "Content-type: application/json" -H "Accept: application/json" --data "' & $jsonData & '" "https://<URL>/v1/actions/process-check-result?service=.com!passive.setEnv_check"' ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $curlCommand = ' & $curlCommand & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console give this as output: @@ Debug(8) : $curlCommand = curl -X POST -k -H "Content-type: application/json" -H "Accept: application/json" --data "{"exit_status": 0, "plugin_output": "x"}" "https://<URL>/v1/actions/process-check-result?service=.com!passive.setEnv_check" Doubt that this part is valid: --data "{"exit_status": 0, "plugin_output": "x"}"
  1. Load more activity
×
×
  • Create New...