Leaderboard
Popular Content
Showing content with the highest reputation on 12/15/2020 in all areas
-
A mix of @Aelc and @FrancescoDiMuro #include <File.au3> #include <Array.au3> #include <ListViewConstants.au3> Local $aPath[] = [ _ "C:\Directory\Mary Poppins (2020).mkv", _ "C:\Directory\Terminator 3(1234).mkv", _ "C:\Directory\Pirates of the caribbean 4 (1934).mkv", _ "C:\Directory\Test film 123(1324).mkv", _ "C:\Directory\What else (1923).mkv", _ "C:\Directory\and so on (1969).mkv", _ "C:\Directory\why i do so much 34 (1999).mkv", _ "C:\Directory\Mary Poppins (2000).mkv", _ "C:\Directory\Mary Poppins (2001).mkv", _ "C:\Directory\Mary Poppins 3(2005).mkv" ] Local $hGUI = GUICreate("RegExp", 450, 450) Local $listview = GUICtrlCreateListView("File Name|Year", 0, 0, 400, 400) ;,$LVS_SORTDESCENDING) Local $sFilePath, $sDrive, $sDir, $sFileName, $sExtension For $i = 0 To UBound($aPath) - 1 _PathSplit($aPath[$i], $sDrive, $sDir, $sFileName, $sExtension) GUICtrlCreateListViewItem(_ArrayToString(StringRegExp($sFileName, "([^\(]*)\((\d+)\)", 1)), $listview) Next GUICtrlSendMsg($listview, $LVM_SETCOLUMNWIDTH, 0, -1) GUISetState() While GUIGetMsg() <> -3 WEnd3 points
-
1.) speed up script, 2.) "merge" JPG files to a movie?
FrancescoDiMuro and one other reacted to JockoDundee for a topic
2 points -
EasyCodeIt A cross-platform implementation of AutoIt Introduction: EasyCodeIt is an attempt at implementing a programming language which is backward compatible with a sub-set of AutoIt which would work across multiple platforms with many aspects being agnostic to the platform-specific differences. Currently the primarily targeted platforms are Linux and Windows, more platforms may be supported in the future as per popular demand. For example it should be easy enough to port to Unix-like platforms such as BSD and Mac with the help of maintainers who are familiar with them. The main motivation behind the creation of this project is the lack of a proper easy-to-use scripting language in Linux, while there are numerous scripting languages which natively support it, none of them are as user-friendly and easy to use as AutoIt. (The "Easy" in "EasyCodeIt" reflects this) There was a previous thread in which the project was originally started, but it got too big and the discussion is too cluttered and hard to follow for any new readers, here is the thread for those who are interested in reading it: Progress: Frontend ✅ Tokenizer 🚧 Parser (work in progress) ✅ Expressions 👷♂️ Statements (current priority) Backend ⏰ Interpreter (scheduled) I am currently working on expression parsing and syntax tree building. -- This section will be updated in the future with new progress. To stay notified 🔔 follow this thread to get update notifications (by using the "Follow" button on the top-right corner of this page) and 👁️ watch the GitHub repository to get any new activity on your feed. Code: The code is available on GitHub, please 🌟 star the project if you like it and would like to show your support, it motivates me a lot! (Also don't forget to 👍 Like this post ) Chat: I created a room in Matrix (an open-source federated chat system) for EasyCodeIt, you can join it to chat with me and others who are in the room, it might be a good way to get the latest status updates from me You can preview the room without joining, and you don't need to be connected to it 24/7 like IRC. It works a bit like Slack for those who are familiar with it. Forum: I have created a dedicated forum to post more frequent updates, possibly in their own threads to better organize the discussion. Please sign-up and follow the blog section to get updates. By the way, you can also post pretty much anything there, both technical and non-technical stuff, it is intended to be a hangout for techies but not only for them. So casual discussions, funny cat videos etc. are allowed!1 point
-
This is a program that I made to help my self learn better regular expressions. There are a lot of other programs/website with the similar functions. The main advantage of this program is that you don't have to click a button after every changes. The program detected changes and react on it. Function: Match Match of arrays Match and replace Load source data from website Load source data from a website with GET/POST Load text data from file Clear fields Export and Import settings (you can finish the expression a other time, just export/import it) Cheat sheet DPI aware Generate AutoIt code example code The source code is not difficult and I think most user will understand it. In the zip file there is a export files (reg back example), you can drag and drop this files on the gui to import it. EDIT: Updated to version V1.2.0 Changes are: Expand and collapse of the cheat sheet (Thanks to Melba23 for the Guiextender UDF) Usefull regular expressions websites links included in the program Text data update time EDIT: Updated to version V1.3.0 Changes are: Automatic generate AutoIt code Icons on the tab Few minor bug fixes EDIT: Updated to version V1.4.0 Changes are: Link to AutoIt regex helpfile If the regular expression has a error than the text becomes red Option Offset with Match and array of Matches Option Count with Match and replace Some small minor bug fixed EDIT: Updated to version V1.4.1 Changes are: Small bug in "create AutoIt" code fixed EDIT: Updated to version V1.4.2 Changes are: Small bug in "create AutoIt" code fixed Bug with website data fixed EDIT: Updated to version V1.4.3 Changes are: DPI aware Click function on cheat sheet to insert function in the regex input field (Sourcode, example and compiled exe file) Regex toolkit.zip1 point
-
Well StringRegExp returns an array, which includes the name in assignment [0] and the year in assignment [1] That is what i meant that there are better pattern and like the masters shown it split it perfectly in this 2 strings which are just converted to a single string with _ArrayToString() and inserted in the GUICtrlCreateListView () call If you have to understand some codes it's helpful to display the results of functions after every to see what happened Local $listview = GUICtrlCreateListView("File Name|Year", -101, 40, 420, 190) ;,$LVS_SORTDESCENDING) For $i = 0 To UBound($aPath) - 1 Local $aArray = StringRegExp($aPath[$i], "(?:.*\\)?(.+)\((\d*)", 1) For $y = 0 To Ubound($aArray) -1 ConsoleWrite ("returned value StringRegExp " & $y & ": " & $aArray[$y] & @CRLF ) Next Local $sString = _ArrayToString($aArray) ConsoleWrite ("returned value _ArrayToString " & $sString & @CRLF ) GUICtrlCreateListViewItem($sString, $listview) Next GUICtrlSendMsg($listview, $LVM_SETCOLUMNWIDTH, 0, -1) GUISetState() regards1 point
-
Did you try RunWait()?1 point
-
See RunWait in help file.1 point
-
Extracting part of a file name?
pixelsearch reacted to Nine for a topic
There without split : #include <ListViewConstants.au3> Local $aPath[] = [ _ "C:\Directory\Mary Poppins (2020).mkv", _ "C:\Directory\Terminator 3(1234).mkv", _ "C:\Directory\Pirates of the caribbean 4 (1934).mkv", _ "C:\Directory\Test film 123(1324).mkv", _ "C:\Directory\What else (again) (1923).mkv", _ "C:\Directory\and so on (1969).mkv", _ "C:\Directory\why i do so much 34 (1999).mkv", _ "Mary Poppins (new) (2020).mkv", _ "C:\Directory\Mary Poppins (2000).mkv", _ "C:\Directory\Mary Poppins (2001).mkv", _ "C:\Directory\Mary Poppins 3(2005).mkv" ] Local $hGUI = GUICreate("RegExp", 450, 450) Local $listview = GUICtrlCreateListView("File Name|Year", 0, 0, 400, 400) ;,$LVS_SORTDESCENDING) For $i = 0 To UBound($aPath) - 1 GUICtrlCreateListViewItem(_ArrayToString(StringRegExp($aPath[$i], "(?:.*\\)?(.+)\((\d*)", 1)), $listview) Next GUICtrlSendMsg($listview, $LVM_SETCOLUMNWIDTH, 0, -1) GUISetState() While GUIGetMsg() <> -3 WEnd1 point -
1.) speed up script, 2.) "merge" JPG files to a movie?
FrancescoDiMuro reacted to Jos for a topic
? What @Reginald needs to do is ask a real question. That first post is a statement.... curious what the next post will be.1 point -
Extracting part of a file name?
Aelc reacted to FrancescoDiMuro for a topic
@Aelc Amazing code, but it could be even more compact: #include <Array.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $arrPaths[] = ["C:\Directory\Mary Poppins (2020).mkv", _ "C:\Directory\Terminator 3(1234).mkv", _ "C:\Directory\Pirates of the caribbean 4 (1934).mkv", _ "C:\Directory\Test film 123( 1324 ).mkv", _ "C:\Directory\What else (1923).mkv", _ "C:\Directory\and so on (1969).mkv", _ "C:\Directory\why i do so much 34 (1999).mkv", _ "C:\Directory\Mary Poppins (2000).mkv", _ "C:\Directory\Mary Poppins (2001).mkv", _ "C:\Directory\Mary Poppins 3(2005).mkv"] Global $strPattern = '.*\\+\s*(\b[^(]+\b)\s*\(\s*(\d+)\s*\)\.\S+$' #Region ### START Koda GUI section ### Form= Global $frmMain = GUICreate("Films", 405, 293, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitApplication") Global $lvFilms = GUICtrlCreateListView("Name|Year", 8, 8, 386, 278, $LVS_REPORT, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES)) GUICtrlSendMsg($lvFilms, $LVM_SETCOLUMNWIDTH, 0, 150) _PopulateListView() GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func ExitApplication() GUIDelete($frmMain) Exit EndFunc Func _PopulateListView() Local $strListViewItem ; Create the ListView Items For $i = 0 To UBound($arrPaths) - 1 Step 1 $strListViewItem = StringRegExpReplace($arrPaths[$i], $strPattern, '$1|$2') If Not @error Then GUICtrlCreateListViewItem($strListViewItem, $lvFilms) Next EndFunc1 point -
It is not global nor byref bug, it is an array bug. Calling a function inside an array assignment calls it twice : #include <Array.au3> Local $aArr[4] $aArr[_Call()] = 1 ; calls the func 2 times _ArrayDisplay($aArr) Func _Call() ConsoleWrite("called" & @CRLF) EndFunc Applies also to 2D arrays...1 point
-
I have now tested the program and it works very well, I have a suggestion that can facilitate a lot if it can be added. When you select Yes to create the setup.exe file, you will be asked where you specify where the contents of the setup.exe file should be installed and unpacked and run, and then the setup.exe file created with the option you specified will be embedded in the setup.exe file. With this suggestion, the creator of setup.exe file can decide where to install the file as in this example c: \ test Is this possible in any way? This is to first avoid creating a folder and then copy the setup file to that folder and then run it from there. Excuse my bad English.1 point
-
I am still working on the expression parser, the code is not complete but since it has almost been a week since the last update, so I thought I'd give you guys a sneak peak Here is a screenshot with the graphical representation of an expression's parse tree: The expression is pretty simple: 1 - 2 / 3 * 4 But the final result looks complex and huge because there are multiple layers of nodes for each bit of info... all thanks to C's strict type system, where you can't put anything anywhere like you usually would in a dynamically typed language like AutoIt. Here is a snippet of the code (the expression parsing function) for those are interested: There are no doubt many bugs in there, and a lot of the stuff needs to be completed, but I will try to post weekly updates to show the progress.1 point
-
LOL By the way, I am not actually going to implement the Automation related functions, I want to create a general-purpose language which can be expanded by the user according to their needs (so there could be an UDF with those functions ) Should probably mention this in the first post1 point
-
Reserved for future use1 point