Scripting: MP3 track info

OK, I know I can write the mp3 track and total tracks info in a command like so:

SetAttr Meta "track:7/42"

And in a script, this is how to read the track number:

var track = item().metadata.audio.mp3track;

But how do I read the total tracks number?

(What I'm trying to achieve is to read 'total tracks' from the selected files and check if they all have the same value.)

Thanks,
MartO

I think, if totaltrack number is set, it is in mp3track too, separated by "/". That's how it works for discnumber at least.

Yes, thanks, I guess it should be, but reading mp3track returns only one value and no "/". :frowning:

Try metadata.audio_text instead of metadata.audio. (Also remember the string could be any old garbage put in by a tagging tool, so be prepared if it isn't a number or starts with a space, etc.)

1 Like

That's it, thanks! :slight_smile:
(Yes, I realize I might have to do some cleaning...)