by therube » Wed May 27, 2020 4:53 pm
Basically, it looks for "video" files:
(*.mp4 *.avi *.mpg *.flv)
(adjust as needed)
At that point, it assumes it will find a .srt file in the same directory.
Then it renames said .srt - based upon the file name of the video file.
So if the video is
123.mp4
& the .srt is
abc.srt
it finds 123.mp4, the video file
the %~ni, says use the name portion of the filename - without the extension, so "123".
then it renames the .srt - no matter what it's current name is, to the (video) file name (as found above - without its' extension)
so, again "123", only it leave the existing .srt extension as it was
so "abc.srt" is renamed to 123.srt
& since 123.mp4 & 123.srt are both named the "same", when you play 123.mp4, the subtitles should then display, as expected. (And as you know, the file names, name part, exclusive of extension, of the video & the .srt must be the same for this to happen.)