New script: Change track# format to <disc#><trk#
New script: Change track# format to <disc#><trk#
I really dislike albums tagged like "Yessongs (disc 1)" and "Yessongs (disc 2)." It's really all one album! Using that scheme, the tracks are usually labeled 1-n within each disc.
I prefer having one album entry per album and giving each track a unique number. 1-n would be fine, but an alternative that is especially useful if track numbers already exist under the "disc n" philosophy is to label them with a <disc#><trk#> scheme. Thus, disc 1, trk 3 becomes track# 103. I have developed a script to do this. (My first script! Yay!) Here it is:
FILENAME: FixTrkNo.vbs
'changes track# from format t to dtt (e.g. disc 1, trk 3 becomes track# 103)
'where t = trk# and d = disc#
'only works for track#s 99 or less
Option Explicit
Sub FixTrkNo
'Define variables
Dim list, itm, i, tmp, discno
discno = inputbox("Enter disc number")
'Get list of selected tracks from MediaMonkey
Set list = SDB.SelectedSongList
If list.count=0 Then
Set list = SDB.AllVisibleSongList
End If
'Process all selected tracks
For i=0 To list.count-1
Set itm = list.Item(i)
if itm.trackorder < 10 then
itm.TrackOrder = discno & "0" & itm.TrackOrder
else
itm.TrackOrder = discno & itm.TrackOrder
end if
'Update the changes in DB
itm.UpdateDB
Next
End Sub
ADD THIS ENTRY TO YOUR SCRIPTS.INI FILE:
[FixTrkNo]
FileName=FixTrkNo.vbs
ProcName=FixTrkNo
Order=2
DisplayName=&Format Track# to dnn
Description=Change Track# to disc number + track#
Language=VBScript
ScriptType=0
To use, highlight the tracks you want to change, then execute the script. It will ask you which disc# you want and will then do the rename.
I prefer having one album entry per album and giving each track a unique number. 1-n would be fine, but an alternative that is especially useful if track numbers already exist under the "disc n" philosophy is to label them with a <disc#><trk#> scheme. Thus, disc 1, trk 3 becomes track# 103. I have developed a script to do this. (My first script! Yay!) Here it is:
FILENAME: FixTrkNo.vbs
'changes track# from format t to dtt (e.g. disc 1, trk 3 becomes track# 103)
'where t = trk# and d = disc#
'only works for track#s 99 or less
Option Explicit
Sub FixTrkNo
'Define variables
Dim list, itm, i, tmp, discno
discno = inputbox("Enter disc number")
'Get list of selected tracks from MediaMonkey
Set list = SDB.SelectedSongList
If list.count=0 Then
Set list = SDB.AllVisibleSongList
End If
'Process all selected tracks
For i=0 To list.count-1
Set itm = list.Item(i)
if itm.trackorder < 10 then
itm.TrackOrder = discno & "0" & itm.TrackOrder
else
itm.TrackOrder = discno & itm.TrackOrder
end if
'Update the changes in DB
itm.UpdateDB
Next
End Sub
ADD THIS ENTRY TO YOUR SCRIPTS.INI FILE:
[FixTrkNo]
FileName=FixTrkNo.vbs
ProcName=FixTrkNo
Order=2
DisplayName=&Format Track# to dnn
Description=Change Track# to disc number + track#
Language=VBScript
ScriptType=0
To use, highlight the tracks you want to change, then execute the script. It will ask you which disc# you want and will then do the rename.
Happy user of MediaMonkey Gold version 2.5.5.998
Computer: p4, 2.5 ghz, 3 gb ram, win xp
Computer: p4, 2.5 ghz, 3 gb ram, win xp
Nice!!!
Download MediaMonkey | License
Help: Knowledge Base | MediaMonkey for Windows 5 | MediaMonkey for Android
Lowlander (MediaMonkey user since 2003)
Help: Knowledge Base | MediaMonkey for Windows 5 | MediaMonkey for Android
Lowlander (MediaMonkey user since 2003)
Modified Script to CREATE Track numbers
This is a great script! I took the liberty of modifying it so that I can automatically create track numbers on tracks that do not have one yet. It's simple, but it works. Will work on it more to give a start number and pass tracks that already have a number without increasing the counter.
Here we go:
[b]---cut here---[/b]
'creates a track# in the dtt format (e.g. disc 1, trc i becomes track# 10i)
'goes through all selected tracks sequentially, always starting with track# 1
'should skip all tracks that do have numbers
Option Explicit
Sub MkTrkNo
'Define variables
Dim list, itm, i, tmp, discno
discno = inputbox("Enter disc number")
'Get list of selected tracks from MediaMonkey
Set list = SDB.SelectedSongList
If list.count=0 Then
Set list = SDB.AllVisibleSongList
End If
'Process all selected tracks
For i=1 To list.count
Set itm = list.Item(i-1)
if itm.trackorder < 1 then
if i < 10 then
itm.TrackOrder = discno & "0" & i
else
itm.TrackOrder = discno & i
end if
end if
'Update the changes in DB
itm.UpdateDB
Next
End Sub
[b]---cut here---[/b]
This needs to go into Scripts.ini
[b]---cut here---[/b]
[MkTrkNo]
FileName=MkTrkNo.vbs
ProcName=MkTrkNo
Order=2
DisplayName=&Make Track# in dnn format
Description=Create Track# (starting at 1) in disc number + track#
Language=VBScript
ScriptType=0
Here we go:
[b]---cut here---[/b]
'creates a track# in the dtt format (e.g. disc 1, trc i becomes track# 10i)
'goes through all selected tracks sequentially, always starting with track# 1
'should skip all tracks that do have numbers
Option Explicit
Sub MkTrkNo
'Define variables
Dim list, itm, i, tmp, discno
discno = inputbox("Enter disc number")
'Get list of selected tracks from MediaMonkey
Set list = SDB.SelectedSongList
If list.count=0 Then
Set list = SDB.AllVisibleSongList
End If
'Process all selected tracks
For i=1 To list.count
Set itm = list.Item(i-1)
if itm.trackorder < 1 then
if i < 10 then
itm.TrackOrder = discno & "0" & i
else
itm.TrackOrder = discno & i
end if
end if
'Update the changes in DB
itm.UpdateDB
Next
End Sub
[b]---cut here---[/b]
This needs to go into Scripts.ini
[b]---cut here---[/b]
[MkTrkNo]
FileName=MkTrkNo.vbs
ProcName=MkTrkNo
Order=2
DisplayName=&Make Track# in dnn format
Description=Create Track# (starting at 1) in disc number + track#
Language=VBScript
ScriptType=0
Thanks, docbobo. This could come in handy at times! Usually, I've been able to set track numbers via "tag from filename," but this could save me from having to do that step. I look forward to future updates.
P.S. You might want to use the "Code" button in the forum to post your code. It should preserve any indentations that way and make it easier to read. (I didn't know about that myself when I posted the original script!)
P.S. You might want to use the "Code" button in the forum to post your code. It should preserve any indentations that way and make it easier to read. (I didn't know about that myself when I posted the original script!)
Happy user of MediaMonkey Gold version 2.5.5.998
Computer: p4, 2.5 ghz, 3 gb ram, win xp
Computer: p4, 2.5 ghz, 3 gb ram, win xp
May I suggest a further improvement of the script (by the way: my first script ). The last version leaves the track number untouched if it is already set. But probably you still want the disc# as a prefix.
How about this ...
How about this ...
Code: Select all
'creates a track# in the dtt format (e.g. disc 1, trc i becomes track# 10i)
'goes through all selected tracks sequentially, always starting with track# 1
'Writes disc#+track# if trck# already set, otherwiese disc#+list position
Option Explicit
Sub CorrectTrackNumber
'Define variables
Dim list, itm, i
Dim discno, trackno
discno = inputbox("Enter disc number")
'Remember: discno can be entered empty!
'-----------------
'Get list of selected tracks from MediaMonkey
'-----------------
Set list = SDB.SelectedSongList
If list.count=0 Then
Set list = SDB.AllVisibleSongList
End If
'-----------------
'Process all selected tracks
'-----------------
For i=1 To list.count
Set itm = list.Item(i-1)
' Determine the track# to use
if itm.trackorder < 1 then
trackno = i
else
trackno = itm.trackorder
end if
' concatenate disc# and track#
if trackno < 10 then
itm.TrackOrder = discno & "0" & trackno
else
itm.TrackOrder = discno & trackno
end if
'Update the changes in DB
itm.UpdateDB
Next
End Sub
Last edited by rk on Thu Aug 04, 2005 6:54 am, edited 1 time in total.
Formatting with leading zero
Perhaps a solution in my small script here, I use a string of zeros and the left function. Works for me with 700+ songs ...roylayer wrote:Glad you like it!
P.S. As you can see in the script, I was able to work around not knowing how to format the track number with a leading zero. Just curious about it for future reference.
This script can be used to automatically fill in the disc number as well (assuming that your album names are named systematically): http://www.mediamonkey.com/forum/viewtopic.php?t=7588
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Try this improvement on TrixMoto's script...
Try this improvement on TrixMoto's script... I modified the original script, using regular expressions to perform the pattern match, instead of "InStr()" commands. Regular expressions are much more powerful and flexible (but they do require a slight learning curve if you're unfamiliar).
Here are my notes from the modified script:
Here are my notes from the modified script:
Here is the modified script, in its entirety:' - Uses regular expressions to improve the pattern matching capability and flexibility
' - Supports disc/cd numbers up to 20 (from the original author's max of 3)
' - Supports number strings (e.g., "Disc One")
' - Is case-insensitive
'
' Basically, it searches for the text "CD" or "Disc" followed by a "disc number"
' - The disc number can be represented by numeric digits (e.g. 1,2,3) or text (e.g., "one","two","three")
' - The disc number can be optionally preceded by the number sign (#) and/or white space
' - The entire string can be optionally enclosed by square brackets, curly brackets, or parentheses
' - The entire string can be optionally preceded by a single comma and/or white space
'
'=============================================================================================================================================
' NOTES:
'
' I. As in the original script, any disc number text (e.g., " (CD 1)" or ", [disc twelve]") is removed from the album text
' - An option could added in the future to "Modify album text (Y/N)?", defaulting to "Yes"
'
' II. I purposely chose not to mess with any preceding or trailing colon characters (":")
' - You could easily modify the regExpPatterns to your personal preference
'
' III. This script will detect false matches on album text such as "CD5", where "CD5" refers to a 5-inch CD single. Oh, well.
' - I suppose someone could implement an HTML popup that lets you preview/confirm changes (ala, Risser's Case Checker)
'
' IV. This script can be easily modified to support regional variations of the terms "CD" or "Disc" (e.g., "disque"),
as well as equivalents for the number text (e.g., "un", "deux", "trois").
'
' TO USE:
' - Use the MediaMonkey search tool (Ctrl-F) to look for "CD" or "Disc" (or a similar term) in the album field
' - Then, simply highlight the desired tracks and run the script ( Tools -> Script -> CombineAlbums )
Code: Select all
'=============================================================================================================================================
'
' MediaMonkey Script
'
' NAME: CombineAlbums 1.0
'
' AUTHOR: trixmoto (http://trix.dork.com)
' DATE : 16/01/2006
'
' INSTALL: Copy to Scripts directory and add the following to Scripts.ini
' Don't forget to remove comments (') and set the order appropriately
' Set up text for your albums (see below: *)
'
' [CombineAlbums]
' FileName=CombineAlbums.vbs
' ProcName=CombineAlbums
' Order=18
' DisplayName=Combine Albums
' Description=Combine Albums
' Language=VBScript
' ScriptType=0
'
'=============================================================================================================================================
' MODIFIED BY: tj_junk
' DATE : 2007-02-26
'
' MODIFICATIONS:
'
' - Uses regular expressions to improve the pattern matching capability and flexibility
' - Supports disc/cd numbers up to 20 (from the original author's max of 3)
' - Supports number strings (e.g., "Disc One")
' - Is case-insensitive
'
' Basically, it searches for the text "CD" or "Disc" followed by a "disc number"
' - The disc number can be represented by numeric digits (e.g. 1,2,3) or text (e.g., "one","two","three")
' - The disc number can be optionally preceded by the number sign (#) and/or white space
' - The entire string can be optionally enclosed by square brackets, curly brackets, or parentheses
' - The entire string can be optionally preceded by a single comma and/or white space
'
'=============================================================================================================================================
' NOTES:
'
' I. As in the original script, any disc number text (e.g., " (CD 1)" or ", [disc twelve]") is removed from the album text
' - An option could added in the future to "Modify album text (Y/N)?", defaulting to "Yes"
'
' II. I purposely chose not to mess with any preceding or trailing colon characters (":")
' - You could easily modify the regExpPatterns to your personal preference
'
' III. This script will detect false matches on album text such as "CD5", where "CD5" refers to a 5-inch CD single. Oh, well.
' - I suppose someone could implement an HTML popup that lets you preview/confirm changes (ala, Risser's Case Checker)
'
' IV. This script can be easily modified to support regional variations of the terms "CD" or "Disc" (e.g., "disque"),
as well as equivalents for the number text (e.g., "un", "deux", "trois").
'
' TO USE:
' - Use the MediaMonkey search tool (Ctrl-F) to look for "CD" or "Disc" (or a similar term) in the album field
' - Then, simply highlight the desired tracks and run the script ( Tools -> Script -> CombineAlbums )
'=============================================================================================================================================
Option Explicit
Dim regExpPatterns, regExpPatternsList
regExpPatterns = ",?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(1|one|un)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(2|two|deux)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(3|three|trois)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(4|four|quatre)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(5|five|cinq)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(6|six)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(7|seven|sept)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(8|eight|huit)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(9|nine|neuf)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(10|ten|dix)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(11|eleven|onze)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(12|twelve|douze)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(13|thirteen|treize)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(14|fourteen|quatorze)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(15|fifteen|quinze)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(16|sixteen|seize)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(17|seventeen|dix-sept)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(18|eighteen|dix-huit)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(19|nineteen|dix-neuf)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(20|twenty|vingt)\b\s?[\]\}\)]?"
regExpPatternsList = Split(regExpPatterns,"&")
'==========================================================================================================
Sub CombineAlbums
Dim list,itm,prog,i,p,s,c
Set list = SDB.CurrentSongList
Set prog = SDB.Progress
prog.Text = "Initialising script..."
prog.MaxValue = list.Count
c = 0
Dim regEx, regExFound, j
Set regEx = New RegExp ' Create a regular expression.
regEx.ignoreCase = True ' Set case insensitivity.
For i=0 To list.Count-1
prog.Text = "Checking file "&(i+1)&" of "&list.Count&"..."
prog.Value = i
Set itm = list.Item(i)
s = itm.AlbumName
For j = 0 To UBound(regExpPatternsList)
regEx.pattern = regExpPatternsList(j)
regExFound = regEx.Test(s)
If regExFound Then
If itm.TrackOrder < 100 Then
c = c + 1
itm.AlbumName = regEx.Replace(s, "")
itm.TrackOrder = ((j+1)*100)+Itm.TrackOrder
End If
End If
Next
itm.UpdateDB
If prog.Terminate Then Exit For
Next
prog.Text = "Finalizing script..."
prog.Value = prog.MaxValue
p = SDB.MessageBox("Tracks updated: "&c&" out of "&list.Count,mtInformation,Array(mbOk))
Set prog = Nothing
End Sub
(Forgot to quote a comment line...)
I forgot to quote a comment line (line #53).
This script should now work fine...
This script should now work fine...
Code: Select all
'=============================================================================================================================================
'
' MediaMonkey Script
'
' NAME: CombineAlbums 1.0
'
' AUTHOR: trixmoto (http://trix.dork.com)
' DATE : 16/01/2006
'
' INSTALL: Copy to Scripts directory and add the following to Scripts.ini
' Don't forget to remove comments (') and set the order appropriately
' Set up text for your albums (see below: *)
'
' [CombineAlbums]
' FileName=CombineAlbums.vbs
' ProcName=CombineAlbums
' Order=18
' DisplayName=Combine Albums
' Description=Combine Albums
' Language=VBScript
' ScriptType=0
'
'=============================================================================================================================================
' MODIFIED BY: tj_junk
' DATE : 2007-02-26
'
' MODIFICATIONS:
'
' - Uses regular expressions to improve the pattern matching capability and flexibility
' - Supports disc/cd numbers up to 20 (from the original author's max of 3)
' - Supports number strings (e.g., "Disc One")
' - Is case-insensitive
'
' Basically, it searches for the text "CD" or "Disc" followed by a "disc number"
' - The disc number can be represented by numeric digits (e.g. 1,2,3) or text (e.g., "one","two","three")
' - The disc number can be optionally preceded by the number sign (#) and/or white space
' - The entire string can be optionally enclosed by square brackets, curly brackets, or parentheses
' - The entire string can be optionally preceded by a single comma and/or white space
'
'=============================================================================================================================================
' NOTES:
'
' I. As in the original script, any disc number text (e.g., " (CD 1)" or ", [disc twelve]") is removed from the album text
' - An option could added in the future to "Modify album text (Y/N)?", defaulting to "Yes"
'
' II. I purposely chose not to mess with any preceding or trailing colon characters (":")
' - You could easily modify the regExpPatterns to your personal preference
'
' III. This script will detect false matches on album text such as "CD5", where "CD5" refers to a 5-inch CD single. Oh, well.
' - I suppose someone could implement an HTML popup that lets you preview/confirm changes (ala, Risser's Case Checker)
'
' IV. This script can be easily modified to support regional variations of the terms "CD" or "Disc" (e.g., "disque"),
' as well as equivalents for the number text (e.g., "un", "deux", "trois").
'
' TO USE:
' - Use the MediaMonkey search tool (Ctrl-F) to look for "CD" or "Disc" (or a similar term) in the album field
' - Then, simply highlight the desired tracks and run the script ( Tools -> Script -> CombineAlbums )
'=============================================================================================================================================
Option Explicit
Dim regExpPatterns, regExpPatternsList
regExpPatterns = ",?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(1|one|un)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(2|two|deux)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(3|three|trois)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(4|four|quatre)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(5|five|cinq)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(6|six)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(7|seven|sept)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(8|eight|huit)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(9|nine|neuf)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(10|ten|dix)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(11|eleven|onze)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(12|twelve|douze)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(13|thirteen|treize)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(14|fourteen|quatorze)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(15|fifteen|quinze)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(16|sixteen|seize)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(17|seventeen|dix-sept)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(18|eighteen|dix-huit)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(19|nineteen|dix-neuf)\b\s?[\]\}\)]?" _
& "&,?\s?[\[\{\(]?(CD|Disc|Disque)\s?#?(20|twenty|vingt)\b\s?[\]\}\)]?"
regExpPatternsList = Split(regExpPatterns,"&")
'==========================================================================================================
Sub CombineAlbums
Dim list,itm,prog,i,p,s,c
Set list = SDB.CurrentSongList
Set prog = SDB.Progress
prog.Text = "Initialising script..."
prog.MaxValue = list.Count
c = 0
Dim regEx, regExFound, j
Set regEx = New RegExp ' Create a regular expression.
regEx.ignoreCase = True ' Set case insensitivity.
For i=0 To list.Count-1
prog.Text = "Checking file "&(i+1)&" of "&list.Count&"..."
prog.Value = i
Set itm = list.Item(i)
s = itm.AlbumName
For j = 0 To UBound(regExpPatternsList)
regEx.pattern = regExpPatternsList(j)
regExFound = regEx.Test(s)
If regExFound Then
If itm.TrackOrder < 100 Then
c = c + 1
itm.AlbumName = regEx.Replace(s, "")
itm.TrackOrder = ((j+1)*100)+Itm.TrackOrder
End If
End If
Next
itm.UpdateDB
If prog.Terminate Then Exit For
Next
prog.Text = "Finalizing script..."
prog.Value = prog.MaxValue
p = SDB.MessageBox("Tracks updated: "&c&" out of "&list.Count,mtInformation,Array(mbOk))
Set prog = Nothing
End Sub
Made a little extension that will also check path name if album name check fails:
Code: Select all
For i=0 To list.Count-1
prog.Text = "Checking file "&(i+1)&" of "&list.Count&"..."
prog.Value = i
Set itm = list.Item(i)
s = itm.AlbumName
path = itm.Path ' alternatively check for path name, too
For j = 0 To UBound(regExpPatternsList)
regEx.pattern = regExpPatternsList(j)
regExFound = regEx.Test(s)
If regExFound Then
If itm.TrackOrder < 100 Then
c = c + 1
itm.AlbumName = regEx.Replace(s, "")
itm.TrackOrder = ((j+1)*100)+Itm.TrackOrder
End If
Else
' alternatively check for path name, too
regExFound = regEx.Test(path)
If regExFound Then
If itm.TrackOrder < 100 Then
c = c + 1
itm.TrackOrder = ((j+1)*100)+Itm.TrackOrder
End If
End If
End If
Next
itm.UpdateDB
If prog.Terminate Then Exit For
Next