Count of files in a folder

A quick question ... using the Actions and scripting, is it possible to get a count of how many files are in the folder containing the track?

What do you mean?
How many files there are at all? Mp3tag does not show all files in a folder.
You can set a filter with %_directory% HAS . this then shows all files in a folder.
There is the internal variable %_counter% ...
So many possibilities....

Okay here's what I'm doing...

I've ripped audio books (actually audio dramas) where each "Episode" is a number of chapters. I'm trying to automate the tagging so manually I am creating a "Episode" tag which is just labeled "Episode One", "Episode Two", etc.

My first script takes the individual files and puts them into sub folders based on the Episode tag. I then use the Number Wizzard to create track numbers for each part.

In my second script I create "Episode One - Part 1", Episode Two - Part 2". Etc tags for the Title of each track. What I would like is to be able to do "Episode One - Part 1 of 9", etc. the "of 9" automatically based on the number of files (or "Parts") in each sub folder.

As I was writing this I did think "could the numbering Wizzard sort this" but I think if there are 4 episodes spit across 36 files it would just do 1/36, 2/36 rather than 1/9, 2/9, etc?

Define an action group with 2 actions:

  1. Action
    Type: Format Value
    Field: TRACK
    Format String: $num(%_counter%,2)

  2. Action
    Type: Format Value
    Field: TITLE
    Format String: %episode% - Part %track% of %_total_files%

Mark you files in the episode subdirectory and appy the action group.
The first action simulates the auto-numbering wizard and fills the track-tag.
The second action renames the title-tag using the content of your self-defined episode-tag, the content of the track-tag and the content of the total_files-tag.
%_total_files% is an information tag and it's content depends of the amount of marked files.

The auto-numbering wizard is also able to reset the counter for each directory if you enable this option.

You can apply following action on each folder ...
Action: Format value
Formatstring: %_total_files%



Just for your interest ...


Okay ... that has worked for me ... I made a (wrong) assumption about the "Save total count of tracks" check box - if "Reset counter for each directory" option is selected it also resets the total count for each directory.

Now if only the Autonumbering Wizard could be run from within an action (yes I know there is the %_counter% but that doesn't do reset counter for each directory).