Feature Request: Copy formatted string to clipboard via shortcut or context menu (for same album selection)


#1

A big fan of this gem of a program, mp3tag saved me tons of work.

I work a lot with a list of albums and would love to select all tracks from the same album with one mouse-click or so. Other people have also requested the same or similar features in the past but alas there's no such possibility yet.

However, with a little help from mp3tag this could be still achieved, if only we had 'Clipboard' as an output for formatting strings.

Here's how I imagine it. If I could copy the field values of a selected file or files, using any combination of formatting strings like %artist%, %title%, etc. to the clipboard, I'd write an AutoHotkey script or alike. This script then would simulate a right click on a single selected file, copy the album name using formatting string %album% to the clipboard, send an F3 to mp3tag, paste the string %album% IS "%clipboard%", have it select all files via CTRL-A and send an F3 to close search field again. And tadaa, all files of the same album are selected in milliseconds :sunglasses:

There are already 2 functions which do a very similar job: export files and format fields, where the former uses files as output and the latter uses another field as output. And there's already some "tag copy" context menu. So I guess doing the same for clipboard as output would not be a very complicated development. As a side-effect mp3tag would also have another nice little capability involving clipboard.

What do you think?

I've donated in the past but will gladly donate more if this would be implemented in an easy to use (i.e. scriptable) fashion.


#2

How do you define tracks as being from the same album?
The data in the field ALBUM is the same? See "Greatest Hits", "Best of", "Gold" compilations.
Being from the same ARTIST? What about compilations like "Bravo Hits" etc. where the data in ARTIST is usually not the same for all tracks. This even applies to normal albums..

So you would rely on third party software?
Where would you draw the line what the clipboard could contain?
Right now, it is possible to select a huge number of tracks and copy the tag data to the clipboard. Like that you can easily transfer tag data from one set of files to another.
What happens to this data when being referenced by "%clipboard%"? And what happens to the selection mechanism?
I do not ask to criticize but to get a clearer picture.


#3

Thanks for the quick reply and questions :+1:

How do you define tracks as being from the same album? The data in the field ALBUM is the same?

Exactly. My collection is very album-oriented. I'm not worried about quality of the tags and not expecting mp3tag to do any guessing but just use whatever's in %album%. That makes it the same album as far as I'm concerned. If need be, we could still use some $if(), $if2()s etc. to decide.

So you would rely on third party software?

Unfortunately yes, since mp3tag does not give us the option. I use a few external progs anyway. One could achieve the same by automating all the clicks using Export function, opening the file, parsing it, then using F3, etc. pp but that hardly saves any time. Apparently it's not only me wanting to select same album very quickly, even quicker than SHIFT-selecting from first to last file.

What happens to this data when being referenced by "%clipboard%"

When mp3tag evaluates clipboard content the implied %clipboard% string should use whatever's in the clipboard, with or without evaluating the new lines in case multiple files were copied before. In my case new lines wouldn't make any difference; fine by me either way.

Right now, it is possible to select a huge number of tracks and copy the tag data to the clipboard.

This works only within mp3tag, i.e. you cannot use the result of "copy tags" in Notepad or any other program. This was the first thing I tried out.

I do not ask to criticize but to get a clearer picture.
No worries, all is well :slight_smile:


#4

You could also pass tags of the currently selected file via Mp3tag Tools through command line to your external script/program. It would require only one shortcut to press.

For a Mp3tag internal solution I'd suggest to add a scripting function like $meta_selected(field) to make the metadata of only the selected file available globally.


#5

You can create a filter expression on the Windows clipboard using an Mp3tag tool.
For example, to create an expression to find tracks that match the ALBUM of 1 selected track, use this tool:

Name: Create Filter Expression On Clipboard
Path: C:\Windows\System32\cmd.exe
Parameter: /c echo %%album%% IS "%album%" | clip


#6

I'd love "$meta_selected()".


#7

This works well, except a CMD window flashes. So I took your good idea (the trick was passing the album name in the call) and quickly cooked up an AHK script; posting it in case somebody searches for this in the future. It's ugly and causes lots of flickering on screen but does the job.

Also in the Tool description I put a "&4" in front of the text, e.g. "&4 Create Filter..." so I can quickly send the right click, a T for Tools, and a 4 for the new entry, which then executes this script.

#SingleInstance ignore
#IfWinActive, ahk_exe mp3tag.exe
loop, %0% {
album_name := %a_index%
clipboard = %album% IS "%album_name%"
Send, {F3}
Send, ^v
Sleep, 200
Send, {tab}{tab}
Sleep, 100
Send, ^a
Sleep, 100
Send, {F3}
}
#IfWinActive

Unless Florian decides to implement a select album feature natively, consider my request closed.