Script for changing TAG's in MP3-File?

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

Charly-IV

Script for changing TAG's in MP3-File?

Post by Charly-IV »

Hello,

I'm looking for a VBS-Script or an Information how to create a new script to change TAG's in an MP3-File. I wrote a Script to change TAG's in the MM-Database, but it doesn't work whithin the File.

Thanks and Greeting from Austria
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: Script for changing TAG's in MP3-File?

Post by drakinite »

Hello,

Good question! I'd recommend starting by reading this introduction to MM5 addons here: https://www.mediamonkey.com/wiki/Gettin ... d_(Addons)

The method that you are looking for is the commitAsync() method of the Track class: https://www.mediamonkey.com/docs/api/classes/Track.html

There are multiple ways to get a Track object; one of which is the uitools.getSelectedTracklist, which returns a Tracklist object: https://www.mediamonkey.com/docs/api/cl ... klist.html

For a simple example, if you wish to add some text to the title of every selected title, here are two ways you can do it:

Code: Select all

// Get selected tracklist
let list = uitools.getSelectedTracklist();
// For each track, change the title and save each track individually.
list.forEach(track => {
  track.title = track.title + 'hello world';
  track.commitAsync();
});
Or:

Code: Select all

// Get selected tracklist
let list = uitools.getSelectedTracklist();
// For each track, change the title
list.forEach(track => {
  track.title = track.title + 'hello world';
});
// Then, save the entire list. (commitAsync() is also a method of the Tracklist class)
list.commitAsync();
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
TIV73
Posts: 229
Joined: Sat Nov 12, 2011 1:31 pm

Re: Script for changing TAG's in MP3-File?

Post by TIV73 »

In addition to the snippets posted by drakinite you could also have a look at the swapArtistTitle addon which comes with mediamonkey.
Post Reply