# Boolean script help

**URL:** https://community.mp3tag.de/t/boolean-script-help/8905
**Category:** Support
**Created:** [September 7, 2009, 4:34pm UTC](https://community.mp3tag.de/t/boolean-script-help/8905 "2009-09-07T16:34:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Dovla](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@Dovla](https://community.mp3tag.de/u/Dovla)
#### Post date: [September 7, 2009, 4:34pm UTC](https://community.mp3tag.de/t/boolean-script-help/8905/1 "2009-09-07T16:34:38Z")

</div>

Hello there, I recently discovered MP3Tag and I am amazed at how good this program is, still being a n00b however I have a certain problem that I can't figure out how to fix...I've read the help but I still can't wrap my head around it...the problem is the following..

I have a nicely organized music collection and all folders and files are named in the same manner, just my tags have a few issues...basically my entire collection comes down to either compilations or album (as I'm sure most of yours is as well 😃)...I would like to be able to have a Filename - Tag format script that can analyze the name of my folders and depending on weather it's a compilation or an album fill out the tags appropriately so I don't have to go through it manually...so the way I have it is:

for albums:  
Artist Name - Album Name (Year) - Publisher

and for compilations:  
Album Name (Year) - Publisher

track names are all:

1. Track Artist - Track Name

Also the folder above is always the Genre folder. I have the following script but it's not working:

%genre%$if2(%artist% - %album% (%year%) - %publisher%,%album% (%year%) - %publisher%)\%track%. %artist% - %title%

what am I doing wrong?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [September 8, 2009, 11:14am UTC](https://community.mp3tag.de/t/boolean-script-help/8905/2 "2009-09-08T11:14:58Z")

</div>

"Convert \> Filename - Tag" does not support scripting, only simple placeholders.  
You must try different approaches:

You can run your album pattern over all files:  
%genre%\%artist% - %album% (%year%) - %publisher%\%track%. %artist% - %title%  
It should skip all files that don't match it.

Then use the Filter [F3] on \_FOLDERPATH with this expression: ^[^-]+-[^-]+$  
That will list files that have only one - in their folderpath.  
Then use your compilation pattern.

Or make a new column with the value $len($regexp(%\_directory%,'[^-]+',))  
That gives you the amount of - chars in the directory name so you can sort by this column. You can easily select all album tracks or all compilation tracks now.

---

<div class="post-metadata">

### Author: ![Dovla](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@Dovla](https://community.mp3tag.de/u/Dovla)
#### Post date: [September 8, 2009, 1:50pm UTC](https://community.mp3tag.de/t/boolean-script-help/8905/3 "2009-09-08T13:50:48Z")

</div>

thanks a lot mate, that will do for sure, the ability to sort all albums and all compilations is enough, then I can just run the album or compilation pattern

cheers!

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:21pm UTC](https://community.mp3tag.de/t/boolean-script-help/8905/4 "2026-02-09T12:21:46Z")

</div>


