Zum Teil werden folgende kleine portable Helferlein benötigt (die im Übrigen noch mehr können!). Ob und welche steht immer im Button-Titel, Standardpfad des Exe-Dateien: "/dopusdata\User Data".
SelectEX
https://resource.dopus.com/t/command-se ... mand/20517
Flac/Metaflac
https://xiph.org/flac/index.html
Lame
https://lame.sourceforge.io/
ID3
https://blog.forret.com/2007/08/29/id3e ... mp3-files/
Tag (Seite existiert nicht mehr) Los geht's....
Taggen von MP3/FLAC vom Dateinamen:
Format Dateiname: "Interpret - Titel" (bsp. "Depeche Mode - Enjoy The Silence.mp3")
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>Taggen_(Interpret-Titel)</label>
<tip>Dateiname in Metadata einfügen (MP3 & FLAC)</tip>
<user_label>Taggen (Interpret - Titel)</user_label>
<icon1>#tag</icon1>
<function type="normal">
<instruction>@nodeselect</instruction>
<instruction>Rename FILEINFO TO="{mp3artist}%{mp3title}"</instruction>
<instruction>@script vbscript</instruction>
<instruction>Option Explicit</instruction>
<instruction>Dim DOpusRTPath</instruction>
<instruction>DOpusRTPath = "C:\Program Files\Directory Opus\dopusrt.exe"</instruction>
<instruction>Dim Shell</instruction>
<instruction>Set Shell = CreateObject("WScript.Shell")</instruction>
<instruction>Function Rename_GetNewName ( strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName )</instruction>
<instruction> Dim re, strCommand, artist, title, path</instruction>
<instruction> Set re = new RegExp</instruction>
<instruction> re.Pattern = "^(.*) - (.*)(\.mp3|\.flac)"</instruction>
<instruction> artist = re.Replace(strFileName, "$1")</instruction>
<instruction> title = re.Replace(strFileName, "$2")</instruction>
<instruction> path = strFilePath & "\" & strFileName</instruction>
<instruction> strCommand = """" & DOpusRTPath & """ /cmd SetAttr """ & path & """ META ""artist:" & artist & """ ""title:" & title & """"</instruction>
<instruction> Shell.Run strCommand,0,false</instruction>
<instruction> Dopus.OutputString "Command: " & strCommand</instruction>
<instruction> strNewName = ""</instruction>
<instruction>End Function</instruction>
</function>
</button>
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>Taggen_(Interpret-Nr.-Titel)</label>
<tip>Dateiname in Metadata einfügen (MP3 & FLAC)</tip>
<user_label>Taggen (Interpret - Nr. - Titel)</user_label>
<icon1>#tag</icon1>
<function type="normal">
<instruction>@nodeselect</instruction>
<instruction>Rename FILEINFO TO="{mp3artist}%{mp3track}%{mp3title}"</instruction>
<instruction>@script vbscript</instruction>
<instruction>Option Explicit</instruction>
<instruction>Dim DOpusRTPath</instruction>
<instruction>DOpusRTPath = "C:\Program Files\Directory Opus\dopusrt.exe"</instruction>
<instruction>Dim Shell</instruction>
<instruction>Set Shell = CreateObject("WScript.Shell")</instruction>
<instruction>Function Rename_GetNewName ( strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName )</instruction>
<instruction> Dim re, strCommand, artist, track, title, path</instruction>
<instruction> Set re = new RegExp</instruction>
<instruction> re.Pattern = "(.*) - ([0-9]*) - (.*)(\.mp3|\.flac)"</instruction>
<instruction> artist = re.Replace(strFileName, "$1")</instruction>
<instruction> track = re.Replace(strFileName, "$2")</instruction>
<instruction> title = re.Replace(strFileName, "$3")</instruction>
<instruction> path = strFilePath & "\" & strFileName</instruction>
<instruction> strCommand = """" & DOpusRTPath & """ /cmd SetAttr """ & path & """ META ""artist:" & artist & """ ""track:" & track & """ ""title:" & title & """"</instruction>
<instruction> Dopus.OutputString "Commande: " & strCommand</instruction>
<instruction> Shell.Run strCommand,0,false</instruction>
<instruction> strNewName = ""</instruction>
<instruction>End Function</instruction>
</function>
</button>
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>Taggen_(Nr.-Interpret-Titel)</label>
<tip>Dateiname in Metadata einfügen (MP3 & FLAC)</tip>
<user_label>Taggen (Nr. - Interpret - Titel)</user_label>
<icon1>#tag</icon1>
<function type="normal">
<instruction>@nodeselect</instruction>
<instruction>Rename FILEINFO TO="{mp3track}%{mp3artist}%{mp3title}"</instruction>
<instruction>@script vbscript</instruction>
<instruction>Option Explicit</instruction>
<instruction>Dim DOpusRTPath</instruction>
<instruction>DOpusRTPath = "C:\Program Files\Directory Opus\dopusrt.exe"</instruction>
<instruction>Dim Shell</instruction>
<instruction>Set Shell = CreateObject("WScript.Shell")</instruction>
<instruction>Function Rename_GetNewName ( strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName )</instruction>
<instruction> Dim re, strCommand, artist, track, title, path</instruction>
<instruction> Set re = new RegExp</instruction>
<instruction> re.Pattern = "([0-9]*) - (.*) - (.*)(\.mp3|\.flac)"</instruction>
<instruction> track = re.Replace(strFileName, "$1")</instruction>
<instruction> artist = re.Replace(strFileName, "$2")</instruction>
<instruction> title = re.Replace(strFileName, "$3")</instruction>
<instruction> path = strFilePath & "\" & strFileName</instruction>
<instruction> strCommand = """" & DOpusRTPath & """ /cmd SetAttr """ & path & """ META ""track:" & track & """ ""artist:" & artist & """ ""title:" & title & """"</instruction>
<instruction> Dopus.OutputString "Commande: " & strCommand</instruction>
<instruction> Shell.Run strCommand,0,false</instruction>
<instruction> strNewName = ""</instruction>
<instruction>End Function</instruction>
</function>
</button>
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>Tags_kopieren_MP3</label>
<tip>Kopiert MP3-Tags aus selektierter Datei nach Zieldatei</tip>
<user_label>MP3-Tags kopieren</user_label>
<icon1>#tag</icon1>
<function type="batch">
<instruction>@set var = {dlgopen|Bitte Zieldatei wählen:|"E:\Media\Musik\_Unsortiert"}</instruction>
<instruction>"/dopusdata\User Data\ID3.exe" -D "{filepath}" -2u "{$var}"</instruction>
</function>
</button>
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>Tags_löschen_MP3</label>
<tip>Löscht alle MP3-Tags aus selektierten Dateien</tip>
<user_label>MP3-Tags löschen</user_label>
<icon1>#tag</icon1>
<function type="normal">
<instruction>@nodeselect</instruction>
<instruction>@runmode hide</instruction>
<instruction>"/dopusdata\User Data\Tag\Tag.exe" --remove {filepath}</instruction>
</function>
</button>
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>Tags_löschen_FLAC</label>
<tip>Löscht alle FLAC-Tags aus selektierten Dateien</tip>
<user_label>FLAC-Tags löschen</user_label>
<icon1>#tag</icon1>
<function type="normal">
<instruction>@runmode hide</instruction>
<instruction>@nodeselect</instruction>
<instruction>@sync: "/dopusdata\User Data\Flac\Metaflac.exe" --remove {filepath$}</instruction>
</function>
</button>
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>MP3_encoden</label>
<tip>FLAC/OGG/WAV zu MP3 konvertieren</tip>
<user_label>MP3 encoden</user_label>
<icon1>#filetype_mp3</icon1>
<function type="script">
<instruction>@nodeselect </instruction>
<instruction>@script JScript</instruction>
<instruction>function OnClick(clickData) {</instruction>
<instruction> var cmd = clickData.func.command;</instruction>
<instruction> var dlg = clickData.func.Dlg();</instruction>
<instruction> dlg.window = clickData.func.sourcetab;</instruction>
<instruction> dlg.template = 'mydlg';</instruction>
<instruction> </instruction>
<instruction> var retVal = dlg.Show();</instruction>
<instruction> if (retVal == 1) var encVal = '-b 320';</instruction>
<instruction> if (retVal == 2) var encVal = '-b 160';</instruction>
<instruction> if (retVal == 3) var encVal = '-b 128';</instruction>
<instruction> if (retVal == 4) var encVal = '-V 0 --vbr-new';</instruction>
<instruction> if (retVal == 5) var encVal = '-V 4 --vbr-new';</instruction>
<instruction />
<instruction> cmd.deselect = false;</instruction>
<instruction> cmd.RunCommand('@sync: "/dopusdata\\User Data\\Lame\\Lame.exe" ' + encVal + ' "{filepath$}"');</instruction>
<instruction>}</instruction>
<instruction>==SCRIPT RESOURCES</instruction>
<instruction><resources></instruction>
<instruction> <resource name="mydlg" type="dialog"></instruction>
<instruction> <dialog fontsize="10" height="117" lang="german" title="MP3 encoden" width="132"></instruction>
<instruction> <control close="1" height="14" name="button1" title="CBR 320 kbps (Beste)" type="button" width="101" x="15" y="19" /></instruction>
<instruction> <control close="2" height="14" name="button2" title="CBR 160 kbps (Medium)" type="button" width="101" x="15" y="37" /></instruction>
<instruction> <control close="3" height="14" name="button3" title="CBR 128 kbps (Web/Mail)" type="button" width="101" x="15" y="55" /></instruction>
<instruction> <control close="4" height="14" name="button4" title="VBR ~220 kbps (Beste)" type="button" width="101" x="15" y="73" /></instruction>
<instruction> <control close="5" height="14" name="button5" title="VBR ~165 kbps (Medium)" type="button" width="101" x="15" y="91" /></instruction>
<instruction> <control height="102" name="group1" title="Bitte Qualität auswählen:" type="group" width="112" x="9" y="7" /></instruction>
<instruction> </dialog></instruction>
<instruction> </resource></instruction>
<instruction></resources></instruction>
</function>
</button>
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>FLAC_encoden</label>
<user_label>FLAC encoden</user_label>
<icon1>#filetype_flac</icon1>
<function type="normal">
<instruction>@runmode hide</instruction>
<instruction>@nodeselect</instruction>
<instruction>@sync: "/dopusdata\User Data\Flac\Flac.exe" --best -m -e -r 6 -f -V {filepath$}</instruction>
</function>
</button>
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>MP3_decoden</label>
<user_label>MP3 decoden</user_label>
<icon1>#filetype_mp3</icon1>
<function type="normal">
<instruction>@nodeselect</instruction>
<instruction>@sync: "/dopusdata\User Data\Lame\Lame.exe" --decode {filepath$}</instruction>
</function>
</button>
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>FLAC_decoden</label>
<user_label>FLAC decoden</user_label>
<icon1>#filetype_flac</icon1>
<function type="normal">
<instruction>@runmode hide</instruction>
<instruction>@nodeselect</instruction>
<instruction>@sync: "/dopusdata\User Data\Flac\Flac.exe" --decode {filepath$}</instruction>
</function>
</button>
Beispiel: Suche zuerst rekursiv alle Lieder aus den 80er Jahren und erstelle aus Sammlung "Musik Playlist" die "1980s.m3u". Danach dasselbe für Genres Pop u.ä. in "Pop.m3u". Nicht vergessen: Die Ordner am Anfang einmalig festlegen!
Code: Alles auswählen
// Set variables
@set musicfolder = D:\Musik
@set playlistfolder = D:\Playlisten
//1980s
Find COLLNAME "Musik Playlist" IN "{$musicfolder}" FILTERDEF music match year >= 1980 and music match year <= 1989
/home\dopusrt.exe /col export "Musik Playlist" "{$playlistfolder}\1980s.m3u"
// Alternative Disco Electronic Funk New Age Pop
Find COLLNAME "Musik Playlist" IN "{$musicfolder}" FILTERDEF music match genre Alternative or music match genre Disco or music match genre Electronic or music match genre Funk or music match genre "New Age" or music match genre Pop
/home\dopusrt.exe /col export "Musik Playlist" "{$playlistfolder}\Pop.m3u"
Beispiel: Suche rekursiv alle Lieder mit den Genres "Pop" und ähnlichen in "D:\Musik" (in Sammlung "Musik Playlist") und erstelle hieraus die "D:\Playlist_Pop.m3u".
Code: Alles auswählen
// Pop
var jsFilter = ""+
"if (item.metadata == 'audio'){ "+
"var genre = new String(item.metadata.audio['mp3genre']);"+
"if ((genre.indexOf('Alternative')!=-1)"+
"||(genre.indexOf('Disco')!=-1)"+
"||(genre.indexOf('Electronic')!=-1)"+
"||(genre.indexOf('Funk')!=-1)"+
"||(genre.indexOf('New Age')!=-1)"+
"||(genre.indexOf('Pop')!=-1))"+
"return false;"+
"}";
cmd.RunCommand('Delete "coll://Musik Playlist" REMOVECOLLECTION=auto QUIET')
cmd.RunCommand('SelectEx LINEAR '+
'PATH="D:\\Musik" RECURSE JSFILTER="'+jsFilter+'" '+
'ITEMCOUNTPERC=100 '+
'COPYTOCOLL="Musik Playlist" '+
'TOFILE="'+DOpus.FSUtil.Resolve('D:\\Playlist_Pop.m3u'))
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>FLAC_Coverart_hinzufügen</label>
<template>Fügt Coverart zur ausgewählten FLAC hinzu</template>
<user_label>FLAC Coverart hinzufügen</user_label>
<icon1>#coverart</icon1>
<function type="normal">
<instruction>@set var = {dlgopen|Bitte einzubettendes Coverart wählen:}</instruction>
<instruction>"/dopusdata\User Data\Flac\metaflac.exe" --import-picture-from="{$var}" "{filepath}"</instruction>
</function>
</button>