Copy Metadata between Tracks via Script? Seems like it should work, but it does not

So I tried this:

Select a Track on the Right and run a script:


$set(_copytitle,$if2(%title%,0))
$set(_copytitlesort,$if2(%titlesort%,0))
$set(_copysubtitle,$if2(%subtitle%,0))

$set(_copyartist,$if2(%artist%,0))
$set(_copyartists,$if2(%artists%,0))
$set(_copyartistsort,$if2(%artistsort%,0))

$set(_copyalbum,$if2(%album%,0))
$set(_copyalbumsort,$if2(%albumsort%,0))
$set(_copyalbumartist,$if2(%albumartist%,0))
$set(_copyalbumartistsort,$if2(%albumartistsort%,0))

Then Select track/tracks on the Left and run a similar script:

$set(title,%_copytitle%)
$set(titlesort,%_copytitlesort%)
$set(subtitle,%_copysubtitle%)

$set(artist,%_copyartist%)
$set(artists,%_copyartists%)
$set(artistsort,%_copyartistsort%)

$set(album,%_copyalbum%)
$set(albumsort,%_copyalbumsort%)
$set(albumartist,%_copyalbumartist%)
$set(albumartistsort,%_copyalbumartistsort%)

I get varied results mostly showing most of the tags will be deleted or the values have changed to ‘00’ or nothing.

So I’m guessing variables are not nessesarily memory resident, or moveable between tracks?

For that matter, running each script on the same selection messes it up similarly too… So that’s not gonna happen. :frowning:

Variables are set per track and will remain there when it moves from the left to the right.
You cannot use these scripts to move metadata between tracks but they might be useful if you want to track how the metadata changes.
Install the “View script variables” plugin to see the _ variables.
With the plugin active right click on a track > plugins > view script variables.

In my testing if I load an untagged file on the left, run script 1 and perform a lookup and use the plugin to see all _ variables set by script 1 and

Running script 2 will only show differences if things are different.

When the metadata is processed the original metadata is stored in one object.
A web request is made to get the new metadata in an object.
The new metadata is merged with the old and any variables that do not start with an _ are displayed and any that are new or have changed are marked in yellow or green.

1 Like