Apply one file's tag to all files using actions

Is this possible?
Specifically, I wrote an action group that adds A-side and B-side track-info to comments for albums ripped from vinyl. Currently, I have to select tracks from side A (1-#) and apply it, which then also calculates side B and appends the info to comments. But only to those selected tracks (side A), which leaves the second half of the album without it.

Any way to add an action to the same action group that would copy, for example, first track's comment to all files open in Mp3Tag? If not, any other suggestions?

Here's the current action group:
(I use bullets (•) to separate comments. The action group deletes any possible previous traces of the same action group, so if you, for example, apply it to wrong tracks, you can just run it again; but it won't touch whatever info you might have added after running it the previous time.)

Append “A-side n–n” to selected tracks’ comments and calculate “B-side n–n”

Replace with regular expression
Field: COMMENT
Regular expression: \s*•\sA-side: \d+–\d+\s•\sB-side: \d+–\d+
Replace matches with: [empty]

Replace with regular expression
Field: COMMENT
Regular expression: \s*•\s$
Replace matches with: [empty]

Replace with regular expression
Field: COMMENT
Regular expression: \s{2,}
Replace matches with: [single space]

Format value
Field: COMMENT
Format string: %comment% • A-side: 1–%_total_files% • B-side: $add(%_total_files%,1)–%_total%

Replace with regular expression
Field: COMMENT
Regular expression: ^\s*•\s
Replace matches with: [empty]

The problem is, that MP3tag does not really know what the "first track" is. So it is not possible to determine which data is the master for all other files.

My other suggestion in this respect would be: use the tag panel. Or the extended tags dialogue.

This might be possible by exporting the data from the first track to an external text file, ...
then by importing the external data to the other tracks.

In the Action and Converter area, Mp3tag has no overarching 'memory' between two tracks.
In the Export area, Mp3tag supports user definable placeholders to hold data between tracks.

DD.20140317.0851.CET

I would consider this much more awkward than simply using the tag panel.
You will not be able to apply a universal action group that behaves different for one file ("the first") than for the rest.

So, you would have to ...

  • select the master file
  • enter the correct data
  • trigger one action (group) to export the data,
  • select the other files,
  • trigger the action (group) to import the data.

If you do the same thing with the tag panel you are quicker in general as you can use simple keyboard shortcuts. I would think that this is a feasible way to proceed:

Either (if you still have to enter the data)

  • select all files
  • enter the new data
  • save the data
    or (if the master file already has the correct data)
  • select all files (inlcuding the master file with the already updated data)
  • select the correct data from the dropdown list
  • save the data

Even if you think of a mechanism that treats the first file in a selection in a special way, I would hate to devise a sorting algorithm that puts the file that I consider to be the first on top of the list. And if I do it wrong I replace all the correct data with something random ...
My verdict: tag panel

Example Prepare tracks ... Track 1 : SIDE <== 'A' ; TOTALTRACKS <== 5 Track 2 : SIDE <== 'A' ; TOTALTRACKS <== 5 Track 3 : SIDE <== 'A' ; TOTALTRACKS <== 5 Track 4 : SIDE <== 'B' ; TOTALTRACKS <== 5 Track 5 : SIDE <== 'B' ; TOTALTRACKS <== 5 Prepare Action "Format value" ... Text <== $if($eql(%SIDE%,'A'),'A-side: 1-'%_total_files%' # B-side: '$add(%_total_files%,1)'-'%TOTALTRACKS%,$if($eql(%SIDE%,'B'),'A-side: 1-'$sub(%TOTALTRACKS%,%_total_files%)' # B-side: '$add(1,$sub(%TOTALTRACKS%,%_total_files%))'-'%TOTALTRACKS%,)) Result should be ... Text = 'A-side: 1-3 # B-side: 4-5' Steps ... 1. Select all tracks from Side A. Run action "Format value". 2. Select all tracks from Side B. Run action "Format value".
DD.20140317.0953.CET

Another solution

Prepare the Tag-Panel ...
by creating a new edit field, can be multi-line, in which you want to enter manually the appropriate text ...
name the edit field as you wish, for example "Add Comment Vinyl", creating the tag-field ADD_COMMENT.
See Mp3tag/Extras/Options/Tag-Panel/Add Tag-Field (button).

Steps ...

  1. Select all tracks from the album.
  2. Open Tag Panel.
  3. Enter the text 'A-side: 1-3 # B-side: 4-5'
    ... into the edit field "Add Comment Vinyl".
  4. Update and save the change to the selected tracks by pressing [Ctrl+S].
  5. Run an action ...
    ... to combine the both tag-fields COMMENT and ADD_COMMENT.
    ... and to remove tag-field ADD_COMMENT.

DD.20140317.1026.CET

Regarding the proposal from above ...
step "3. Enter the text 'A-side: 1-3 # B-side: 4-5'
... you may minimize the input, only enter the four numbers ... 1 3 4 5
and let the following action create the text string for appending to the tag-field COMMENT.

DD.20140318.0945.CET

Thanks. The drop-down list in the Tag Panel completely slipped my mind, so I guess that's the simplest thing to do after applying the action to side-A tracks.

What do you mean by "drop-down list in the Tag Panel"?

DD.20140317.2239.CET

I mean the list of values for each tag field (starts with , and lists all other values from selected files).

What exactly is “%_total%”? It seems to work only with mp3 files and not with flac.

In the Mp3tag help manual, section "Converter" and section "Export", there "%_total%" is defined as a special placeholder:
%_total% ... Total number of tracks from xx/xx track-number field.

The applied tag-type must support the track format "xx/xx".

DD.20140318.0759.CET

And what do you think, how will this be able to solve the task of appending text to the COMMENT tag-field?

DD.20140318.0804.CET

Just a proposal.

  1. Create edit field in Tag-Panel:
    Tag-Field: ADD_COMMENT
    Title: Comme&nt (add):
    Single line edit field.

  2. Create Action "Format value":
    ADD_COMMENT <== $regexp(%ADD_COMMENT%,'^\s*(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s*$',' # A-side: $1-$2 # B-side: $3-$4 # ')

  3. Create Action "Format value":
    COMMENT <== $regexp(%COMMENT%,'\s*#\sA-side:\s\d+-\d+\s#\sB-side:\s\d+-\d+\s*#\s','<<1>>')

  4. Create Action "Format value":
    COMMENT <== $ifgreater($strstr(%COMMENT%,'<<1>>'),0,$replace(%COMMENT%,'<<1>>',%ADD_COMMENT%),%COMMENT%%ADD_COMMENT%)
    ... or ...
    COMMENT <== $ifgreater($strstr(%COMMENT%,'<<1>>'),0,$replace(%COMMENT%,'<<1>>',%ADD_COMMENT%),%COMMENT%$char(13)$char(10)$trim(%ADD_COMMENT%))

5.Create Action "Remove field":
ADD_COMMENT

  1. Create action group:
    Collect actions 2..5 from above into one action group.

  2. Example for manual input via Tag-Panel:
    ADD_COMMENT <== '1 3 4 5'
    ... will be converted by action to ...

' # A-side: 1-3 # B-side: 4-5 # '

Possible simplification:
The manual input of numbers can be reduced to two numbers, ...
one number for the track sum of the A-side tracks, ...
and one number for the track sum of the B-side tracks.

Workflow

  1. Select files.
  2. Manual input of number string via Tag-Panel.
  3. Run action group (actions 2..5 from above).
Format COMMENT#Set COMMENT AB-Side (4Nrs [1 8 9 15] input Tag-Panel).mta

Format_COMMENT_Set_COMMENT_AB_Side__4Nrs__1_8_9_15__input_Tag_Panel_.mta (452 Bytes)
Format COMMENT#Set COMMENT AB-Side (2Nrs [8 7] input Tag-Panel).mta
Format_COMMENT_Set_COMMENT_AB_Side__2Nrs__8_7__input_Tag_Panel_.mta (627 Bytes)

DD.20140318.1438.CET

Format_COMMENT_Set_COMMENT_AB_Side__4Nrs__1_8_9_15__input_Tag_Panel_.mta (452 Bytes)

Format_COMMENT_Set_COMMENT_AB_Side__2Nrs__8_7__input_Tag_Panel_.mta (627 Bytes)

Yes, that's right.

DD.20140318.1241.CET