Quote Originally Posted by JJZolx View Post
You can easily launch your script from within Mp3tag if you like. Look into the 'Tools' feature, which can run external programs and has an option to run just once per directory. You add tools in Options > Tools.
That's cool. I'll take a look at that.

Mine was designed to use the Windows interface rather than be command-line but that's a really simple change. And the code I posted was really just the raw code to actually execute the changes rather than with any bells and whistles.

This version still doesn't have many bells and whistles but does allow directory traversal and gives feedback on how many files/folders have been processed:

' Bumps file modified dates for FLAC files in the directory specified by 2 seconds
' in order to get Squeezebox Server to recognise the changed timestamp but to keep
' the albums in the correct added sequence.
' 2 seconds is chosen because of granularity limits on certain file systems.

Dim strDirectory
Dim fsoFileSystem
Dim intFilesProcessed
Dim intFoldersProcessed

strDirectory = InputBox ("Root directory for processing", "Date Bump")
intFilesProcessed = 0
intFoldersProcessed = 1

If strDirectory <> "" Then
   Set fsoFileSystem = CreateObject ("Scripting.FileSystemObject")
   Call ProcessDirectory (strDirectory)
   Set fsoFileSystem = Nothing
   MsgBox intFilesProcessed & " file(s) and " & intFoldersProcessed & " folder(s) processed", 0, "Date Bump"
End If

Sub ProcessDirectory (strDirectory)

   Dim strFilename
   Dim objShell
   Dim dtModifiedDate
   Dim objDirectory
   Dim objFile

   Set objDirectory = fsoFileSystem.getFolder (strDirectory)

   ' Process each file in the directory, affecting only .FLAC files
   For Each objFile In objDirectory.Files
      strFilename = objFile.Name
      If UCase (Right (strFilename, 5)) = ".FLAC" Then
         dtModifiedDate = objFile.DateLastModified
         Set objShell = CreateObject ("Shell.Application")
         ' Change the last modified date to previous date plus 2 seconds
         objShell.NameSpace (strDirectory).ParseName (strFilename).ModifyDate = DateAdd ("S", 2, dtModifiedDate)
         Set objShell = Nothing
         intFilesProcessed = intFilesProcessed + 1
      End If

   ' Process directories
   For Each objFile In objDirectory.SubFolders
      intFoldersProcessed = intFoldersProcessed + 1
      Call ProcessDirectory (strDirectory & "\" & objFile.Name)

   Set objDirectory = Nothing

End Sub