Page 4 of 12
Posted: Thu Aug 09, 2007 8:35 am
by freeqboi
quick question, im not knowalgable at all on this stuff, and before i start breaking it, can i use this to, in the properties tab on a track automatically copy the artist field in to the album artist field, therefore replacing the annoying "various" in the album artist field that having compilaton albums causes?
if not anyone know of something that will? i ahve an inordinalte amount of comps, and dont wanna do them all by hand...
Posted: Thu Aug 09, 2007 10:44 am
by Eyal
Yes you can use this script to do that. But it will not do it automatically.
What you can do for your all your current songs, is select them all and apply
If you have the Gold version, you can use the
Advanced Find function to find all song where AlbumArtist="Various", and the select them all before running the script.
Posted: Thu Aug 09, 2007 5:48 pm
by Peke
3'rd solution without scripts:
Eyal wrote:If you have the Gold version, you can use the Advanced Find function to find all song where AlbumArtist="Various", and the select them all before running the script.
Just make album artist Empty and MM will fill that with Artist if Album fields exists. Also I think that you can navigate Albums/Artist for Various and do tag edit there even in Free MM.
Posted: Tue Aug 14, 2007 7:09 am
by freeqboi
thanks for the help guys, i went with peke's idea, mainly as i have no idea how to code scripts, and that did the job perfectly! fankoooo
Posted: Thu Aug 16, 2007 4:25 pm
by judas
Hi...i dunno if any1 else is having problem with this script on MM3....it works perfectly, changes the tags, but when i press close or the X to close it crashes MM...any ideas about what to change in order to make it work?
The error I get says:
MediaMonkey has encountered a problem.
Control '' has no parent window.
And it crashes!
Posted: Fri Aug 17, 2007 3:06 am
by Steegy
I just posted a modification to the script I made a while ago. I suppose it was to fix the problem you're describing, but due to holidays and such I must've forgotten. Hopefully it works as supposed, if not please let me know.
Posted: Fri Aug 17, 2007 5:53 am
by judas
thanks a lot steegy!!!!!! will try it and post results, hopefully all is fine now
EDIT: Works Perfectly now on MM3 A7.
Posted: Wed Aug 29, 2007 11:25 pm
by judas
This question
cyclopede wrote:Thank you, it's working quite well !!
Is there a way thou to make it remember the mask and let the script working automatically as soon as a new file is added to the monitored folder ?
Thanks
Julien.
was asked here:
http://www.mediamonkey.com/forum/viewtopic.php?p=101275
(Partial) Answer:
You can specify the default mask, so the script remembers it everytime:
Code: Select all
'*****************************************************
'**** USER DEFAULTS ****
'*****************************************************
Const def_EntryLinesCnt = 2
Const def_TagField = "Title"
Const def_TagMask = "%A - %S"
And this are the masks:
Code: Select all
%A = ArtistName"
%C = Author"
%G = Genre"
%L = AlbumName"
%M = BPM"
%R = AlbumArtistName"
%S = Title"
%T = TrackOrder"
%U = Custom1"
%V = Custom2"
%W = Custom3"
%Y = Year"
%P = Path"
Regarding your other question, I don't know how to trigger the script to run when a file is added to the library...
Posted: Thu Aug 30, 2007 3:27 am
by Steegy
Hey Julien
ExtractFields can do what you want, with some modifications:
- change the script's defaults like Judas explained
- add an event handler for SDB.OnTrackAdded
- change some other code
- make that the dialog is closed automatically
So this is possible, but probably not the best tool for the task.
Solutions:
- Your song's file names contain the info (title, artist, copyright) you need in the tags: change the way MediaMonkey "infers" this info from the filename/path (and make sure that MM always uses this approach when adding files). ==> Add a custom [SongMasks] mask in MM's configuration file.
- The above doesn't apply, you want to get the info (title, artist, copyright) from the existing ID3 tags (not from the filename/path). ==> A small custom script would be much faster and easier to create.
According to your message, the 2nd solution is the way to go. Is that right?
Posted: Thu Aug 30, 2007 4:10 am
by Steegy
Try this:
Code: Select all
Sub OnStartup
Script.RegisterEvent SDB, "OnTrackAdded", "SDB_OnTrackAdded"
End Sub
Sub SDB_OnTrackAdded(NewTrack)
If InStr(1, NewTrack.Path, "C:/hidownload/LiveBroadcast/", 1) = 0 Then Exit Sub
NewTrack.Title = ""
NewTrack.ArtistName = ""
NewTrack.Custom3 = ""
NewTrack.ParseText(NewTrack.Title, "%S, %A, Copyright:(C) %W")
NewTrack.Copyright = NewTrack.Custom3
NewTrack.Custom3 = ""
NewTrack.UpdateDB
NewTrack.WriteTags
End Sub
or this:
Code: Select all
Sub OnStartup
Script.RegisterEvent SDB, "OnTrackAdded", "SDB_OnTrackAdded"
End Sub
Sub SDB_OnTrackAdded(NewTrack)
If InStr(1, NewTrack.Path, "C:/hidownload/LiveBroadcast/", 1) = 0 Then Exit Sub
Dim txt : txt = NewTrack.Title
Dim pos1, pos2
pos1 = InStr(1, txt, ",", 1)
pos2 = InStr(pos1 + 1, txt, ",", 1)
NewTrack.Title = Mid(txt, 1, pos1 - (1))
NewTrack.ArtistName = Mid(txt, pos1 + 1 + 1, pos2 - (pos1 + 1 + 1))
NewTrack.Copyright = Mid(txt, pos2 + 1 + 15)
NewTrack.UpdateDB
NewTrack.WriteTags
End Sub
Both are autoscripts. Put one of them in MediaMonkey's
Scripts\Auto folder as explained
here.
It might also be possible with regular expressions (but don't ask me that).
Posted: Thu Aug 30, 2007 6:07 am
by judas
He who knows, knows!

Posted: Thu Aug 30, 2007 9:52 am
by cyclopede
Thank you Judas and Steegy, I do appreciate your help. The code you gave me is what I'm looking for.
Thou I'm afraid that if I save it in the scripts/auto folder, it's going to rename every files I add in MM, I only want to rename a daily download that I store in a specific folder. Can a line be added to the code to specify this folder ?
Thanks again,
Julien.
Posted: Thu Aug 30, 2007 2:23 pm
by Steegy
Yes sure.
Just show how the paths for your normal music, and the paths for your daily downloads, look like (e.g. using an example name). That way, we can see what the difference is and add an extra condition to the script.
Just as a remark: the script will change the tags (title, artist, copyright) from the daily downloads, but not the file name (you can let the script do that too if you want).
Cheers
Steegy
Posted: Thu Aug 30, 2007 8:22 pm
by cyclopede
Here's the path where the files are downloaded :
- C:/hidownload/LiveBroadcast/rmv8.bbc.net.uk/radio1
Posted: Fri Aug 31, 2007 3:27 am
by Steegy
I updated the code above. It will only run if the path starts with "C:/hidownload/LiveBroadcast/" (which, of course, you can change to "C:/hidownload/LiveBroadcast/rmv8.bbc.net.uk/radio1" if you want)