I modified Steegy's wonderful script for my own use so that you can click the tags just like Auto-Organize to build your input mask. The only problem is that it only works for the first input mask textbox. Due to the limited events supported by MM and my limited knowledge of VBScript, I could not get the "Click and Insert" feature to work for any input masik textbox, other than the first one.
I was hoping that I could set a variable whenever I "entered" one of the textboxes (something like an "OnFocus" event) so that I could "Click and Insert" to the last entered mask textbox. Well, I couldn't get that to work. But, my tweak does work great for the first textbox, and that's perfect for most of the times that I use this script.
Code: Select all
'====================================================================================
'
' MEDIAMONKEY SCRIPT: ExtractFields v0.1.3 (last updated 2007-02-01) by Steegy aka RC (Ruben Castelein)
'
' Change your tags using the contents of the current tags.
' You can use different "entry lines". Each entry line gets/puts it's information
' from/in the specified information field (chosen from the dropdown list). The mask that you specify will
' make sure that the chosen information field gets parsed and the other fields are filled with the info,
' or that the chosen information field will be filled like specified in the mask.
' This script is generally applicable and can be used to replace scripts like:
' - SwapArtistTitle
' - SwitchOrCopyFields
' - Split Artist Title
' and maybe other.
'
' Responsability for using this script (in all cases, in any way) is all on your own shoulders.
'
'====================================================================================
Option Explicit
'*****************************************************
'**** USER DEFAULTS ****
'*****************************************************
'*******************************************************************************
'**** TJ START *************************************************************
Const def_TagSeparator = " " ' Used to separate tag masks that are added via the tag mask buttons
'**** TJ END ***************************************************************
'*******************************************************************************
Const def_EntryLinesCnt = 2
Const def_TagField = "Title"
Const def_TagMask = "%A - %S"
'*******************************************************************************
'TODD: INCREASE THIS FOR FLEXIBIILITY
'*******************************************************************************
'*****************************************************
'**** SCRIPT PROPERTIES ****
'*****************************************************
Const RequiredMMVersion = 253
Const ScriptName = "ExtractFields"
Const ScriptCaption = "Extract Fields..."
Const ScriptHint = "Change tags based on existing tags"
Const ScriptShortCut = "Ctrl+Alt+X"
'*****************************************************
'**** GLOBAL DECLARATIONS ****
'*****************************************************
Dim Form, lblMasks, edtMasks, SpinEdit, lblPemTag, btnPem, lblPemValue, lblSpin, btnSpin, btnClose, btnExtractFields
'*******************************************************************************
'**** TJ START *************************************************************
'*******************************************************************************
Dim btnMaskTags
Dim current_editbox
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
Dim NumberOfEntryLines
Dim DataFieldsArray()
Dim MaskTextArray()
Dim EnableStateArray()
Dim DirectionArray()
Dim ParseEntryMethod
Const pemSerial = 1
Const pemParallel = 2
'*****************************************************
'**** ENTRY POINT ****
'*****************************************************
Sub OnStartup
Dim CurrentVersion : CurrentVersion = SDB.VersionHi & SDB.VersionLo & SDB.VersionRelease
If CurrentVersion < RequiredMMVersion Then
Dim RequiredMMVersionString : RequiredMMVersionString = Mid(RequiredMMVersion, 1, 1) & "." & Mid(RequiredMMVersion, 2, 1) & "." & Mid(RequiredMMVersion, 3, 1)
Dim Text
Text = "'" & ScriptName & "' needs MediaMonkey " & RequiredMMVersionString & " or above." + vbNewLine
Text = Text & "Please Download the latest Version on http://www.MediaMonkey.com" & vbNewLine & vbNewLine
SDB.MessageBox Text, mtError, Array(mbOK)
Else
Dim MenuItem : Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Scripts, 0, -1)
MenuItem.Caption = ScriptCaption
MenuItem.Hint = ScriptHint
MenuItem.IconIndex = 25
MenuItem.ShortCut = ScriptShortCut
Script.RegisterEvent MenuItem, "OnClick", ScriptName
Dim TBItem : Set TBItem = SDB.UI.AddMenuItem(SDB.UI.Menu_TbStandard, 0, -1)
TBItem.Caption = ScriptCaption
TBItem.Hint = ScriptHint
TBItem.IconIndex = 25
TBItem.ShortCut = ScriptShortCut
Script.RegisterEvent TBItem, "OnClick", ScriptName
End If
End Sub
'*******************************************************************************
'****
'*******************************************************************************
Sub ExtractFields(MenuItem)
Set Form = CreateForm("Change tags based on existing tags", 100, 100, 495, 140, bsDialog, poScreenCenter, True, "ExtractFields_Form")
Call CreateLabel(Form, "Enabled", 7, 15, 50, 20)
Call CreateLabel(Form, "Field name", 85, 15, 60, 20)
Call CreateLabel(Form, "Mask to recognise or tag", 280, 15, 120, 20)
Set lblSpin = CreateLabel(Form, "Entry lines # :", 20, 0, 70, 20)
Set SpinEdit = CreateSpinEdit(Form, 95, 0, 50, 20, "SpinEdit")
SpinEdit.MinValue = 1
SpinEdit.MaxValue = 15
SpinEdit.Value = def_EntryLinesCnt
Set btnSpin = CreateButton(Form, "Show", 150, 0, 50, 20, "btnSpin_OnClick")
Set lblPemTag = CreateLabel(Form, "Entry parsing method :", 265, 0, 130, 20)
Set lblPemValue = CreateLabel(Form, " ", 380, 0, 50, 20)
lblPemValue.Caption = "Serial"
ParseEntryMethod = pemSerial
Set btnPem = CreateButton(Form, "Switch", 420, 0, 50, 20, "btnPem_OnClick")
Set btnExtractFields = CreateButton(Form, "Extract Fields", 90, 0, 150, 20, "btnExtractFields_OnClick")
btnExtractFields.Default = True
Set btnClose = CreateButton(Form, "Close", 252, 0, 150, 20, "btnClose_OnClick")
btnClose.Cancel = True
Set lblMasks = CreateLabel(Form, "Usable mask fields :", 20, 0, 90, 20)
' Set edtMasks = CreateLabel(Form, SDB.Tools.Mask2UFText(ArrayToString(CommonTags, ", ")), 120, 0, 350, 50)
' edtMasks.Multiline = True
'*******************************************************************************
'**** TJ START *************************************************************
'*******************************************************************************
'**** BORROWED FROM: NeedsAutoOrganise.vbs
'**** AUTHOR: MoDementia
'**** DATE : 02/07/2006
'**** Version: - 1.2.3
'*******************************************************************************
Dim iCounter
Dim NextX : NextX = 120 'TJ - Changed from '0'
Dim NextY : NextY = -20 'TJ - Changed from '0'
For iCounter = 0 To UBound(MaskTags)
Set btnMaskTags = CreateLabelButtonAutosize(form, SDB.Tools.Mask2UFText(MaskTags(iCounter)), NextX, NextY, "MaskTagClicked")
btnMaskTags.Common.Anchors = akLeft + akBottom
' TJ - Changed following line from "= btnMaskTags.Common.Left + btnMaskTags.Common.Width + 5" to "= NextX +btnMaskTags.Common.Width"
NextX = NextX +btnMaskTags.Common.Width
If NextX > 350 Then
NextX = 120 'TJ - Changed from '0'
NextY = NextY + 15'from 20
End If
Next
current_editbox = 0
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
NumberOfEntryLines = 0
Call ChangeNumberOfEntryLines(def_EntryLinesCnt)
Call SelectDropDownText(DataFieldsArray(0), def_TagField)
'*******************************************************************************
'**** TJ START *************************************************************
'*******************************************************************************
' MaskTextArray(0).Text = SDB.Tools.Mask2UFText(def_TagMask)
MaskTextArray(0).Interf.Text = SDB.Tools.Mask2UFText(def_TagMask)
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
EnableStateArray(0).Checked = True
Form.Common.Visible = True
End Sub
'*******************************************************************************
'****
'*******************************************************************************
Sub ChangeNumberOfEntryLines(NewNumber)
Form.Common.Height = 200 + NewNumber * 25
lblMasks.Common.Top = Form.Common.Height - 145
'*******************************************************************************
'**** TJ START *************************************************************
'*******************************************************************************
' edtMasks.Common.Top = Form.Common.Height - 158
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
lblSpin.Common.Top = Form.Common.Height - 101
SpinEdit.Common.Top = Form.Common.Height - 105
lblPemTag.Common.Top = Form.Common.Height - 101
lblPemValue.Common.Top = Form.Common.Height - 101
btnPem.Common.Top = Form.Common.Height - 105
btnSpin.Common.Top = Form.Common.Height - 105
btnExtractFields.Common.Top = Form.Common.Height - 65
btnClose.Common.Top = Form.Common.Height - 65
Dim i
If NewNumber < NumberOfEntryLines Then
For i = NewNumber To NumberOfEntryLines - 1
EnableStateArray(i).Common.Visible = False
DataFieldsArray(i).Common.Visible = False
MaskTextArray(i).Common.Visible = False
DirectionArray(i).Common.Visible = False
Next
ReDim Preserve EnableStateArray(NewNumber - 1)
ReDim Preserve DataFieldsArray(NewNumber - 1)
ReDim Preserve MaskTextArray(NewNumber - 1)
ReDim Preserve DirectionArray(NewNumber - 1)
Else
ReDim Preserve EnableStateArray(NewNumber - 1)
ReDim Preserve DataFieldsArray(NewNumber - 1)
ReDim Preserve MaskTextArray(NewNumber - 1)
ReDim Preserve DirectionArray(NewNumber - 1)
For i = NumberOfEntryLines To NewNumber - 1
Dim chkEnabled : Set chkEnabled = CreateCheckBox(Form, " ", 20, 10 + 25*(i+1), 15, 20, "chkEnabled" & i)
Dim ddnDataFields : Set ddnDataFields = CreateDropDown(Form, 55, 10 + 25*(i+1), 130, 20, "ddnDataFields" & i)
ddnDataFields.Style = csDropDownList
Call FillDropDownFromArray(ddnDataFields, SongDataFields)
Dim btnChangeDirection : Set btnChangeDirection = CreateButton(Form, "-->", 192, 10 + 25*(i+1), 40, 20, "btnChangeDirection_OnClick")
btnChangeDirection.Common.ControlName = "btnChangeDirection" & i
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
' Dim edtMaskText : Set edtMaskText = CreateEdit(Form, "", 240, 10 + 25*(i+1), 230, 15, "edtMaskText" & i)
Dim edtMaskText : Set edtMaskText = CreateEdit(Form, "", 240, 10 + 25*(i+1), 230, 20, "edtMaskText" & i)
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
Set EnableStateArray(i) = chkEnabled
Set DataFieldsArray(i) = ddnDataFields
Set MaskTextArray(i) = edtMaskText
Set DirectionArray(i) = btnChangeDirection
Next
End If
NumberOfEntryLines = NewNumber
' Stupid, but the only way to get a redraw of the form (and so get correct displaying of the newly added controls)
Form.Common.Visible = False
Form.Common.Visible = True
End Sub
'*****************************************************
'**** EVENT HANDLING METHODS ****
'*****************************************************
Sub btnChangeDirection_OnClick(Button)
If Button.Caption = "-->" Then
Button.Caption = "<--"
Else
Button.Caption = "-->"
End If
End Sub
'*******************************************************************************
'****
'*******************************************************************************
Sub btnPem_OnClick(btnPem)
If ParseEntryMethod = pemSerial Then
lblPemValue.Caption = "Parallel"
ParseEntryMethod = pemParallel
Else
lblPemValue.Caption = "Serial"
ParseEntryMethod = pemSerial
End If
End Sub
'*******************************************************************************
'****
'*******************************************************************************
Sub btnSpin_OnClick(btnSpin)
Call ChangeNumberOfEntryLines(SpinEdit.Value)
End Sub
'*******************************************************************************
'****
'*******************************************************************************
Sub btnClose_OnClick(btnClose)
Form.Common.Visible = False
Set Form = Nothing
End Sub
'*******************************************************************************
'****
'*******************************************************************************
Sub btnExtractFields_OnClick(btnExtractFields)
Dim SongList : Set SongList = SDB.CurrentSongList
Dim Progress : Set Progress = SDB.Progress
Progress.Text = SDB.Localize("Extracting and applying field information...")
Progress.MaxValue = SongList.Count
Dim i, j, Song, SongOrig, MaskTextInternal
For i = 0 To SongList.Count - 1
Progress.Text = SDB.Localize("Extracting and applying field information... (Track " & (i+1) & " of " & SongList.Count & ")")
Set Song = SongList.Item(i)
Set SongOrig = Song.GetCopy
'Song.ArtistName = ""
'Song.AlbumArtistName = ""
For j = 0 To UBound(EnableStateArray)
If EnableStateArray(j).Checked = True Then
If DirectionArray(j).Caption = "-->" Then
'*******************************************************************************
'**** TJ START *************************************************************
'*******************************************************************************
' MaskTextInternal = SDB.Tools.UFText2Mask(MaskTextArray(j).Text)
MaskTextInternal = SDB.Tools.UFText2Mask(MaskTextArray(j).Interf.Text)
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
If ParseEntryMethod = pemSerial Then
Execute("Call Song.ParseText(Song." & DataFieldsArray(j).Text & ", MaskTextInternal)")
Else 'ParseEntryMethod = pemParallel
Execute("Call Song.ParseText(SongOrig." & DataFieldsArray(j).Text & ", MaskTextInternal)")
End If
Else
'*******************************************************************************
'**** TJ START *************************************************************
'*******************************************************************************
' MaskTextInternal = SDB.Tools.UFText2Mask(MaskTextArray(j).Text)
MaskTextInternal = SDB.Tools.UFText2Mask(MaskTextArray(j).Interf.Text)
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
If ParseEntryMethod = pemSerial Then
Execute("Song." & DataFieldsArray(j).Text & " = Fillin(Song, MaskTextInternal)")
Else 'ParseEntryMethod = pemParallel
Execute("Song." & DataFieldsArray(j).Text & " = Fillin(SongOrig, MaskTextInternal)")
End If
End If
End If
Next
'If Song.ArtistName = "" Then Song.ArtistName = SongOrig.ArtistName
'If Song.AlbumArtistName = "" Then Song.AlbumArtistName = SongOrig.AlbumArtistName
Progress.Value = i + 1
Song.UpdateAlbum
Song.UpdateArtist
Song.UpdateDB
Next
Call SongList.UpdateAll
End Sub
'*******************************************************************************
'****
'*******************************************************************************
Function Fillin(Song, MaskTextInternal)
Fillin = MaskTextInternal
Dim key
For Each key In FieldDict.Keys
Call Execute("Fillin = Replace(Fillin, key, CStr(Song." & FieldDict(key) & "), 1, -1, 1)")
Next
End Function
'*******************************************************************************
'****
'*******************************************************************************
Function ArrayToString(SourceArray, SepChar)
ArrayToString = SourceArray(0)
Dim i
For i = 1 To UBound(SourceArray)
ArrayToString = ArrayToString & SepChar & SourceArray(i)
Next
End Function
'*****************************************************
'**** CONTROLS UTILITY METHODS ****
'*****************************************************
' BorderStyle constants
const bsNone = 0 'No border
const bsSizeable = 2 'Standard window (resizable)
const bsDialog = 3 'Dialog window (not resizable)
const bsToolWindow = 4 'Toolwindow (not resizable)
const bsSizeToolWin = 5 'Toolwindow (resizable)
' Position constants (for Forms)
const poDesigned = 0 'Position and size specified by Left, Top, Width and Height
const poDefault = 1 'Position and size determined by the operating system
const poScreenCenter = 4 'Centered on the screen
' DropDown Style constants
Const csDropDown = 0 'DropDown can be edited
Const csDropDownList = 2 'DropDown cannot be edited (user can only select from a list of values)
Function CreateForm(Caption, X, Y, Width, Height, BorderStyle, FormPosition, StayOnTop, SavePositionName)
Set CreateForm = SDB.UI.NewForm
CreateForm.Caption = Caption
CreateForm.Common.SetRect X, Y, Width, Height
CreateForm.BorderStyle = BorderStyle
CreateForm.FormPosition = FormPosition
CreateForm.StayOnTop = StayOnTop
CreateForm.SavePositionName = SavePositionName
End Function
Function CreateDropDown(Owner, X, Y, Width, Height, ControlName)
Set CreateDropDown = SDB.UI.NewDropDown(Owner)
CreateDropDown.Common.SetRect X, Y, Width, Height
CreateDropDown.Common.ControlName = ControlName
End Function
'*******************************************************************************
'**** TJ START *************************************************************
'*******************************************************************************
Sub textBox1_Enter(textBox1)
' If the TextBox contains text, change its foreground and background colors.
If textBox1.Text <> [String].Empty Then
textBox1.ForeColor = Color.Red
textBox1.BackColor = Color.Black
' Move the selection pointer to the end of the text of the control.
textBox1.SelectAll
End If
End Sub 'textBox1_Enter
Sub edtMaskText_OnClick(edtMaskText)
SDB.MessageBox "HEY! SHOW ME SOMETHING!!!", mtInformation, Array(mbOK)
Dim i
For i = 0 to NumberOfEntryLines - 1
If MaskTextArray(i) = edtMaskText Then
current_editbox = i
Exit For
End If
Next
End Sub
Function CreateEdit(Owner, Text, X, Y, Width, Height, ControlName)
Set CreateEdit = SDB.UI.NewActiveX(Owner, "Forms.TextBox.1")
CreateEdit.Interf.HideSelection = False
CreateEdit.Interf.BorderStyle = 1 ' Forms.TextBox.1
CreateEdit.Interf.BorderColor = &H888888
CreateEdit.Interf.Text = Text
CreateEdit.Common.SetRect X, Y, Width, Height
CreateEdit.Common.ControlName = ControlName
' CreateEdit.Interf.BackColor = &H000000
' CreateEdit.Interf.ForeColor = &HEFEFEF
Script.RegisterEvent CreateEdit, "OnClick", "edtMaskText_OnClick"
Script.RegisterEvent CreateEdit.Common, "OnClick", "edtMaskText_OnClick"
' Script.RegisterEvent CreateEdit.Common, "OnEnter", "edtMaskText_OnEnter"
' Script.RegisterEvent CreateEdit.Common, "OnSelect", "edtMaskText_OnEnter"
' Script.RegisterEvent CreateEdit.Common, "OnEdited", "edtMaskText_OnEnter"
' Script.RegisterEvent CreateEdit.Common, "OnGotFocus", "edtMaskText_OnEnter"
End Function
'Function CreateEdit(Owner, Text, X, Y, Width, Height, ControlName)
'
' Set CreateEdit = SDB.UI.NewEdit(Owner)
' CreateEdit.Text = Text
' CreateEdit.Common.SetRect X, Y, Width, Height
' CreateEdit.Common.ControlName = ControlName
'
'End Function
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
Function CreateSpinEdit(Owner, X, Y, Width, Height, ControlName)
Set CreateSpinEdit = SDB.UI.NewSpinEdit(Owner)
CreateSpinEdit.Common.SetRect X, Y, Width, Height
CreateSpinEdit.Common.ControlName = ControlName
End Function
Function CreateButton(Owner, Caption, X, Y, Width, Height, OnClickHandler)
Set CreateButton = SDB.UI.NewButton(Owner)
CreateButton.Caption = Caption
CreateButton.Common.SetRect X, Y, Width, Height
If OnClickHandler <> "" Then
Script.RegisterEvent CreateButton.Common, "OnClick", OnClickHandler
End If
End Function
Function CreateLabel(Owner, Caption, X, Y, Width, Height)
Set CreateLabel = SDB.UI.NewLabel(Owner)
CreateLabel.Caption = Caption
CreateLabel.Common.SetRect X, Y, Width, Height
End Function
Function CreateCheckBox(Owner, Caption, X, Y, Width, Height, ControlName)
Set CreateCheckBox = SDB.UI.NewCheckBox(Owner)
CreateCheckBox.Caption = Caption
CreateCheckBox.Common.SetRect X, Y, Width, Height
CreateCheckBox.Common.ControlName = ControlName
End Function
Sub SelectDropDownText(DropDown, Text)
Dim i
For i = 0 To DropDown.ItemCount - 1
If DropDown.ItemText(i) = Text Then
DropDown.ItemIndex = i
DropDown.Text = Text
Exit For
End If
Next
End Sub
Sub FillDropDownFromArray(DropDown, SourceArray)
Dim i
For i = 0 To UBound(SourceArray)
DropDown.AddItem SourceArray(i)
Next
End Sub
'*******************************************************************************
'**** TJ START *************************************************************
'*******************************************************************************
'**** BORROWED FROM: NeedsAutoOrganise.vbs
'**** AUTHOR: MoDementia
'**** DATE : 02/07/2006
'**** Version: - 1.2.3
'*******************************************************************************
Function CreateLabelButtonAutosize(Owner, Caption, X, Y, OnClickHandler)
Set CreateLabelButtonAutosize = SDB.UI.NewLabel(Owner)
CreateLabelButtonAutosize.Caption = RTrim(Caption)
CreateLabelButtonAutosize.Autosize = True
CreateLabelButtonAutosize.Common.Left = X
CreateLabelButtonAutosize.Common.Top = Y
If OnClickHandler <> "" Then
Script.RegisterEvent CreateLabelButtonAutosize.Common, "OnClick", OnClickHandler
End If
End Function
'*******************************************************************************
'**** BORROWED FROM: NeedsAutoOrganise.vbs
'**** AUTHOR: MoDementia
'**** DATE : 02/07/2006
'**** Version: - 1.2.3
'*******************************************************************************
Sub MaskTagClicked(Button)
If MaskTextArray(current_editbox).Interf.SelStart = 0 Then
MaskTextArray(current_editbox).Interf.SelText = Button.Caption
Else
MaskTextArray(current_editbox).Interf.SelText = def_TagSeparator & Button.Caption
End If
End Sub
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
'*****************************************************
'**** EXTRA ENUMERATIONS ****
'*****************************************************
Dim CommonTags : CommonTags = Array("%A", "%L", "%S", "%G", "%T", "%Y", "%X", "%R", "%C", "%M", "%B", "%U", "%V", "%W", "%P", "%F")
'*******************************************************************************
'**** TJ START *************************************************************
'*******************************************************************************
'**** BORROWED FROM: NeedsAutoOrganise.vbs
'**** AUTHOR: MoDementia
'**** DATE : 02/07/2006
'**** Version: - 1.2.3
'*******************************************************************************
'Dim MaskTags : MaskTags = Array("%A", "%L", "%S", "%G", "%T", "%Y", "%R", "%C", "%M", "%B", "%U", "%V", "%W")
Dim MaskTags : MaskTags = Array("%A", "%L", "%S", "%G", "%T", "%Y", "%X", "%R", "%C", "%M", "%B", "%U", "%V", "%W", "%P", "%F")
' Anchors constants (control to which borders of the parent control the control is sticked)
Const akLeft = 1 'Distance from the left border of the parent is constant
Const akTop = 2 'Distance from the top border of the parent is constant
Const akRight = 4 'Distance from the right border of the parent is constant
Const akBottom = 8 'Distance from the bottom border of the parent is constant
'*******************************************************************************
'**** TJ END ***************************************************************
'*******************************************************************************
' Enumeration of the most important fields in the SongData object
Dim SongDataFields : SongDataFields = Array( _
"AlbumArtistName", _
"AlbumName", _
"ArtistName", _
"Author", _
"Band", _
"Bitrate", _
"BPM", _
"Comment", _
"Conductor", _
"Copyright", _
"Custom1", _
"Custom2", _
"Custom3", _
"Encoder", _
"Genre", _
"InvolvedPeople", _
"Lyricist", _
"Lyrics", _
"MediaLabel", _
"Mood", _
"MusicComposer", _
"Occasion", _
"OriginalArtist", _
"OriginalLyricist", _
"OriginalTitle", _
"OriginalYear", _
"Publisher", _
"Quality", _
"Rating", _
"Tempo", _
"Title", _
"TrackOrder", _
"Year")
Dim FieldDict : Set FieldDict = CreateObject("Scripting.Dictionary")
With FieldDict
.Add "%A", "ArtistName"
.Add "%C", "Author"
.Add "%G", "Genre"
.Add "%L", "AlbumName"
.Add "%M", "BPM"
.Add "%R", "AlbumArtistName"
.Add "%S", "Title"
.Add "%T", "TrackOrder"
.Add "%U", "Custom1"
.Add "%V", "Custom2"
.Add "%W", "Custom3"
.Add "%Y", "Year"
End With