Script not functioning in usual way, not sure why?


#1

Hello there, I am trying to run a script which has worked perfectly on thousands of tracks but for some reason on a number of albums it is not working.

Is it something to do with the use of " ' " in the folder names? If so, how do I fix it without losing this special character?

Is there a debug log for mp3 tag?

[#0]
T=4
F=DISCNUMBER
1=^(\\d+)/\\d+
2=$1
3=0

[#1]
T=1
F=_TAG
1=1
2=

[#2]
T=5
F=TRACK
1=[$num(%track%,1)]

[#3]
T=4
F=_TAG
1=\\\\b(A|An|The|And|But|Or|So|After|Before|Out|When|While|Since|Until|Although|Even If|Because|About|Above|Across|Against|Along|Alongside|As|At|Below|By|During|For|From|In|Into|Of|Off|On|Onto|Over|Than|Through|Till|To|Under|Up|With|Within|Without)\\\\b
2=$lower($1)
3=0

[#4]
T=4
F=_TAG
1=^\\\\s*(\\\\w+)
2=$caps($1)
3=0

[#5]
T=4
F=_TAG
1=(\\\\w+)\\\\s*$
2=$caps($1)
3=0

[#6]
T=1
F=_DIRECTORY
1=1
2=

[#7]
T=4
F=_DIRECTORY
1=\\\\b(A|An|The|And|But|Or|So|After|Before|Out|When|While|Since|Until|Although|Even If|Because|About|Above|Across|Against|Along|Alongside|As|At|Below|By|During|For|From|In|Into|Of|Off|On|Onto|Over|Than|Through|Till|To|Under|Up|With|Within|Without)\\\\b
2=$lower($1)
3=0

[#8]
T=4
F=_DIRECTORY
1=^\\\\s*(\\\\w+)
2=$caps($1)
3=0

[#9]
T=4
F=_DIRECTORY
1=(\\\\w+)\\\\s*$
2=$caps($1)
3=0

[#10]
T=4
! Trim Trailing, Preceding & Extra Spaces [1]=
F=_DIRECTORY
1=(\\s+$|^\\s+)
2=
3=0

[#11]
T=4
! Trim Trailing, Preceding & Extra Spaces [2]=
F=_DIRECTORY
1=\\s+
2= 
3=0

[#12]
T=4
! Enforce Correct Word Spacing [1]=
F=_DIRECTORY
1=([^\\s\\.;\\)\\]/])([&\\({\\[\\+])
2=$1 $2
3=0

[#13]
T=4
! Enforce Correct Word Spacing [2]=
F=_DIRECTORY
1=(&|\\)|\\}|\\]|;|(?<!\\d),|,(?!\\d{3})|\\+)([^\\s\\.;\\(\\[/])
2=$1 $2
3=0

[#14]
T=4
! Enforce Correct Word Spacing [3]=
F=_DIRECTORY
1=\\b([a-z])\\s(&)\\s([a-z])\\b
2=$1$2$3
3=0

[#15]
T=4
! Enforce Correct Word Spacing [4]=
F=_DIRECTORY
1=([\\(\\[])\\s
2=$1
3=0

[#16]
T=4
! Enforce Correct Word Spacing [5]=
F=_DIRECTORY
1=\\s(\\]|\\)|\\?|:|;|,|\\.(?!\\.\\.))
2=$1
3=0

[#17]
T=4
! Enforce Correct Word Spacing [6]=
F=_DIRECTORY
1=(".*?")([^\\s\\]\\)/\\}!\\-\u003d,.;])(?!$)
2=$1 $2
3=0

[#18]
T=4
! Enforce Correct Word Spacing [7]=
F=_DIRECTORY
1=([^\\s\\[\\(/\\{])(".*?")
2=$1 $2
3=0

[#19]
T=4
! Enforce Correct Word Spacing [8]=
F=_DIRECTORY
1=(\\.(?<!\\.\\.))(?![\\s\\.':;\\)\\]"])(?![\\l\\u](\\.|$| ))(?!$)(?!\\d)(?!(co|com|uk|net|org|gov|edu|mil|html?|php))
2=$0 
3=0

[#20]
T=4
! Enforce Correct Word Spacing [9]=
F=_DIRECTORY
1=ww.\\s
2=ww.
3=0

[#21]
T=4
! Enforce Correct Word Spacing [10]=
F=_DIRECTORY
1="\\s?(.*?)\\s?"
2="$1"
3=0

[#22]
T=4
! Add Apostrophe to "Are" Contractions=
F=_DIRECTORY
1=\\b(how|they|what|when|why|you)re\\b
2=$1're
3=0

[#23]
T=4
! Add Apostrophe to "Have" Contractions=
F=_DIRECTORY
1=\\b(could|how|i|might|must|should|we|what|where|would|you)ve\\b
2=$1've
3=0

[#24]
T=4
! Add Apostrophe to "Is" Contractions=
F=_DIRECTORY
1=\\b(he|here|how|she|that|there|two|what|when|where|who|why)s\\b
2=$1's
3=0

[#25]
T=4
! Add Apostrophe to "Not" Contractions=
F=_DIRECTORY
1=\\b(ain|aren|can|couldn|didn|doesn|don|hadn|hasn|haven|isn|mightn|mustn|shouldn|wasn|weren|won|wouldn)t\\b
2=$1't
3=0

[#26]
T=4
! Add Apostrophe to "Will" Contractions=
F=_DIRECTORY
1=\\b(how|it|that|there|they|what|when|where|who|you)ll\\b
2=$1'll
3=0

[#27]
T=4
! Title Case Conversion [1] (Convert Words to Mixed-Case, Ignoring Upper-Case Letters)=
F=_DIRECTORY
1=([-({\\[\\]}) _",.+&@;*])(\\l)
2=$1$upper($2)
3=1

[#28]
T=4
! Title Case Conversion [2] (Capitalise First Word)=
F=_DIRECTORY
1=^(\\l)
2=$upper($1)
3=1

[#29]
T=4
! Title Case Conversion [3] (Articles, Conjunctions & Short Prepositions to Lower-Case, Except Before or After Punctuation)=
F=_DIRECTORY
1=(?<!&|:|;|-|/|!|(?<![A-Z]\\.[A-Z])\\.|\\?|\\+)(\\s+\\b(A|An|And|As|At|But|By|De|Et|For|From|In|Into|Le|Nor|Of|Off|On|Onto|Or|So|Than|The|To|Upon|Von|With)(?\u003d\\s)(?!\\s[\\-\\(\\)\\[\\]{}]))
2=$lower($1)
3=1

[#30]
T=4
! Title Case Conversion [4]=
F=_DIRECTORY
1=(^|\\s|\\(|\\[|/)'(.{1})
2=$1'$upper($2)
3=0

[#31]
T=4
! Title Case Conversion [5] (Capitalise "to" Before Common Verbs)=
F=_DIRECTORY
1=(to\\s+)\\b(Ask|Be|Begin|Believe|Bring|Buy|Call|Care|Change|Cheat|Come|Cry|Dance|Die|Do|Dream|Fall|Feel|Find|Forget|Get|Give|Go|Hate|Have|Hear|Hide|Hold|Keep|Know|Laugh|Learn|Leave|Let|Lie|Listen|Live|Look|Lose|Love|Make|Mean|Miss|Move|Marry|Need|Play|Pretend|Promise|Put|Remember|Return|Ride|Run|Say|See|Sell|Send|Set|Show|Sing|Speak|Stand|Stay|Steal|Stop|Take|Talk|Tell|Thank|Think|Touch|Travel|Try|Use|Wait|Walk|Want|Win|Wish|Work|Write)\\b
2=$caps($1)$2
3=1

[#32]
T=4
! Forced Upper-Case for Named Abbreviations and Acronyms=
F=_DIRECTORY
1=\\b(ac|aka|ap|asap|atm|bbc|bc|bce|blt|btw|cbs|cc|cd|cia|dc|dj|doa|emi|ep|faq|fbi|fm|fr|gb|gi|imho|ira|irs|jc|kkk|lp|mc|mgm|mtv||nasa|nbc|npr|ny|nyc|ok|ost|pm|ps|qed|rca|rpm|sos|tba|tlc|tv|ufo|uk|usa|ussr|va|ymca)\\b
2=$upper($1)
3=0

[#33]
T=4
! CamelCase Irish Names Beginning with O'=
F=_DIRECTORY
1=\\b(O'[a-z]|O\\x{2019}[a-z])
2=$upper($1)
3=1

[#34]
T=4
! CamelCase Scottish Names Beginning with Mc=
F=_DIRECTORY
1=\\b(Mc)((?:[a-z]|-){3,})
2=$1$caps2($2,-)
3=1

[#35]
T=4
! CamelCase Common Scottish Names Beginning with Mac=
F=_DIRECTORY
1=\\b(Mac)(Alister|Arthur|Askill|Bain|Coll|Donald|Dougall|Dowell|Duff|Ewen|Farlane|Gregor|Intyre|Kenzie|Kinnon|Laren|Lean|Leod|Millan|Nab|Neil|Pherson|Rae)\\b
2=$1$caps2($2)
3=0

[#36]
T=4
! Roman Numerals to Upper-Case (Up to LXXIX, or 89)=
F=_DIRECTORY
1=\\b(?:L?X{0,3}|XL)(?:V?I{0,3}|I[VX])(?\u003d(\\.\\s|\\s|\\)|$))
2=$upper($0)
3=0

[#37]
T=4
! Common Latinisms and Miscellany to Lowercase=
F=_DIRECTORY
1=(\\b(?:E\\.G|et\\sAl|Etc|I\\.E|Versus|Vs|Feat\\.\\s|Ft\\.\\s|(?<\u003d')N(?\u003d'))\\b)
2=$lower($1)
3=1

[#38]
T=4
! Trim Trailing, Preceding & Extra Spaces [1]=
F=_TAG
1=(\\s+$|^\\s+)
2=
3=0

[#39]
T=4
! Trim Trailing, Preceding & Extra Spaces [2]=
F=_TAG
1=\\s+
2= 
3=0

[#40]
T=4
! Enforce Correct Word Spacing [1]=
F=_TAG
1=([^\\s\\.:;\\)\\]/])([&\\({\\[\\+])
2=$1 $2
3=0

[#41]
T=4
! Enforce Correct Word Spacing [2]=
F=_TAG
1=(&|\\)|\\}|\\]|;|(?<!\\d),|,(?!\\d{3})|\\+)([^\\s\\.:;\\(\\[/])
2=$1 $2
3=0

[#42]
T=4
! Enforce Correct Word Spacing [3]=
F=_TAG
1=\\b([a-z])\\s(&)\\s([a-z])\\b
2=$1$2$3
3=0

[#43]
T=4
! Enforce Correct Word Spacing [4]=
F=_TAG
1=([\\(\\[])\\s
2=$1
3=0

[#44]
T=4
! Enforce Correct Word Spacing [5]=
F=_TAG
1=\\s(\\]|\\)|\\?|:|;|,|\\.(?!\\.\\.))
2=$1
3=0

[#45]
T=4
! Enforce Correct Word Spacing [6]=
F=_TAG
1=(".*?")([^\\s\\]\\)/\\}!\\-\u003d,.;:])(?!$)
2=$1 $2
3=0

[#46]
T=4
! Enforce Correct Word Spacing [7]=
F=_TAG
1=([^\\s\\[\\(/\\{])(".*?")
2=$1 $2
3=0

[#47]
T=4
! Enforce Correct Word Spacing [8]=
F=_TAG
1=(\\.(?<!\\.\\.))(?![\\s\\.':;\\)\\]"])(?![\\l\\u](\\.|$| ))(?!$)(?!\\d)(?!(co|com|uk|net|org|gov|edu|mil|html?|php))
2=$0 
3=0

[#48]
T=4
! Enforce Correct Word Spacing [9]=
F=_TAG
1=ww.\\s
2=ww.
3=0

[#49]
T=4
! Enforce Correct Word Spacing [10]=
F=_TAG
1="\\s?(.*?)\\s?"
2="$1"
3=0

[#50]
T=4
! Add Apostrophe to "Are" Contractions=
F=_TAG
1=\\b(how|they|what|when|why|you)re\\b
2=$1're
3=0

[#51]
T=4
! Add Apostrophe to "Have" Contractions=
F=_TAG
1=\\b(could|how|i|might|must|should|we|what|where|would|you)ve\\b
2=$1've
3=0

[#52]
T=4
! Add Apostrophe to "Is" Contractions=
F=_TAG
1=\\b(he|here|how|she|that|there|two|what|when|where|who|why)s\\b
2=$1's
3=0

[#53]
T=4
! Add Apostrophe to "Not" Contractions=
F=_TAG
1=\\b(ain|aren|can|couldn|didn|doesn|don|hadn|hasn|haven|isn|mightn|mustn|shouldn|wasn|weren|won|wouldn)t\\b
2=$1't
3=0

[#54]
T=4
! Add Apostrophe to "Will" Contractions=
F=_TAG
1=\\b(how|it|that|there|they|what|when|where|who|you)ll\\b
2=$1'll
3=0

[#55]
T=4
! Title Case Conversion [1] (Convert Words to Mixed-Case, Ignoring Upper-Case Letters)=
F=_TAG
1=([-({\\[\\]}) _",./+&@:;*])(\\l)
2=$1$upper($2)
3=1

[#56]
T=4
! Title Case Conversion [2] (Capitalise First Word)=
F=_TAG
1=^(\\l)
2=$upper($1)
3=1

[#57]
T=4
! Title Case Conversion [3] (Articles, Conjunctions & Short Prepositions to Lower-Case, Except Before or After Punctuation)=
F=_TAG
1=(?<!&|:|;|-|/|!|(?<![A-Z]\\.[A-Z])\\.|\\?|\\+)(\\s+\\b(A|An|And|As|At|But|By|De|Et|For|From|In|Into|Le|Nor|Of|Off|On|Onto|Or|So|Than|The|To|Upon|Von|With)(?\u003d\\s)(?!\\s[\\-\\(\\)\\[\\]{}]))
2=$lower($1)
3=1

[#58]
T=4
! Title Case Conversion [4]=
F=_TAG
1=(^|\\s|\\(|\\[|/)'(.{1})
2=$1'$upper($2)
3=0

[#59]
T=4
! Title Case Conversion [5] (Capitalise "to" Before Common Verbs)=
F=_TAG
1=(to\\s+)\\b(Ask|Be|Begin|Believe|Bring|Buy|Call|Care|Change|Cheat|Come|Cry|Dance|Die|Do|Dream|Fall|Feel|Find|Forget|Get|Give|Go|Hate|Have|Hear|Hide|Hold|Keep|Know|Laugh|Learn|Leave|Let|Lie|Listen|Live|Look|Lose|Love|Make|Mean|Miss|Move|Marry|Need|Play|Pretend|Promise|Put|Remember|Return|Ride|Run|Say|See|Sell|Send|Set|Show|Sing|Speak|Stand|Stay|Steal|Stop|Take|Talk|Tell|Thank|Think|Touch|Travel|Try|Use|Wait|Walk|Want|Win|Wish|Work|Write)\\b
2=$caps($1)$2
3=1

[#60]
T=4
! Forced Upper-Case for Named Abbreviations and Acronyms=
F=_TAG
1=\\b(ac|aka|aol|ap|asap|atm|bbc|bc|bce|blt|btw|cbs|cc|cd|cia|dc|dj|doa|emi|ep|faq|fbi|fm|fr|gb|gi|imho|ira|irs|jc|kkk|lp|mc|mgm|mtv|nasa|nbc|npr|ny|nyc|ok|ost|pm|ps|qed|rca|rpm|sos|tba|tlc|tv|ufo|uk|usa|ussr|va|ymca)\\b
2=$upper($1)
3=0

[#60]
T=4
Forced Upper-Case for Band Names
F=_TAGS
1=\\b(ABBA|ACDC|AC DC|DMC|INXS|MIKA|N SYNC|NSYNC|U2|UNKLE)\\b
2=$upper($1)
3=0

[#60]
T=4
Forced Upper-Case for Band Names
F=ALBUMARTIST
1=\\b(ABBA|ACDC|AC DC|DMC|HIM|INXS|KISS|MIKA|N SYNC|NSYNC|U2|UNKLE)\\b
2=$upper($1)
3=0

[#60]
T=4
Forced Upper-Case for Band Names
F=ARTIST
1=\\b(ABBA|ACDC|AC DC|DMC|HIM|INXS|KISS|MIKA|N SYNC|NSYNC|U2|UNKLE)\\b
2=$upper($1)
3=0

[#60]
T=4
Forced Upper-Case for Band Names
F=ARTISTS
1=\\b(ABBA|ACDC|AC DC|DMC|HIM|INXS|KISS|MIKA|N SYNC|NSYNC|U2|UNKLE)\\b
2=$upper($1)
3=0

[#61]
T=4
! Replay Gain Correction [1]=
F=REPLAYGAIN_TRACK_GAIN
1=(\\+|-)?\\s?(\\d*\\.\\d*)\\sDB
2=$1$2 dB
3=0

[#62]
T=4
! Replay Gain Correction [2]=
F=REPLAYGAIN_ALBUM_GAIN
1=(\\+|-)?\\s?(\\d*\\.\\d*)\\sDB
2=$1$2 dB
3=0

[#63]
T=4
! CamelCase Irish Names Beginning with O'=
F=_TAG
1=\\b(O'[a-z]|O\\x{2019}[a-z])
2=$upper($1)
3=1

[#64]
T=4
! CamelCase Scottish Names Beginning with Mc=
F=_TAG
1=\\b(Mc)((?:[a-z]|-){3,})
2=$1$caps2($2,-)
3=1

[#65]
T=4
! CamelCase Common Scottish Names Beginning with Mac=
F=_TAG
1=\\b(Mac)(Alister|Arthur|Askill|Bain|Coll|Donald|Dougall|Dowell|Duff|Ewen|Farlane|Gregor|Intyre|Kenzie|Kinnon|Laren|Lean|Leod|Millan|Nab|Neil|Pherson|Rae)\\b
2=$1$caps2($2)
3=0

[#66]
T=4
! Roman Numerals to Upper-Case (Up to LXXIX, or 89)=
F=_TAG
1=\\b(?:L?X{0,3}|XL)(?:V?I{0,3}|I[VX])(?\u003d(\\.\\s|\\s|\\)|$))
2=$upper($0)
3=0

[#67]
T=4
! Common Latinisms and Miscellany to Lowercase=
F=_TAG
1=(\\b(?:E\\.G|et\\sAl|Etc|I\\.E|Versus|Vs|Feat\\.\\s|Ft\\.\\s|(?<\u003d')N(?\u003d'))\\b)
2=$lower($1)
3=1

! Case conversion (Mixed)=
[#68]
T=1
F=_FILENAME
1=1
2=

! Replace square brackets=
[#69]
T=5
F=_FILENAME
1=$replace(%TRACK% %TITLE%,'[','(',']',')')

! Replace square brackets=
[#70]
T=5
F=ALBUM
1=$replace(%ALBUM%,'[','(',']',')')

! Replace square brackets=
[#71]
T=5
F=TITLE
1=$replace(%TITLE%,'[','(',']',')')

[#72]
T=2
F=_DIRECTORY
1= (Single)
2=
3=0|0

[#73]
T=2
F=_DIRECTORY
1= (Album)
2=
3=0|0

[#74]
T=2
F=_DIRECTORY
1= (Digital Album)
2=
3=0|0

[#75]
T=2
F=_DIRECTORY
1= (LP)
2=
3=0|0

[#76]
T=2
F=_DIRECTORY
1= (EP)
2=
3=0|0

! Replace square brackets=
[#77]
T=5
F=_DIRECTORY
1=$replace(A:\\Music\\Record\\%artist%\\%album%,'[','(',']',')')

! Remove Album Type=
[#78]
T=2
F=ALBUM
1= (Single)
2=
3=0|0

! Remove Album Type=
[#79]
T=2
F=_FILENAME
1= (Single)
2=
3=0|0

! Remove Album Type=
[#80]
T=2
F=ALBUM
1= (Album)
2=
3=0|0

! Remove Album Type=
[#81]
T=2
F=_FILENAME
1= (Album)
2=
3=0|0

! Remove Album Type=
[#82]
T=2
F=ALBUM
1= (Digital Album)
2=
3=0|0

! Remove Album Type=
[#83]
T=2
F=_FILENAME
1= (Digital Album)
2=
3=0|0

! Remove Album Type=
[#84]
T=2
F=ALBUM
1= (LP)
2=
3=0|0

! Remove Album Type=
[#85]
T=2
F=_FILENAME
1= (LP)
2=
3=0|0

! Remove Album Type=
[#86]
T=2
F=ALBUM
1= (EP)
2=
3=0|0

! Remove Album Type=
[#87]
T=2
F=_FILENAME
1= (EP)
2=
3=0|0

! Remove Source=
[#88]
T=9
F=SOURCE

! Remove Source=
[#89]
T=9
F=SOURCEID

#2

After a bit of consideration I determined that the problem was that the Artist name was "Punk Goes..." and mp3tag could not create a folder in Windows with this name.

I changed the artist name to "Punk Goes" before running the action again and it worked.

Is there a way to help mp3tag run the script without having to make changes like this?


#3

see here:

And a personal note here: you invest an awful lot of work in directory names and filenames - although they have so many restrictions that tags do not have. So I would not abuse the file properties as data storage, or at least not as accurate data storage.
A case like the one that you encountered is just one of the many that you will come across. And it is not MP3tag's limitation, its a question of your file system.


#4

In addition to @ohrenkino's advice:

Use $validate
From the help:
Command: $validate(filename,to)
Example: $validate(%artist% - %album% - %track% - %title%,-)
This example replaces all invalid characters (/?*"<>|:) with dashes.

But this script command will also NOT solve every of your occuring file and folder name problems.


#5

Thank you for your replies. I like to be precise with my file/folder naming but can see it is not possible to do what I want in this case.

I'll bookmark you code for future reference in case I can see a way of working it in. Interestingly out of 10,000 songs this only came up with the one artist so it's not too bad.