Script for changing TAG's in MP3-File?

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Script for changing TAG's in MP3-File?

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

by TIV73 » Tue Apr 27, 2021 3:30 pm

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

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

by drakinite » Tue Apr 27, 2021 12:08 pm

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();

Script for changing TAG's in MP3-File?

by Charly-IV » Tue Apr 27, 2021 8:48 am

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

Top