AndrewG Posted November 5 Share Posted November 5 (edited) mr-es335, What are you trying to do? It appears, well to me anyway, that what you want to do is copy files that have a "wav" file extension in a source folder named "Audio", to a destination folder named "edl", and change/rename the ".wav" file extension to ".edl". You also do not want to overwrite any files already in the destination folder, that share the same name as a source file that has a renamed file extension - ".edl". Presumably so you can add any new files that have been put in the source "Audio" folder into the destination "edl" folder. What is an edl file? Why rename the esxtension? I do not know of any program that works with wav audio files needing the file extension changed. Are you trying to create a text file that contains all the file names of the files in the source "Audio" folder? Edited November 5 by AndrewG Link to comment Share on other sites More sharing options...
Solution pixelsearch Posted November 5 Solution Share Posted November 5 @ioa747 i think there's a possible issue in your last script, if the user selects only 1 wav file, then : Local $sFileOpenDialog = FileOpenDialog(...) Local $aWavFiles = StringSplit($sFileOpenDialog, "|") Local $sWavFolder = $aWavFiles[1] $sWavFolder is not an "only path" in this case, but a path + filename This is because FileOpenDialog treats differently its return : when the user selects only one file, then StringSplit acts like the following (as no delimiter is found and StringSplit flag is not equal to $STR_NOCOUNT) : Row 0 : 1 Row 1 : Path & Filename ...compared to a user who selects at least 2 files, then a delimiter (|) is always found in the returned string and StringSplit will act like this when 2 files are selected : Row 0 : 3 Row 1 : Path Row 2 : Filename #1 Row 3 : Filename #2 A possible solution could be to treat both cases in the same way, i.e. always have the "path only" in row 1 : Local $sFileOpenDialog = FileOpenDialog(...) Local $aWavFiles = StringSplit($sFileOpenDialog, "|") If $aWavFiles[0] = 1 Then ; only 1 file was selected by user Local $iPos_LastBackslash = StringInStr($aWavFiles[1], "\", 0, -1) ; -1 starts from the right (+++) ReDim $aWavFiles[3] $aWavFiles[2] = StringMid($aWavFiles[1], $iPos_LastBackslash + 1) ; file name $aWavFiles[1] = StringLeft($aWavFiles[1], $iPos_LastBackslash - 1) ; path (without last backslash) $aWavFiles[0] = 2 EndIf Local $sWavFolder = $aWavFiles[1] ; now it always works, no matter the user selected 1 or several files For $i = 2 To $aWavFiles[0] ; as found in your script, no change needed. ... ioa747 and mr-es335 1 1 Link to comment Share on other sites More sharing options...
mr-es335 Posted November 5 Author Share Posted November 5 pixelsearch, Well! By golly. That does appear to "do the trick" here! With what you have provided...and "Thank You so very much!"...by-the-way...very much appreciated, and AndrewG's "$FC_NOOVERWRITE" update...the updated script now appears to be doing what I had intended the script to do! Thank you both so very, very much! An Observation What I am somewhat surprised with here, is that an "Open File" dialog, a "Save File" dialog, and a "Save Files as..." dialog, are what I would refer to as "standard fair" for computer users. Why is it that what I was asking to do was "out of the norm"...if I may be so bold as to say such in this manner? mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
mr-es335 Posted November 5 Author Share Posted November 5 AndrewG, I will attempt to answer your questions: Q: What is an edl file? A: In an identical manner as that of a ".txt", a ".doc", or even an ".au3", an ".edl", is the file extension for an application called "SAWStudio", which is a "Digital Audio Workstation application", or "DAW". Q: Why rename the extension? I do not know of any program that works with wav audio files needing the file extension changed. R: It is not that I am renaming the file extension...see below "Here is the plan..." for a more in-depth explanation. Q: Are you trying to create a text file that contains all the file names of the files in the source "Audio" folder? A: Yes. Precisely! • I was doing this manually employing the "dir /b > list.txt" command. Employing this methodology was alright with one or two data files, but there were times that I might have any number of data files. Here is the "plan"... 1. I create four "master" .edl data files, with each .edl "designed" to meet a specific objective. • These "master" .edl data files are stored as "Type1.edl", "Type2.edl", "Type3.edl", and "Type4.edl" 2. I create a [Set_Name] folder which also contains an edl subfolder and a wav subfolder. • The [Set_Name] folder is simply the name of the "Artist", for example "Eva Cassidy", "Nat King Cole", and so on, or the "Key" of the song, for example "C", "Db", and so on. 3. I copy one of the four Type#.edls to the edl subfolder....for example, the "Type1.edl". 4. Obtain the source audio files, say for example "12". • For our purposes here, the audio files are called, "Audio1.wav", "Audio2.wav", and so on. 5. Move this audio data to the wav subfolder. 6. Create a text listing of the 12 source audio files. 7. Make 12 copies of the "Type1.edl", and rename those .edls as "Audio1.edl", "Audio2.edl", and so on. 8. I then update each of those .edls adding the associated wave file data to those .edls. With the assistance of ioa747 back in October of 2023, I posted with regards to "Read and rename files!", wherein I employed a particular .cmd script. This posting was to be the beginning of my journey with AutoIt. All that I can say at this point is that it was the concerted effort of ioa747 that finally brought this concept to realization! And for that I am very, very grateful! The only "downside" of that earlier script was the inability to select the data files that I needed. Thus my present predicament! I do hope, AndrewG, that the above sheds some light on the current issue, and I was able to answer your questions to your satisfaction. mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now