Export Album List

The built-in export function (Export Album List) does almost exactly what I want it to do, but ...

It lists the albumartist and album for each file in the album, so that for an album that has 12 tracks, the resulting output file lists the same information 12 times instead of just once.

Not having any experience writing scripts, is it possible to revise this script so that it only lists the albumartist/album information once for each of the albums in a folder?

The resulting file is needed so that our broadcaster/volunteers can easily see what music is available on our server.

Our library's directory tree architecture is \albumartist\album\files, where there may be two or more albums in many of the albumartist folders.

Thanks again for all of your support.

Dennis ... aka "d2b"

Try this:

$filename($getEnv(USERPROFILE)\Desktop\Album List.txt,utf-16)
$loop(%albumartist%,1)%albumartist%
$loop(%album%,1)   %album%
$loopend()
$loopend()

https://docs.mp3tag.de/export

Yes, thank you for your answer. This does work, except for the first line. For some reason, it appears to be ignored. The resulting file was stored in thei directory containing the albumartists/albums of interest.

I was surprised at the length of time it took for this script to run when confronted by something like 6,500 albums in 3,025 albumartist folders! The resulting file was 273 pages long with only a single space preceding each albumartist.

How would one go about counting the number of albums in the parent folder?

Thanks VERY much for you help!

Dennis ... aka "d2b"

see https://docs.mp3tag.de/scripting
You can make use of the $get and $puts operators, like this:

$filename($getEnv(USERPROFILE)\Desktop\Album List.txt,utf-16)
Total Number of Albums: $get(TotalAlbums)

$loop(%albumartist%,1)%albumartist% ($get(NumberOfAlbums))
$loop(%album%,1)$puts(NumberOfAlbums,$add($get(NumberOfAlbums),1))   %album%
$loopend()$puts(TotalAlbums,$add($get(TotalAlbums),$get(NumberOfAlbums)))$puts(NumberOfAlbums,0)
$loopend()

The first line of this export script should appear as the "Export file name" in the Export dialogue window.
If it does not, then click any other export script from the list and then click back to this script.
Now, after processing, the export file "Album List.txt" should be written on the Desktop.

1 Like

That in fact is what happened. The file was stored in the source folder as "export file name.txt."

Thanks again for your help with my requests. Maybe someday soon I'll be able to do this on my own.

The second script code works very well. All I really expected was the top line of the results—the total number of albums. It's OK the way it is, though.

Thanks again...

Dennis ... aka "d2b"