It'll be either in the same folder as the track or potentially embedded in the file if it's an MP3.
if the albumart is embedded, you can use mp3tag, as foobar can't tell us about it right now
I called the vbs script with foo_run (had no luck with the bat.file, but i don't know how to give foo_run the correct command...).
Maybe someone can rewrite it not to output a TXT-file with the folders that misses a specified file but create at least a normal playlist (if its possible...)
Or it should be possible with foo_run and the foobar command for 'new playlist', shouldn't it?.
hi, tedgo
the .bat file must be executed in your media library folder, because there is no way to tell where the media library is (or maybe with foo_exvar?)
but at the end it's no so sophisticated as vbscript
your idea is nice, i haven't thought about it, so i checked again your script and made few changes:
it lists folders regardless if there is media in it or not (for ex. empty artist folder)
- changed to exclude empty folders
no arguments
- changed to accept up to two arguments
handling
- i could take foobar registry value but then what about portable installs or different OSs - i don't know
- using \program files\foobar2000 folder also is rejected
- and at the and i decided to output result as a .m3u so that default application can handle it (that means that M3U must be associated with foobar or some other application will be launched)
here is the code:
Option Explicit
Dim fso, oApp, oSource, strPath, strFilename
Dim tmpFile, oShell, oFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
Set oApp = CreateObject("Shell.Application")
If Wscript.Arguments.Count = 0 Then
Set oSource = oApp.BrowseForFolder(0, "Select folder to add", 22, 12)
strPath = oSource.Items().Item().Path
Else
strPath = Wscript.Arguments(0)
If Wscript.Arguments.Count = 2 Then
strFilename = Wscript.Arguments(1)
End If
End If
If strFilename = "" Then
strFilename = InputBox("Please type in filename incl. extension, e.g. 'folder.jpg'","Browse folder","")
End If
If strPath <> "" And strFilename <> "" Then
Set oFile = fso.CreateTextFile("Result.m3u", True)
GetFolder strPath, strFilename
oFile.Close
oShell.Exec("%programfiles%\foobar2000\foobar2000 /command:" & chr(34) & "New Playlist" & chr(34) & " Result.m3u")
End If
Sub GetFolder(strFolder,strFilename)
Dim oFolder, oFolders, oFiles, item, strFile
Set oFolder = fso.GetFolder(strFolder)
Set oFolders = oFolder.SubFolders
For each item in oFolders
GetFolder item, strFilename
Set oFiles = item.Files
strFile = item.Path + "\" + strFilename
If Not (fso.FileExists(strFile)) And (oFiles.Count > 0) Then
oFile.WriteLine item.Path
End If
Next
End Sub
put it into run services:
if no command line arguments are given it will ask you to browse and then to choose the file name
if only one argument is given then it'll be treated as path from where to search for missing file and you'll be asked about file name
edit: clean up