Well, I have such a comprehensive set of actions now that it's been some time since I've needed to come begging, but I have a new "issue" & I'm seeing if I can save some time with a new action.
The overly complicated (& probably irrelevant to my question) workflow is as follows:
I'm using an app called "Make MKV" to extract all the data from blu-rays & turn each "Title" into a stand-alone movie file. (A "Title" would correspond to a complete album or concert.)
I then use MKVToolNix to split each of the Titles into "Chapters". These correspond to the tracks on the album or concert.
I then use To FLAC Converter to convert the "MKVs as Chapters" into FLAC audio files so that I get a separate audio file for each track of the album.
The clever thing about all this is that, preserved in the MKVs are all of the audio options that one can choose when playing the blu-ray & these are separated out into the FLAC files. (In other words, the blu-ray may give the listener the option to select between Stereo & 5:1 surround sound versions of an album in, say, LPCM & DTS-HD audio formats & the listener - if they have such equipment - can select the most suitable format. I end up with each of these audio options as a separate FLAC file.)
So here's my problem. The app "To FLAC Converter" seems to work in a linear fashion. When there is more than one audio format in a given MKV file, it will start by creating the first one. It will then move one to the second one & append "audiotrack_2" to the file name. Then "audiotrack_3" & so on.
The problem with this is that the files sort with the first one last, just because a comes before f, so what I get is:
Heaven And Earth Disc 1_t00-001.audiotrack_2.flac
Heaven And Earth Disc 1_t00-001.flac
and what I need is:
Heaven And Earth Disc 1_t00-001 audiotrack_1.flac
Heaven And Earth Disc 1_t00-001 audiotrack_2.flac
Usually there is only one folder with these audio options & I can very quickly do this manually, but with this latest blu-ray there are 35 folders like this! Obviously I can use a "find & replace" function to remove the full stop before all the occurences of "audiotrack" but because the ones without "audiotrack" share the same ".flac" pattern with all the others, I have to go in & manually shift select them all to do the change.
So... I suppose the action would be something along the lines of "for any file name that contains the word '.audiotrack', remove the full stop before audiotrack & replace it with a word space then, for any file names that end in ".flac" & don't already contain the word 'audiotrack' add in " audiotrack_1.flac".
I hope this makes sense.
I've attached a screenshot so that you can see the first folder of incorrectly named files.

|