Just List Artists 1.1 [MM2+3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Just List Artists 1.1 [MM2+3]

Post by trixmoto » Wed Sep 20, 2006 2:55 pm

As requested here, this script lists all of the artists from your list of visible (or selected) tracks, in a simple text file.

If you want to print an alphabetical list of all your artists then click on the Artists node, and then the Artist column to sort, before running the report.

The installer is available from my website.

Code: Select all

'
' MediaMonkey Script
'
' NAME: JustListArtists 1.1
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 20/03/2008
'
' INSTALL: Copy to Scripts directory and add the following to Scripts.ini 
'          Don't forget to remove comments (') and set the order appropriately
'
' [JustListArtists]
' FileName=JustListArtists.vbs
' ProcName=JustListArtists
' Order=2
' DisplayName=Just List Artists
' Description=Just List Artists
' Language=VBScript
' ScriptType=1
'
' Fixes: Made compatible with MM3
'

Option Explicit

Sub JustListArtists 

  Dim list : Set list = SDB.CurrentSongList
  If list.Count = 0 Then
    Call SDB.MessageBox(SDB.Localize("Select tracks to be exported, please."), mtError, Array(mbOk))
    Exit Sub
  End If
  If SDB.VersionHi < 3 Then
    Set list = list.Artists
  End If  
  
  Dim fso : Set fso = SDB.Tools.FileSystem
  Dim path : path = Script.ScriptPath&".txt"
  Dim fout : Set fout = fso.CreateTextFile(path,True) 
  Dim dic : Set dic = CreateObject("Scripting.Dictionary")
  
  Dim Progress : Set Progress = SDB.Progress 
  If SDB.VersionHi < 3 Then
    Progress.MaxValue = list.Count
  Else
    Progress.MaxValue = list.Count*2
  End If
  Progress.Text = SDB.Localize("Exporting...")

  Dim i,j,itm,arr
  For i = 0 To list.Count-1 
    Set itm = list.Item(i) 
    If SDB.VersionHi < 3 Then
      If itm.ID > 0 Then 
        Call fout.WriteLine(itm.Name)
      End If
    Else
      arr = Split(itm.ArtistName,";")
      For j = 0 To UBound(arr)
        dic.Item(Trim(arr(j))) = ""
      Next
    End If
    
    Progress.Increase
    SDB.ProcessMessages
    If Progress.Terminate Then 
      Exit For 
    End If 
  Next 
  
  If SDB.VersionHi > 2 Then
    arr = dic.Keys
    Call SortArray(arr)
    Progress.MaxValue = list.Count+dic.Count
    For i = 0 To UBound(arr)
      Call fout.WriteLine(arr(i))
      Progress.Increase
      SDB.ProcessMessages
      If Progress.Terminate Then 
        Exit For 
      End If 
    Next      
  End If

  fout.Close 
  If Not Progress.Terminate Then 
    Dim WShell : Set WShell = CreateObject("WScript.Shell")
    i = WShell.Run(Chr(34)&path&Chr(34),1,0)
  End If 
End Sub 

Sub SortArray(arr)
  Call QuickSort(arr,LBound(arr),UBound(arr))
End Sub

Sub QuickSort(vec,loBound,hiBound)
  Dim pivot,loSwap,hiSwap,temp

  If hiBound - loBound = 1 Then
    If Vec(loBound) > Vec(hiBound) Then
      temp = Vec(loBound)
      Vec(loBound) = Vec(hiBound)
      Vec(hiBound) = temp
    End If
  End If

  pivot = Vec(Int((loBound + hiBound) / 2))
  Vec(Int((loBound + hiBound) / 2)) = Vec(loBound)
  Vec(loBound) = pivot
  loSwap = loBound + 1
  hiSwap = hiBound
  
  Do
    While loSwap < hiSwap And Vec(loSwap) <= pivot
      loSwap = loSwap + 1
    WEnd
    While Vec(hiSwap) > pivot
      hiSwap = hiSwap - 1
    WEnd
    If loSwap < hiSwap then
      temp = Vec(loSwap)
      Vec(loSwap) = Vec(hiSwap)
      Vec(hiSwap) = temp
    End If
  Loop While loSwap < hiSwap
  
  Vec(loBound) = Vec(hiSwap)
  Vec(hiSwap) = pivot
  
  If loBound < (hiSwap - 1) Then 
    Call QuickSort(vec,loBound,hiSwap-1)
  End If
  If hiSwap + 1 < hibound Then 
    Call QuickSort(vec,hiSwap+1,hiBound)
  End If
End Sub 

Sub Install()
  Dim inip : inip = SDB.ApplicationPath&"Scripts\Scripts.ini"
  Dim inif : Set inif = SDB.Tools.IniFileByPath(inip)
  If Not (inif Is Nothing) Then
    inif.StringValue("JustListArtists","Filename") = "JustListArtists.vbs"
    inif.StringValue("JustListArtists","Procname") = "JustListArtists"
    inif.StringValue("JustListArtists","Order") = "2"
    inif.StringValue("JustListArtists","DisplayName") = "Just List Artists"
    inif.StringValue("JustListArtists","Description") = "Just List Artists"
    inif.StringValue("JustListArtists","Language") = "VBScript"
    inif.StringValue("JustListArtists","ScriptType") = "1"
    SDB.RefreshScriptItems
  End If
End Sub
Last edited by trixmoto on Thu Mar 20, 2008 3:06 pm, edited 4 times in total.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Kos
Posts: 288
Joined: Fri Jan 12, 2007 5:05 am
Location: Denmark

Request

Post by Kos » Fri Feb 02, 2007 5:02 am

Is it possible to expand this script just a little bit? I very much would like a report with Artist, album and perhaps year....

Kos
Setup: Sonos, Twonky, Qnap, MediaMonkey Lifetime

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post by trixmoto » Fri Feb 02, 2007 8:53 am

The idea of this script is that it just lists the artists in your collection. Maybe my Just List Albums will be more useful to you.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Kos
Posts: 288
Joined: Fri Jan 12, 2007 5:05 am
Location: Denmark

Tried that as well...

Post by Kos » Fri Feb 02, 2007 10:08 am

but no.... I need a list (alphabetically) like this - people tend to remember artists more than album title (the individual song title is not important):


AC/DC Highway to hell 19xx
AC/DC Back in Black 19xx
Blondie Greatest hits 19xx
etc.

Kos
Setup: Sonos, Twonky, Qnap, MediaMonkey Lifetime

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post by trixmoto » Thu Mar 20, 2008 3:08 pm

New version (1.1) is now available to download from my website. I have made it compatible with MM3.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

sommo

Post by sommo » Tue Apr 15, 2008 10:44 am

Thanking you!
Is there anything you cant do!?

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Just List Artists 1.1 [MM2+3]

Post by nynaevelan » Tue Jan 06, 2009 8:06 pm

TM:

I get the following error when trying to run JLA in 3.1.0.1208:

Image

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Re: Just List Artists 1.1 [MM2+3]

Post by trixmoto » Wed Jan 07, 2009 4:40 am

The only reason I can guess this would be happening is if the "ArtistName" property is not returning any values - which would be a bug the developers would need to fix. I'll investigate further when I get a chance though.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Just List Artists 1.1 [MM2+3]

Post by nynaevelan » Wed Jan 07, 2009 5:23 am

TM:

I think we can chalk this up to user error, I must have selected something weird, or nothing at all because it is working perfectly now. Sorry. :oops:

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Re: Just List Artists 1.1 [MM2+3]

Post by trixmoto » Wed Jan 07, 2009 9:18 am

Hmm, strange. :-?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

hurtaxis

Re: Just List Artists 1.1 [MM2+3]

Post by hurtaxis » Tue Mar 23, 2010 4:43 pm

Is there any possible way to create a list with a comma and a space in between the artists instead of a new line?

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Re: Just List Artists 1.1 [MM2+3]

Post by trixmoto » Wed Mar 24, 2010 4:58 am

You could do this by opening "JustListArtists.vbs" in a text editor and replacing line 55...

Code: Select all

Call fout.WriteLine(itm.Name)
...with...

Code: Select all

Call fout.Write(itm.Name&", ")
...and line 76...

Code: Select all

Call fout.WriteLine(arr(i))
...with...

Code: Select all

Call fout.Write(arr(i)&", ")
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Post Reply