It's interesting how folks solve the same problems. I've been using MediaMonkey as my library-based music player for many years. It includes a flexible format conversion and normalization module to set up presets, per-device settings, and so on. I can just plug in my phone, right-click a playlist (or whatever) and pick "Sync to (phone name)".
I do use a VBScript to add album and track Replay Gain tags to my ripped CDs. It's not all that interesting (one call to metaflac in the guts of a "loop through all the subfolders" script) and isn't well commented, but FWIW:
Add Replay Gain to All.vbs
Option Explicit
Const scriptName = "Add Replay Gain To All"
Const scriptVer = "1.1.0"
Const errNeedPath = "To use this script, drop a folder onto the script icon."
Dim gShellObj
Set gShellObj = WScript.CreateObject("WScript.Shell")
Dim gFolderCount
gFolderCount = 0
Main
' Customize this to do whatever you need it to do.
Function DoTheWork(ByRef folderObj)
Dim returnMe
returnMe = True
Dim filePaths
filePaths = ""
Dim fileObj, fileCollection
Set fileCollection = folderObj.Files
For Each fileObj in fileCollection
If (StrComp(Right(fileObj.Name, 5), ".flac", 1) = 0) Then
' Do the thing (in this case, collect the paths for later)
filePaths = filePaths & " " & fileObj.ShortPath
End If
Next
If (Len(filePaths) > 0) Then
'WScript.Echo("metaflac --add-replay-gain " & filePaths)
Call gShellObj.Run("F:\Utils\flac\win32\metaflac --add-replay-gain " & filePaths, 1, True)
gFolderCount = gFolderCount + 1
End If
DoTheWork = returnMe
End Function
' Customize this to report something to the user.
' The default result is the top-level boolean from LoopWithin.
Sub ReportResults(ByVal result)
If (result) Then
Call MsgBox("Updated " & CStr(gFolderCount) & " album" & Pluralize(gFolderCount) & ".", 0, scriptName)
Else
Call MsgBox("An error occurred while doing the work.", 0, scriptName)
End If
End Sub
Function LoopWithin(ByRef folderObj, ByVal lookInSubdirs)
Dim returnMe
returnMe = True
If returnMe And lookInSubdirs Then
Dim subObj, subCollection
Set subCollection = folderObj.SubFolders
For Each subObj in subCollection
returnMe = LoopWithin(subObj, lookInSubdirs)
Next
End If
If returnMe then
returnMe = DoTheWork(folderObj)
End If
LoopWithin = returnMe
End Function
Function Pluralize(ByVal count)
If (count <> 1) Then
Pluralize = "s"
Else
Pluralize = ""
End If
End Function
Sub Main
Dim i, args, continueOn
continueOn = True
Set args = WScript.Arguments
If (args.Count <> 1) Then
WScript.Echo(errNeedPath)
continueOn = False
End If
If continueOn Then
Dim fso, folderObj
Set fso = CreateObject("Scripting.FileSystemObject")
Set folderObj = fso.GetFolder(args(0))
ReportResults(LoopWithin(folderObj, True))
End If
End Sub