Extracting MP3 Tags from a Text File into Keyboard Maestro Variables

Hey Costa,

That's simple, although you might not think so if you're unfamiliar with regular expressions. (See macro below.)

I could have used one Search Variable action to extract each tag-block, but I broke it up into six actions – so the regular expressions would be easier to understand.

This gives you an example of how to pull text out of a text file and parse it into different variables.

(The variables are deleted at the beginning and end of the macro to prevent them from accidentally being reused – in a production macro I'd add more error-checking.)

I'm not familiar with any command-line MP3 tagging software, but Google unsurprisingly says some exist.

I found this pretty quickly on Stackexchange: Is there a good command-line ID3 tool for OS X?

I was able to install id3lib using MacPorts (I use it instead of Homebrew).

It did install id3tag.

There's not a man page for it, but there is help: id3tag -h

-Chris


Extract MP3 Tags from a File.kmmacros (11 KB)

1 Like