Advanced script for folders


#1

Hi there, I did already post that question in the german support forum, sorry for the doublepost!
I want to sort my music in 7 different folders, according to the artist's starting character either Other, A-D, E-H, I-L, M-P, Q-T or V-Z.
For example:
¡Forward, Russia! -> Other
Bob Dylan -> A-D
Radiohead -> Q-T
and so on...
I just had a look at the script commands but that's far over my head! Does anyone have a clue how this could work?
Thanks a lot!


#2

Sorry, I just can give you a little wink.

Use Tag - Filename, A-D\%artist% - %year% - %album% - $num(%track%,2) - %title%

A-D</b> creates a subfolder named A-D

Just replace A-D with a code.

Pseudocode: if first letter of artist is uppercase and from A to D, then A-D else...

With ..\%artist% - %year% - %album% - $num(%track%,2) - %title% you can put the files up one folder level. Watch for the 2 point at the beginning. ....</b> up 2 levels.

:book:


#3

Yeah, so far i know what to do, my problem actually is the code...


#4

Allright, solved it, it works like this:

$if($leql($left(%artist%,1),?),Other,
$if($leql($left(%artist%,1),D),A-D,
$if($leql($left(%artist%,1),H),E-H,
$if($leql($left(%artist%,1),L),I-L,
$if($leql($left(%artist%,1),P),M-P,
$if($leql($left(%artist%,1),T),Q-T,V-Z))))))

But thanks a lot though!


#5

Below you see the content of my MTA-file called Sort by album in grouped folders.mta.

Explanation:

#0 With Tag-Field formate creates a new Tag called NEWTAG, puts the first letter of the albumname in it and formates this letter to uppercase.

#1-#7 With Replace with RegEx formates the Tag NEWTAG to the wanted foldernames.

#8 With Tag-Field formate formates the filename and puts the files up one folderlevel in the desired folders.

Files without albumnames get moved beside this new folderstruktur, so you can edit them manualy.

Attention, my version is 2.32a
[#0]
T=5
F=NEWTAG
1=$upper($left(%album%,1))

[#1]
T=4
F=NEWTAG
1=^[A-D]
2=A-D
3=0

[#2]
T=4
F=NEWTAG
1=^[E-H]
2=E-H
3=0

[#3]
T=4
F=NEWTAG
1=^[I-L]
2=I-L
3=0

[#4]
T=4
F=NEWTAG
1=^[Q-T]
2=Q-T
3=0

[#5]
T=4
F=NEWTAG
1=^[M-P]
2=M-P
3=0

[#6]
T=4
F=NEWTAG
1=^[V-Z]
2=V-Z
3=0

[#7]
T=4
F=NEWTAG
1=^[^A-Z]
2=Other
3=0

[#8]
T=5
F=_FILENAME
1=..\\%newtag%\\\\$if(%artist%,%artist%,no artist) - $if(%year%,%year%,no year) - $if(%album%,%album%,no album) - $if(%track%,$num(%track%,2),no number) - $if(%title%,%title%,no title)


klick on pic to see the action-pallete of the action Sort by album in grouped folders

sort_by_album_in_grouped_folders.mta (579 Bytes)

Good luck, have fun :book:


sort_by_album_in_grouped_folders.mta (579 Bytes)