I have a number of batch files in my ZTree
directory created to Open my preferred audio
player, 1by1 https://mpesch3.de/1by1.html
MP3.BAT,MID.BAT,KAR.BAT,FLAC.BAT,WAV.BAT,CDA.BAT,OGG.BAT,WMA.BAT,...
All of the above contain the exact same launcher line:
start "" C:\1\Audio\1by1\1by1.exe %1
I have this idea: create a new Open rule that,
before (or after?) looking for ext.BAT files, looks
for a batch file named, in this case:
!MP3!MID!KAR!FLAC!WAV!CDA!OGG!WMA!.BAT
The above generic batch file will still contain the
same launcher line but, if needed, could examine the
input format for special cases:
if "%~x1"==".mp3" goto mp3_special
if "%~x1"==".wav" goto wav_special
...
to determine if we are Opening a WAV, MP3, OGG, etc.,
and do something special, maybe launch a different
audio player?
The benefits of a generic Open feature:
1. Reduce clutter, in this case, from 8 to 1 file
2. Easy maintenance, code sharing, no duplication
3. Switching from player1 to player2 requires
modifying just one line of code. I'm considering
trying http://www.foobar2000.org, but if I
want to plug it into ZTree, today, I would need to
create 8 separate batch files...
4. I have a similar situation with graphics and
archive files, where the number of files could be
reduced by folding them into a single batch file.
Any interest in this?