Tagging script, splitting title field

I’m evaluating my options when it comes to tagging my classical music and I could use some help with a tagging script.

I’m looking to be able to move some information from the title tag into another.

From:

Title = Symphony No. 9 in D minor, Op. 125: I. Allegro ma non troppo, un poco maestoso

To:

DiscSubtitle = Symphony No. 9 in D minor, Op. 125
Title: I. Allegro ma non troppo, un poco maestoso

I would really appreciate some help without since I’m unable to wrap my head around this.

It sounds like you want to split the title at the colon. You might be able to do this by something like (untested code):

$set(_index,$find(%title%,:))
$set(DiscSubtitle,$trim($left(%title%,%_index%)))
$set(Title,$trim($substr(%title%,$add(%_index%,1))))

That worked perfectly with some minor modifications. This one does exactly what I was requesting:

$set(_index,$find(%title%,:))
$set(DiscSubtitle,$trim($left(%title%,%_index%)))
$set(title,$trim($substr(%title%,$add(%_index%,1),)))

I really appreciate the help! I had some other ideas too but I should be able to use the example you gave me to make those come through.

1 Like