Just List Artists 1.1 [MM2+3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Just List Artists 1.1 [MM2+3]

Postby 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.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Request

Postby 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: Linksys/D-Link 635 (WLAN), Sonos Bundle 250, UPnP: Philips SLA5520/Noxon iRadio/Archos 605wifi/TEAC WAP-4500 (clients), Twonky 4.4 (server), Maxtor Shared Storage Plus 200GB/2 x Qnap 500 GB (NAS), MediaMonkey Lifetime 4.0.0.1381 (music manager)
Kos
 
Posts: 282
Joined: Fri Jan 12, 2007 5:05 am
Location: Denmark

Postby 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.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Tried that as well...

Postby 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: Linksys/D-Link 635 (WLAN), Sonos Bundle 250, UPnP: Philips SLA5520/Noxon iRadio/Archos 605wifi/TEAC WAP-4500 (clients), Twonky 4.4 (server), Maxtor Shared Storage Plus 200GB/2 x Qnap 500 GB (NAS), MediaMonkey Lifetime 4.0.0.1381 (music manager)
Kos
 
Posts: 282
Joined: Fri Jan 12, 2007 5:05 am
Location: Denmark

Postby 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.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby sommo » Tue Apr 15, 2008 10:44 am

Thanking you!
Is there anything you cant do!?
sommo
 
Posts: 122
Joined: Thu Nov 08, 2007 9:48 am

Re: Just List Artists 1.1 [MM2+3]

Postby 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
nynaevelan
 
Posts: 5540
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA

Re: Just List Artists 1.1 [MM2+3]

Postby 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.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Re: Just List Artists 1.1 [MM2+3]

Postby 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
nynaevelan
 
Posts: 5540
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA

Re: Just List Artists 1.1 [MM2+3]

Postby trixmoto » Wed Jan 07, 2009 9:18 am

Hmm, strange. :-?
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Re: Just List Artists 1.1 [MM2+3]

Postby 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?
hurtaxis
 

Re: Just List Artists 1.1 [MM2+3]

Postby 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)&", ")
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK


Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 12 guests