Custom write tag for CATraxx

Discuss the powerful Explorer Templates used in the CAT programs
Post Reply
User avatar
DougWilliams
Site Admin
Posts: 377
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Custom write tag for CATraxx

Post by DougWilliams » Fri May 29, 2020 1:30 am

In the Facebook group there was a question asked:
I collect film scores and one field I consistently populate is Conductor. Is there a way to add this field to the process of writing to tags - thereby having this field show up in mp3 tags along with Album Artist, etc.
There is using the Customize Tag Write feature.

First, let's create the XSL file used. Open Notepad or your favorite TEXT editor. NOT Word or other word processor
Then paste the following into the text editor:

Code: Select all

 <!-- Album Artist with Conductor -->
<?xml version="1.0" encoding="utf-8"?>
<?data type="record"?>
<?data table="track"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>

<xsl:template match="/">
   <xsl:for-each select="data/record/albumdata/artists/artist">
    <xsl:value-of select="name"/> 
    <xsl:if test="position() &lt; last()">
      <xsl:text>, </xsl:text>
    </xsl:if>    
   </xsl:for-each>
   <xsl:if test="count(data/record/trackdata/conductorcredits/conductorcredit[roles/role='Conductor']) > 0">
 <xsl:text>, </xsl:text>
   <xsl:for-each select="data/record/trackdata/conductorcredits/conductorcredit[roles/role='Conductor']">
    <xsl:value-of select="name"/> 
    <xsl:text> [Conductor]</xsl:text>
    <xsl:if test="position() &lt; last()">
      <xsl:text>, </xsl:text>
    </xsl:if>    
  </xsl:for-each> 
    </xsl:if>  
</xsl:template>

</xsl:stylesheet>
Save as Conductor.xsl into the TagWrite Templates folder which should be with all your other CATraxx data folders.

Next in Album View select an album where the first track has the conductor role populated.

Now open TOOLS > AUDIO FILE OPTIONS > TAG MISCELLANEOUS then click on the "Customize tag write..." button in the lower right.
The Custom Tag Write form should open.
Tick the Album Artist tag.
Click on the XSL Templates and select "Album Artist with Conductor" (that's the file you created earlier).
The XSL code should fill into the form.
Click Test in the upper right. (This is why we selected the album with a conductor in the first track)
Annotation 2020-05-28 201611.jpg
Annotation 2020-05-28 201611.jpg (147.59 KiB) Viewed 272 times
Annotation 2020-05-28 202130.jpg
Annotation 2020-05-28 202130.jpg (15.23 KiB) Viewed 272 times
Click OK
Be sure the Album Artist is still "ticked".
Click OK

Now update the tag on JUST the album audio files you selected (just in case the tag write doesn't work)
Annotation 2020-05-28 202131.jpg
Annotation 2020-05-28 202131.jpg (97.89 KiB) Viewed 272 times
You can check the tag using whatever you use (mine is available through my Windows Explorer).
Annotation 2020-05-28 202947.jpg
Annotation 2020-05-28 202947.jpg (14.44 KiB) Viewed 272 times
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

Post Reply