Author Topic: How can I keep some tags to reapply to new files?  (Read 357 times)

jonap

  • Full Member
  • ***
  • Posts: 131
So I made a bit of a mess with my library

I created some custom tags and use the functionality to save them in the files

Although after few steps (like switching position of the custom tags) I noticed I basically corrupted some of the files

They still work in musicbee but they are corrupted and their tags are messed up, so I can easily reencode them using ffmpeg and solve the problem, but that will leave the new files with empty tags, which is good

But now, is there a way to save just some tags from the original files, and then reapply them to the new files, so that I don't have to do a lot of work again?

I know it's a very broad question, but any help or direction on how to procede to save most of the manual time I would spend, is very appreciated

karbock

  • Sr. Member
  • ****
  • Posts: 337
Hi,

As for MB, plugin 'Additional Tagging & Reporting Tools' has menu options called "Copy tags to clipboard..." and "Paste tags from clipboard".
I haven't used it for that purpose yet, but from just a glance at the interface, it is beautifully done.

Otherwise, I usually tag my files with mp3tag, which I've used several times for what you describe, but MB's plugin mentioned above seems much easier to use.

Anyway, don't lose your temper:
https://www.youtube.com/watch?v=HtTUsOKjWyQ
:)
Last Edit: April 07, 2023, 06:01:34 PM by karbock

jonap

  • Full Member
  • ***
  • Posts: 131
Hi thank you for this.  The "copy to clipboard" tool is pretty usefull and I am able to export all the tags I want

Now, if I want to bulk edit some tag and then paste them back, how would I do that though?

Like after copying the tags, if I paste them into a spreadsheet, then edit some tag, and copy back, how am I gonna paste them back to other files?

karbock

  • Sr. Member
  • ****
  • Posts: 337
My pleasure.

That feature from the Additional Tagging & Reporting Tools is intended for copy/paste of untouched values.

As for your 2nd question: I wouldn't do it that way, for two reasons:

(1) When copying from your spreadsheet onto the clipboard, you don't know whether your spreasheet will use the same parameters as Additional Tagging & Reporting Tools for: field separator, line separator, character coding.

(2) Using a "normal" tag editor is much more convenient and will lead to fewer errors. MusicBee has a built-in tag editor, in which you can select several tracks and apply the same tag change to all of them. Otherwise, you have mp3tag (which I always use for tagging my files), or TagScanner, or Kid3.

To open MB's built-in tag editor:
* select tracks
* right click -> Edit (of Shift+Enter if you haven't changed the hotkey)
Last Edit: April 10, 2023, 05:59:38 PM by karbock

jonap

  • Full Member
  • ***
  • Posts: 131
The problem is that I was looking at an alternative cause the easy way is not an option since I scred up the files

Basically writing tags into the files and then changing the tags from MB and their order, corrupted the files and now MB tag editor gives an error and I can't access tag inspector in the corrupted files

I still can copy all the tags from these files, so I can make a spreadsheet of them

But then I would like to edit them and then reapply to completely new files by linking each set of tag to the corresponding new file

karbock

  • Sr. Member
  • ****
  • Posts: 337
I understand.
I can explain later today how you can do that with mp3tag (I'm not familiar enough with TagScanner).

karbock

  • Sr. Member
  • ****
  • Posts: 337
Back again...

Before moving to a Swiss-army-knife tool such as mp3tag, let's consider the solution that consists of:
* copying the tag contents with Additional Tagging & Reporting Tools (ATRT)
* pasting onto a spreadsheet, and editing with it
* copying back onto the clipboard
* within MB, pasting with ATRT onto the desired tracks.

Have you already tried it that way? What results do you get?

As for me, I have just done it with 8 contiguous test tracks (containing diacritics) and my spreadsheet application (LibreOffice).
The last step (pasting back with ATRT) triggers an error message, saying that there are 9 rows instead of 8.

Viewing the clipboard content with a text editor reveals that:
* when copying the tags with ATRT onto the clipboard, the last row doesn't have a newline character at the end;
* but when copying from LibreOffice onto the clipboard, the last row has a newline character at the end.
The rest is correct.

Thus, after editing with the spreadsheet, the easy solution is the following:
* pasting onto a text editor
* removing the last newline character
* copying back onto the clipboard
before pasting with ATRT.

In order to shorten those 3 supplemental steps to a minimum, you could use AutoHotKey (AHK), and define a shortcut which, called within MB, whould remove the last newline(s) from the clipboard.
EDIT: In order to suppress those 3 supplemental steps, you could use AutoHotKey (AHK), and define a shortcut which, called within your spreadsheet, whould:
- copy the spreadsheet's selection to the clipboard
- remove the last newline characters
=> ready for pasting with ARTR


So, I recommend that you duplicate a few tracks for testing purposes and observe what happens.
If you think you could use AHK and are not familiar with it, I can post the script you will need.
Last Edit: April 12, 2023, 06:45:33 AM by karbock

jonap

  • Full Member
  • ***
  • Posts: 131
wow dude, you are great, really saved me a lot of time

I did indeed try to use ATRT and stopped at the error you mention, but then I stopped cause I didn't notice the new line so I tought it wouldn't be possible and then you solved the problem

Now it seems to work like a charm, and I can even do it multiple files at the same time if I respect the correct order, so just great

And actually I already use AutoHotkey for some other minor tasks, so yeah, that script to even automatize the new line removal would be great

really thank you

karbock

  • Sr. Member
  • ****
  • Posts: 337
Glad I could help!

This is the script for both major versions of AHK:

Code: version_1.1
!^c::
Clipboard := ""
Send ^c
ClipWait 1
if ErrorLevel
return
clipboard := RegExReplace(clipboard,"D)[\r]?\n$","")
return

Code: version_2
!^c::
{
A_Clipboard := ""
Send "^c"
if !ClipWait(1) {
MsgBox "The attempt to copy text onto the clipboard failed."
return
}
A_Clipboard := RegExReplace(A_Clipboard,"D)[\r]?\n$","")
}

Comments:
; ------------------------------------------------------------
; Alt+Ctrl+c
; Intended for copying a spreadsheet selection onto the clipboard,
; and adapting it before pasting the clipboard
; with MusicBee's plugin "Advanced Tag & Reporting Tools";
; Steps:
; (1) empty clipboard
; (2) copy current selection to clipboard
; (3) remove last newline at end of clipboard
; ------------------------------------------------------------

Last Edit: June 25, 2023, 08:29:42 PM by karbock

jonap

  • Full Member
  • ***
  • Posts: 131