Comment to Custom Field script

Post a reply

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

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

Topic review
   

Expand view Topic review: Comment to Custom Field script

by shoney » Sat Nov 17, 2007 11:15 am

I would like to add the comment field to Custom 1, but am having trouble getting it to work. I don't know much about writing and understanding scripts, so any help is appreciated. I looked at the ExtractFields code and I don't know how that will get the Comment field assigned to Custom 1. I tried modifying a script I found on this board to work with Comment, but when I run it, an error pops up saying that the program does not recognize the function File.Comment. Here is the script. Can someone tell me what I should put in place of File.Comment?

Sub SelectedFileComment
Dim mySongList : Set mySongList = SDB.CurrentSongList

If mySongList.Count = 0 Then
SDB.MessageBox "Nothing selected!", mtError, Array(mbOK)
Exit Sub
End If

Dim i, mySong
For i = 0 To mySongList.Count - 1
Set mySong = mySongList.Item(i)
mySong.Custom3 = GetFileComment(mySong.Path)
mySong.UpdateDB
Next
End Sub

Function GetFileComment(FilePath)
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
Dim File : Set File = FSO.GetFile(FilePath)
GetFileComment = File.Comment
End Function

thanks

by AusMuso » Thu Nov 08, 2007 9:02 am

Thanks, it did the trick. I was probably searching too specifically (and Comment is just an annoying word to search for).

I've seen other people ask questions similar to mine so I'll now be able to spread the love.

Thanks again.

by Mizery_Made » Thu Nov 08, 2007 5:46 am

ExtractFields might be able to perform your 'Comment -> Custom 1' trick.

Comment to Custom Field script

by AusMuso » Thu Nov 08, 2007 5:38 am

Preamble:
I'm a MM 2.5 Gold user and the situation I have is as follows.
Changed from iTunes to MediaMonkey a few days ago.
Have so far successfully corrected/modified MM in the ways that suit my needs. Thanks to the developers and script-writers for their help.

Problem:
I had a Rock Top 500 playlist in iTunes, the order was defined by the value, e.g. 210, in the Comment field. Many of the same tracks already have a value in Track number for other purposes so I definitely want to use Comment. In iTunes playlists and the library can be sorted by Comment.

Processes: I have read many posts and done many searches. I understand that MM cannot currently sort by Comment due to it potentially being multi-lined. I am yet to find a Script which adds the ability to sort library or a playlist by Comment.

Solution?: I am thus looking for a Script which allows sort by Comment
OR an idea I saw in another thread - transferring contents of Comment field to Custom 1.
I have not seen a script which does either, and yes it would be too tedious to manually transfer one number from one field to another 500 times.

P.S. Also, I have been unable to set up a new Autoplaylist which will grab the selected tracks and rank them appropriately. I would be happy to do that as well, if possible.
Thanks

Top