Leaderboard
Popular Content
Showing content with the highest reputation on 01/18/2018 in all areas
-
AutoIT Script Converter
water and one other reacted to Earthshine for a topic
no such thing. the converter would be you.2 points -
Help How to delete the same text in AutoIt ?
benners and one other reacted to AspirinJunkie for a topic
Maybe with StringRegExpReplace: https://regex101.com/r/z6BWJD/12 points -
StringRegExpReplace($txt, "(?m)^\s*$\R?", "") ?2 points
-
This one also corrects the capitalization of 'line' while we are being all needy ConsoleWrite(stringreplace(StringStripWS(StringReplace(StringStripCR(FileRead("txt.txt")) , @LF & @LF , @CRLF) , 4) , @LF & "l" , @LF & "L"))1 point
-
Tweaked for the last time #include <StringConstants.au3> Local $s_Delete = InputBox("Enter", "Enter what you want to delete") If @error Then Exit Local $h_FileOpen = FileOpen(@ScriptDir & "\TXT.txt", 2) FileWrite($h_FileOpen, StringRegExpReplace(StringRegExpReplace(StringReplace(FileRead(@ScriptDir & "\OLD\TXTOLD.txt"), $s_Delete, ''), "(?m)^\s*$\R?", ""), '(?m)^\s+|\s+\Z', '')) FileClose($h_FileOpen)1 point
-
another one Local $s = @CRLF & "One" & @CRLF & @CRLF & "Two" & @CRLF & "Three" & @CRLF & @CRLF & _ "Four" & @CRLF & "" & @CRLF & "Five" & @CRLF & "Six" & @CRLF & "" & @CRLF & "" & @CRLF ConsoleWrite( StringRegExpReplace($s, "^\R+|\R+$|\R\K\R+", "") )1 point
-
DSA.MSC
Earthshine reacted to water for a topic
Why automate the GUI? Use my AD UDF to directly access Active Directory.1 point -
Parse through csv file and fill out form
Earthshine reacted to BigDaddyO for a topic
he will have to try it. In my experience with companies that Use Citrix, especially Health Care, the security dept is overly controlling and blocks everything possible. In my case, applications have to be launched from a local system drive, not from a network location.1 point -
Using mikell's SRE you could try this $Inputbox = InputBox("Enter", "Enter what you want to delete", "", "") If @error Then Exit Local $s_FileRead = FileRead(@ScriptDir & "\OLD" & "\TXTOLD.txt") Local $h_FileOpen = FileOpen(@ScriptDir & "\" & "TXT.txt", 2) FileWrite($h_FileOpen, StringRegExpReplace(StringReplace($s_FileRead, $Inputbox, ''), "(?m)^\s*$\R?", "")) FileClose($h_FileOpen)1 point
-
Like this? Local $s = @CRLF & "One" & @CRLF & @CRLF & "Two" & @CRLF & "Three" & @CRLF & @CRLF & _ "Four" & @CRLF & "" & @CRLF & "Five" & @CRLF & "Six" & @CRLF & "" & @CRLF & "" & @CRLF ConsoleWrite(StringRegExpReplace($s, "(?m)(\A\R)|(\R(?=\R|\z))", "") & @LF) This regexp removes leading, extra, trailing line breaks.1 point
-
Of course... your code splits the text to an array, and a StringRegExpReplace (or else) will not delete the array elements containing blank/empty lines Just FileRead the txt, apply the SRER to the whole string without splitting, and FileWrite the result1 point
-
AutoIT Script Converter
Earthshine reacted to antmar904 for a topic
thanks! I got the same results with the extra character "[]" and removed it from the output: import socket for IP in open('/root/Desktop/ip.txt').readlines(): try: host = socket.gethostbyaddr(IP.rstrip()) hostname = host[0] print(IP.rstrip(),hostname) except Exception as e: print(IP.rstrip(),"NULL") Output: ('1.1.1.1', 'hostname.domain') ('2.2.2.2', 'hostname.domain')1 point -
Parse through csv file and fill out form
Earthshine reacted to BigDaddyO for a topic
I have worked with Citrix a lot, and it's a giant PITA. You won't be able to interact with it from outside, so if your using Citrix Desktops, you have to write your script & run your script from inside a citrix session. If your launching a published app, your pretty much out of luck, unless you can convince your Citrix team to turn your script into a published app.1 point -
You have to activate anti aliasing. #include <GDIPlus.au3> Text2PNG(@DesktopDir & "\MyPNG.png", 0x00FFFFFF) ; Transparent but bold ugly text ;Text2PNG(@DesktopDir & "\MyPNG.png", 0xFFFFFFFF) ; Nice Text but not transparent Func Text2PNG($sFile, $iColor) _GDIPlus_Startup() Local $hImage = _GDIPlus_BitmapCreateFromScan0(50, 25) Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetTextRenderingHint($hGraphics, $GDIP_TEXTRENDERINGHINT_ANTIALIAS) _GDIPlus_GraphicsClear($hGraphics, $iColor) _GDIPlus_GraphicsDrawString($hGraphics, "Hello", 0, 0, "Arial", 12, 0) _GDIPlus_ImageSaveToFile($hImage, $sFile) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() EndFunc ;==>Text2PNG1 point
-
Close...here is a way to limit the div's you select....you can also instead get all the child elements, and loop through those... $oDiv = _IEGetObjById($oIE,"past-queue-wrapper") $oChildDivs = _IETagNameAllGetCollection($oDiv,"div") For $oChildDiv In $oChildDivs ConsoleWrite($oChildDiv.classname & @TAB & $ochilddiv.id & @CRLF) Next1 point
-
Winactive Regexp
Miliardsto reacted to jdelaney for a topic
Edit: syntax error: #include <Array.au3> $a = WinList("[REGEXPTITLE:\A[a|b|c|d|e|f]]") _ArrayDisplay($a) Assuming you mean that the starting character can be a, b, c, d, e, or f....correct? Otherwise, this works...if it's just a string: AutoItSetOption("WinTitleMatchMode",1) ; this is not necessary, as 1 is the default...unless you have changed this setting earlier in your script. WinActivate("abcdef")1 point -
or this one msgbox(0, '' , StringReplace(StringStripCR(FileRead("txt.txt")) , @LF & @LF , ""))1 point
-
How can I use WPF controls in Autoit?
Earthshine reacted to Danp2 for a topic
Have you reviewed this thread?1 point -
StringReplace(StringReplace(StringReplace($sFile , @CRLF , "|") , "||" , "") , "|" , @CRLF)) ?! also with a flurry of array funcs? #include<array.au3> $arr = FileReadToArray("test.txt") _ArrayDelete($arr , _ArrayToString(_ArrayFindAll($arr , "") , ";")) _ArrayDisplay($arr)1 point
-
Read the file to an array using FileReadToArray Remove the duplicates with _ArrayUnique Then process the array returned by _ArrayUnique to do what you want with the links1 point
-
The flag you used with StringStripWS will remove all spaces in the text. This works OK for the example you posted but if the line you want to keep has spaces between the words like, "I have spaces", it will become "Ihavespaces" when written to the file1 point
-
Search here for associative array, or scripting.dictionary.1 point
-
ControlSend script blocking bug?
milos83 reacted to alienclone for a topic
this reproduced the error for me and you are correct, it is hanging at controlsend. did not realize that my act of changing focus was the reason the script was finishing for me.1 point -
screenshot region
floyderman3d reacted to Melba23 for a topic
hendrikhe, Here are 2 fairly old scripts from my Snippets folder - I have posted them before several times. The first marks a red rectangle, while the second creates a transparent rectangle, the contents of which are stored in a file and then displayed: Please ask if you have any questions. M231 point -
Auto-Delete Script immediately after work is done?
MadJunk reacted to The Kandie Man for a topic
Like this: Func Uninstall() ;delete all you files here Local $s_RemoveBat = @TempDir & "\remove.bat" Local $h_RemoveBat = FileOpen($s_RemoveBat, 2) FileWrite($h_RemoveBat, ":start" & @CRLF & 'del "' & @AutoItExe & '"' & @CRLF & 'IF EXIST "' & @AutoItExe & '" goto start' & @CRLF & 'del "' & $s_RemoveBat & '"') FileClose($h_RemoveBat) Run($s_RemoveBat, "", @SW_HIDE) EndFunc1 point