Leaderboard
Popular Content
Showing content with the highest reputation on 01/25/2021 in all areas
-
@Musashi In fact this simple variation does the job $text = StringRegExpReplace($text, 'File=\h*\K.+?(?=\.txt)', "ReplaceAllNewFilename") No need to mention any part of the initial filename - what is defined in the pattern after \K is replaced EDIT @youtuber This ([File=\s+]) is super incorrect ! You are using brackets, meaning a character class Even with a slightly amended expression like this '([File=\s+])DocumentName.(?=\.txt)' the result may seem good, but because of these brackets you include in the replacement one space (which is in the character class) just before "DocumentName" (in the result, there are 3 spaces remaining instead of 4 initially)2 points
-
I assume, that the extension (here : File= ... .txt) is significant for @youtuber , since he wrote "... (?=.txt)..." in his example. In this case, @FrancescoDiMuro 's objection would be justified. In the end, @youtuber now has enough variants at his choice, and he can select the most suitable one (EDIT : which he seems to have done in the meantime .)2 points
-
Assuming that the file is a .txt and the purpose is only to insert "New" there is another approach $text = "File= DocumentName.txt" & @CRLF & _ "Test= blabla.txt" & @CRLF & _ "Author= autoitscript.com" & @CRLF & _ "blabla.txt" $text = StringRegExpReplace($text, 'File=.+?\K(?=\.txt)', "New") msgbox(0,"", $text) Edit or even like this $text = "File= DocumentName.txt" & @CRLF & _ "File= DocumentName" & @CRLF & _ "File= DocumentName.doc" & @CRLF & _ "Test= blabla.txt" & @CRLF & _ "Author= autoitscript.com" & @CRLF & _ "blabla.txt" $text = Execute("'" & StringRegExpReplace($text, "File=.+?\K(?=\.txt|\.doc|\R)", "' & 'New' & '") & "'") msgbox(0,"", $text)2 points
-
Control Viewer - AutoIt Window Info Tool
mythicalzxc reacted to Yashied for a topic
LAST VERSION - 1.1 18-May-12 Control Viewer (CV) is a replacement of AutoIt Window Info with a number of advantages. I tried to stick to the interface of the last, so you almost do not have to be retrained. During testing, I never managed to find any controls that could not be identified by CV (on the contrary, shows a lot of hidden controls, especially for the system windows). The all program settings are stored in the following registry key: HKEY_CURRENT_USERSoftwareY'sControl Viewer The main differences CV from AWI Shows the complete list of all existing controls for the window that are interested (visible, hidden and deleted controls are displayed with different colors that can be changed to any other).Dynamically changing information during search for the windows and their controls.Ability to quickly switch between controls in the list.Ability to show/hide any controls from the list (useful for the overlaping controls).Information for the Style and ExStyle parameters shown in the form of hexadecimal values, and as its flags.Added the PID and Path parameters in the Window tab and ability to quickly open a folder that containing the process file.Added the coordinate system relative to the selected control.Shows a color of the selected pixel in RGB and BGR formats.Shows an example fill of the selected color.Ability to select the text encoding (affects the Text parameter in the Control tab).The complete change the appearance of pop-up frame for the selected controls.Simple and convenient tool to get a screenshot of the part screen of interest for publication on the forum (Capture tab).Create a report in the clipboard or a text file for subsequent publication on the forum.Search all running AutoIt scripts and their windows in the system (AutoIt tab).User-friendly interface. Used shortcuts Ctrl+Alt+T - Enable/Disable "Always On Top" mode (also available from the menu). Ctrl+Alt+H - Enable/Disable highlight selected controls (also available from the menu). Ctrl+A - Select all text (works in any input field). Ctrl - Hold down when moving the mouse to scroll the screenshot (Capture tab). Shift - Hold down when stretching/compression of the contour frame for an equilateral resizing screenshots (Capture tab). DoubleClick (on the screenshot) - Save the image to a file (Capture tab). DoubleClick (on any list item) - Open a folder with the file of the process or AutoIt script (AutoIt tab). Del (on any list item) - Close process (AutoIt tab). F5 - Updating the list (AutoIt tab). If anyone have any questions or comments about CV, please post it in this thread. I will be glad to any feedback and suggestions. Files to download Binary (x86 and x64) Redirection to CV_bin.zip, 1.14 MB CV_bin.html Source Redirection to CV_source.zip, 691 KB CV_source.html1 point -
Version 1.7.0.1
10,054 downloads
Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API. There are other UDFs available to automate Outlook: OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more. Threads: Development - General Help & Support - Example Scripts - Wiki BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2020-02-09) None1 point -
Possible bug in AutoIt3Wrapper.au3 19.1127.1402.20
Professor_Bernd reacted to Jos for a topic
It's better to simply PM me in case you think you found an error... and yes it does help when people ask questions and/or suggest changes. Nope! Guess this comment makes more sense: ; check how the Func is started. Init will not be defined when HotKey to restart is used If IsDeclared("Init") Then Jos1 point -
Control Viewer - AutoIt Window Info Tool
argumentum reacted to pixelsearch for a topic
I discovered this thread a couple of days ago and it's really a brilliant script. Bravo @Yashied (wherever you are now) and @argumentum who had the courage to rework it ! I'm experimenting a bit the reworked script of @boomingranny found in this link, which is Yashied's script adapted to newer versions of AutoIt, while trying to solve the following problem : As you notice, the styles of this AutoIt control (an Input control) are not all "translated" because we see in the picture, field Styles names : "0x00002081, WS_CHILD, WS_TABSTOP, WS_VISIBLE" In fact, 0x00002081 corresponds to : 0x2000 (ES_NUMBER) + 0x0080 (ES_AUTOHSCROLL) + 0x0001 (ES_CENTER) But as Yashied didn't include any Control style in his script (except the Window Styles & Dialog Styles) then you'll nearly always find some "0x......" in the Control field style names. I'll be back if experiments lead to something easy to script, probably based on additional arrays of styles (one per each type of AutoIt control) and a reworked Func _GetStyleString() which could use the Control Class ("Edit" in the pic) to pick up styles from the Edit array of styles.1 point -
RegExpReplace - Changing file name a line specified in txt
FrancescoDiMuro reacted to AspirinJunkie for a topic
As i understood his problem is, that with his pattern all *.txt-strings are replaced - even without a "file=" in front of it. So he only wants a pattern that replace the file name after "File=" regardless of whether they end with .txt If this is the case than my pattern should still be enough for him.1 point -
RegExpReplace - Changing file name a line specified in txt
AspirinJunkie reacted to FrancescoDiMuro for a topic
@AspirinJunkie You need to include the .txt in your pattern, or invalid file names like "Test" without an extension are matched as well. Then, asserting that File= has to be at the start of the line, and .txt is at the end of the line, this should do the trick: StringRegExpReplace($strTestString, '^(File=)\h*(.+\.txt)$', '$1NewDocumentFileName.txt')1 point -
RegExpReplace - Changing file name a line specified in txt
youtuber reacted to AspirinJunkie for a topic
Shorter and (maybe) more simple: $text = "File= DocumentName.txt" & @CRLF & _ "Test= blabla.txt" & @CRLF & _ "Author= autoitscript.com" & @CRLF & _ "blabla.txt" $text = StringRegExpReplace($text, 'File=\s*\K(.+)', "DocumentNameNew.txt") ConsoleWrite($text & @CRLF)1 point -
I had already noticed this myself (see EDIT in my post above). This approach should work better : $text = "File= DocumentName.txt" & @CRLF & _ "Test= blabla.txt" & @CRLF & _ "Author= autoitscript.com" & @CRLF & _ "blabla.txt" $text = StringRegExpReplace($text, '(?i)(File=)(\s+).+?(.txt)', '$1$2' & "DocumentNameNew.txt") ConsoleWrite($text & @CRLF)1 point
-
Just set the path to the pdf in my code instead the .txt file. About the test page you said. It does not have post url. It's just an html code. It does not have action endpoint. So you can't post a file on it. Regards1 point
-
If you want to copy all types of files in a single copy, you could use robocopy (robust copy) : #include <Constants.au3> #include <WinAPIConv.au3> $iPID = Run(@ComSpec & ' /c robocopy "c:\apps\temp" "c:\apps\back" *.PDF *.DXF /s /v', "", @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($iPID) $sText = StdoutRead($iPID) ConsoleWrite (_WinAPI_OemToChar($sText) & @CRLF) You can get a full report of the job and save it if you want...1 point
-
Only Copy Dxf and PDF from Directory
Steal45 reacted to pixelsearch for a topic
If I understood correctly, OP would like to : 1) Recreate his folder structure from C:\Test to D:\Test ("make the folder names the same") 2) Then copy *.DXF and *.PDF files to the appropriate folders I tried it with Xcopy (which exists in all Windows releases), here is an example for pdf files : RunWait(@ComSpec & " /c Xcopy C:\Test\*.pdf D:\Test\ /s /e /y", "", @SW_HIDE) If @error Then MsgBox(0, "", "bad lemonade") Explanation for Xcopy parameters : /s take care of subdirectories too... /e ... even if they are empty /y suppress prompting to confirm that you want to overwrite an existing destination file. I just tried it with a test folder structure containing subdirectories (empty or filled with several types of files) and it worked fine : 1) The directory structure was recreated (even the empty subfolders) 2) Only the *.pdf files were copied to their correct locations.1 point -
Welcome to AutoIt and the forum! Should be easy. Please have a look at _FileListToArrayRec in the help file on how to get a list of files to copy. Then loop through the array and use FileCopy for each file. Edit: Too slow1 point
-
Yes that is pretty easy to do. Just open the Helpfile and start reading about and playing with UDF: _FileListToArray() Jos1 point
-
Control Viewer - AutoIt Window Info Tool
pixelsearch reacted to argumentum for a topic
I used @boomingranny's code and corrected/added handy stuff, like: 1) The file-version would not show compiled scripts 2) Added the command line to the listview 3) Added exit to tray on using the emergency exit found in the extras tab 4) added a context menu to do more than DClick to open the folder The code is in the downloads area.1 point