# Sorting into folders

**URL:** https://community.mp3tag.de/t/sorting-into-folders/57585
**Category:** Mac
**Created:** [June 10, 2022, 6:29am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585 "2022-06-10T06:29:43Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![uselessuser](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/4af34b/32.png) [@uselessuser](https://community.mp3tag.de/u/uselessuser)
#### Post date: [June 10, 2022, 6:29am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585/1 "2022-06-10T06:29:43Z")

</div>

Hello!  
Maybe someone can suggest a solution for me for my following issue.  
Actually I organize my files (after correcting the tags) with an MP3tag action.  
The action looks like this:  
Field: \_Filename  
Format: /Volumes/XXX/XXX/%ALBUMARTIST%/%album%/%\_filename%

This works pretty good, but if the "Albumartist" field is unpopulated the files are stored under Album/filename.  
Is there a way to autopopulate the Albumartist field in case it is empty?

Any suggestions are welcome.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [June 10, 2022, 6:35am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585/2 "2022-06-10T06:35:53Z")

</div>

> [@uselessuser](#):
>
> Is there a way to autopopulate the Albumartist field in case it is empty?

You could use square brackets to enclose the [%ALBUMARTIST%] part. This would only use it if this tag has some content in it. Don't forget to use the correct Slash or Backslash, depending on your OS.

See the help: [Format Strings and Placeholders – Mp3tag Documentation](https://docs.mp3tag.de/format/#characters-with-special-functionality)

 ![image](https://community.mp3tag.de/uploads/default/original/2X/e/e0b82126aadfaad459a272cd172d5d0b3403285b.png)

If you want to fill/autopopulate %ALBUMARTIST%, you have to use another action to use the content from - let's say ARTIST - first.

---

<div class="post-metadata">

### Author: ![uselessuser](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/4af34b/32.png) [@uselessuser](https://community.mp3tag.de/u/uselessuser)
#### Post date: [June 10, 2022, 6:45am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585/3 "2022-06-10T06:45:38Z")

</div>

Thank you for your fast answer.  
Is it possible to autopopulate the Albumartist field with an action only when the field is empty?

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [June 10, 2022, 6:48am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585/4 "2022-06-10T06:48:30Z")

</div>

I would solve it like this:  
1.) [Add a new column](https://docs.mp3tag.de/customization/file-list/) called ALBUMARTIST (if it not already exists)  
2.) Load all your files  
3.) Sort by clicking on the column ALBUMARTIST  
4.) Select all the files without content in ALBUMARTIST  
5.) Execute your action to fill ALBUMARTIST with whatever content you like

Another way would be to use the filter with F3 and  
`albumartist MISSING`  
followed by the above steps 4 to 5.

From the help: [Filter and Search – Mp3tag Documentation](https://docs.mp3tag.de/filter/#field-missing)

 ![image](https://community.mp3tag.de/uploads/default/original/2X/b/b5b52c79125c1810126c0f1c437466230f37c282.png)

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 10, 2022, 7:03am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585/5 "2022-06-10T07:03:26Z")

</div>

> [@uselessuser](#):
>
> This works pretty good, but if the "Albumartist" field is unpopulated the files are stored under Album/filename.  
> Is there a way to autopopulate the Albumartist field in case it is empty?

You could use `$if2(%albumartist%,%artist%)` which uses the ALBUMARTIST when it is there or when missing then the alternative string - in my suggestion the contents from ARTIST. Instead of %artist% you could also use a string constant like "Various artists" or any other combination.

Looking at your string with

> [@uselessuser](#):
>
> /Volumes/XXX/

... are you using the Mac version?

---

<div class="post-metadata">

### Author: ![uselessuser](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/4af34b/32.png) [@uselessuser](https://community.mp3tag.de/u/uselessuser)
#### Post date: [June 10, 2022, 7:06am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585/6 "2022-06-10T07:06:11Z")

</div>

yes, I am using the mac version (and i'm missing desperatly the scripting, especially for beatport tagging)

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 10, 2022, 7:10am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585/7 "2022-06-10T07:10:51Z")

</div>

> [@uselessuser](#):
>
> yes, I am using the mac version

then, next time, please use the Mac section of the forum for your threads.  
I moved this topic now.  
And please don't mix topics esp. if there is already a thread with that topic:

> [@Zusätzliche Tag Quellen?](https://community.mp3tag.de/t/zusatzliche-tag-quellen/57414):
>
> Immer öfter habe ich Tracks, die ich mit Musicbrains bzw. Discogs nicht zuordnen kann. Würde die Möglichkeit bestehen, zusätzlich noch Quellen wie Beatport,com anzuzapfen?

---

<div class="post-metadata">

### Author: ![uselessuser](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/4af34b/32.png) [@uselessuser](https://community.mp3tag.de/u/uselessuser)
#### Post date: [June 10, 2022, 8:29am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585/8 "2022-06-10T08:29:08Z")

</div>

> [@ohrenkino](#):
>
> You could use `$if2(%albumartist%,%artist%)` which uses the ALBUMARTIST when it is there or when missing then the alternative string - in my suggestion the contents from ARTIST. Instead of %artist% you could also use a string constant like "Various artists" or any other combination.

The results of "`$if2(%albumartist%,%artist%)` are promising but what i actually dont get is the usage of a string constant like "Various artists". For example when I have a Album with tracks from various artists where every track is tagged correct but the field "Album artist" is empty... these tracks should stay together in a single folder which has only the name of the album. Is that even possible with one action?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 10, 2022, 8:53am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585/9 "2022-06-10T08:53:43Z")

</div>

You can die only one death.  
Either you want to set a string constant or you auto-fill the missing ALBUMARTIST with ARTIST (or something from a format string).  
In a single action/converter, you would have to insert a lengthy condition (of which I would not know what it would be as MP3tag does not compare the data between files).  
Or you simply decide that all missing ALBUMARTIST track become "Various Artists" and the condition would be $if2(%albumartist%,Various Artists).  
All files without ALBUMARTIST are then summarized under the pseudo-album artist "Various Artists".  
If that is not the way you want it, then you may go the other way and fill the ALBUMARTIST with special pseudo-album artists like "Sampler Ambient", "Café del Mar" and so on.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 10, 2022, 11:38am UTC](https://community.mp3tag.de/t/sorting-into-folders/57585/10 "2022-06-10T11:38:20Z")

</div>

> [@uselessuser](#):
>
> For example when I have a Album with tracks from various artists where every track is tagged correct but the field "Album artist" is empty... these tracks should stay together in a single folder which has only the name of the album. Is that even possible with one action?

This is one of the main reasons the AlbumArtist field exists. When a compilation album has many different artists by track, there is no common string to tie that album together. So using one such as "Various Artists" (most common), or "Compilation", or some other term of your preference is the key to keeping these albums assembled together not only in a file structure but also most media player library browsers.

Use the filter suggested above by @LyricsLover to find any files that are missing this field, and then fill them with the term you choose. Then your original action will work as expected.
