need a script for album/artist export

Download and get help for different MediaMonkey for Windows 4 Addons.

Modérateurs : Peke, Gurus

brave

need a script for album/artist export

Message par brave »

hi, I bought this program for one reason, and one reason only, but sadly I have now found out that there is no (easy) way to do what i wanted to do.

All I want is to be able to print off a list of all the albums I have cataloged. I just want album name and artist, nothing else, not the track listings or any other data.
In the Library Tree there is the folder called location and basicly I want to export the list of "labels" (as it describes them in "properties") that appears there.
I have seen some scripts for artist > album export but i cannot make them work, I get errors. I guess the "media" data would also work.
To be poerfectly honest if I knew it would be this difficult I'd have bought a different product, but if anyone can help I would be grateful.
m_bojangles

You can try this in Access...

Message par m_bojangles »

brave, not sure if you're comfortable using MS Access. If you have MS Office on your PC with Access installed, start it up. Open the MediaMonkey database (usually located in C:\Program Files\MediaMonkey\Data\MediaMonkey.mdb).

Now, you'll see a list that says, "Tables, Queries, Forms, Reports, Pages" and so on (it's a vertical list). Click on Queries.

Click on "Create query in Design view". A window will pop up asking you what tables you want in your query. Close this window.

Now you're looking at a mostly blank window called "Query1 : Select Query".

Go up to "View" on the main menu at the top. Choose "SQL View". The window should change to a white window that says "SELECT;" in it. Erase that and paste this in:

SELECT Albums.Album, Artists.Artist
FROM Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID
ORDER BY Albums.Album, Artists.Artist;

Now, look at the button bar and find the red exclamation point. When you hover over it, it will say "Run". Click on that to run your query.

You should see an album/artist list.

Now, go to "File" on the menu and choose "Save". Give the query a name, like "Album-Artist list". You will then see this query in the "Queries" window of Access. It can be run anytime by double-clicking on it there.

Double-click on it there to run it again. Now go to File and you'll see a choice called "Export...". When that window pops up, look at the drop down list called "Save as type:" This will allow you to export the list to a ton of formats, including Excel, or even just a plain text file.

Hope this helps.

btw, that query sorts it by album title. If you want to sort by artist, change this line in the query:

ORDER BY Albums.Album, Artists.Artist;

to

ORDER BY Artists.Artist, Albums.Album;

If you don't have Access or don't want to try messing with this, then we should look into why you're having trouble with the scripts that you said don't work.

-m_bojangles
Hantsman
Messages : 19
Inscription : dim. févr. 22, 2004 3:03 pm

You can try this in Access...

Message par Hantsman »

I would like to take the sql query one stage further if poss and get a list by a certain letter likke 'A' for instance.

I don't know sql.
Plethora
Messages : 50
Inscription : mar. févr. 24, 2004 6:03 pm

comand line input

Message par Plethora »

here is a very basic way to do what u say.

It might not look pretty but it gets the job done if your mp3's are arranged in a "Artist\Album" folder configuration.

1. create a new text file on your desktop (right click > new)

2. type this text with needed adjustments

(drive letter mp3 files are in):
// for example -> c:

cd\(directory your mp3 files are in)
// for example -> "mp3_files\audio"

tree /a > (letter of drive used before):\(name of file for list).txt
// for example -> tree /a > c:\mp3list.txt

3. save this file you are typing in as (yourchoice).bat
// for example > generate_mp3_list.bat

4. double click on the .bat file and your list should generate at the drive letter you specified.

Like I said its basic but it works
:)

If it helps you mine looks like this:

e:
cd\mp3_world
tree /a > E:\mp3tree.txt

You can also drag the icon to the quick launch bar at the bottom left of your windows task bar. From there you should be able to right click on the icon and change its icon.. i use a tree icon.... :)
- Plethora
- 160 GB and Counting!!!
Turin Brakes
Messages : 4
Inscription : mer. juin 16, 2004 4:55 am

Re: need a script for album/artist export

Message par Turin Brakes »

brave a écrit :All I want is to be able to print off a list of all the albums I have cataloged. I just want album name and artist, nothing else, not the track listings or any other data.
Hi brave,

Edit the Scripts.ini file. Add something like this

Code : Tout sélectionner

[ExportAlbumCSV]
FileName=Export.vbs
ProcName=ExportAlbumCSV
Order=5
DisplayName=Export &Album to CSV
Description=Exports only Albumnames to a .csv file
Language=VBScript
ScriptType=1
Edit the Export.vbs file. Add this:

Code : Tout sélectionner

Sub ExportAlbumCSV
  ' initialize export
  Call InitExport (".csv", "CSV (*.csv)|*.csv|All files (*.*)|*.*", _
      "LastExportCSVDir")
  if fullfile="" then
    Exit Sub
  end if

  ' Create the output file
  Dim fout
  Set fout = fso.CreateTextFile( fullfile, True)

  ' Write header line
  fout.WriteLine Join(Array("Artist","Album"),",")
 
  ' Use progress to notify user about the current action
  Dim Progress
  Set Progress = SDB.Progress
  Progress.Text = "Exporting Albumnames to a CSV file..."

  ' Iterate through the list and export all albums
  
  Dim i
  Dim Album, Albums
  Set Albums = list.Albums
  Progress.MaxValue = Albums.count
  
  for i=0 to Albums.count-1
    Set Album = Albums.Item(i)
    fout.WriteLine Join( Array( QStr(Album.Artist.Name), QStr(Album.Name)), ",")
    Progress.Value = i+1
    if Progress.Terminate then
      Exit For
    end if
  next
  

  ' Close the output file and finish
  fout.Close

  ' Was it successfull?
  Dim ok
  if Progress.Terminate then
    ok = False
  else
    ok = True
  end if

  ' hide progress
  Set Progress = Nothing

  Call FinishExport( ok)
End Sub
After that restart MediaMonkey. Select the Albums you want and use your new menu entry File -> Export Track list -> Export Album to CSV.

HTH
Lowlander
Messages : 59388
Inscription : sam. sept. 06, 2003 5:53 pm

Message par Lowlander »

Remember that MM can overwrite the Export.vbs file when installing an update. It's advised to create a seperate file for new scripts, so you won't loose them on updates.
Turin Brakes
Messages : 4
Inscription : mer. juin 16, 2004 4:55 am

Message par Turin Brakes »

You are absolutely right!
This is just an example how to do it.
frank

great script

Message par frank »

Hello Turin,
your script works very well. Thank you. I am glad I checked here before trying to come up with something myself.
I am trying to add two more things:
1) Album Genre
It seems like the Genre information is attached to the Song and not to the Album, however, most artists can be classified as playing one type of music. I like to separate between Jazz, Latin, Pop/Rock, Ethno... this is how my CDs are orginized and I'd like to do the same with the export list from Media Monkey.
2) Album Location, or Number
I keep my CDs in seperate shelves and actually would like to start to number them, so I can find them more easily. This information should also be on the export list.
Can you help?
Thanks Frank
robin

Re: You can try this in Access...

Message par robin »

m_bojangles a écrit :brave, not sure if you're comfortable using MS Access. If you have MS Office on your PC with Access installed, start it up. Open the MediaMonkey database (usually located in C:\Program Files\MediaMonkey\Data\MediaMonkey.mdb).

Now, you'll see a list that says, "Tables, Queries, Forms, Reports, Pages" and so on (it's a vertical list). Click on Queries.

Click on "Create query in Design view". A window will pop up asking you what tables you want in your query. Close this window.

Now you're looking at a mostly blank window called "Query1 : Select Query".

Go up to "View" on the main menu at the top. Choose "SQL View". The window should change to a white window that says "SELECT;" in it. Erase that and paste this in:

SELECT Albums.Album, Artists.Artist
FROM Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID
ORDER BY Albums.Album, Artists.Artist;

Now, look at the button bar and find the red exclamation point. When you hover over it, it will say "Run". Click on that to run your query.

You should see an album/artist list.

Now, go to "File" on the menu and choose "Save". Give the query a name, like "Album-Artist list". You will then see this query in the "Queries" window of Access. It can be run anytime by double-clicking on it there.

Double-click on it there to run it again. Now go to File and you'll see a choice called "Export...". When that window pops up, look at the drop down list called "Save as type:" This will allow you to export the list to a ton of formats, including Excel, or even just a plain text file.

Hope this helps.

btw, that query sorts it by album title. If you want to sort by artist, change this line in the query:

ORDER BY Albums.Album, Artists.Artist;

to

ORDER BY Artists.Artist, Albums.Album;

If you don't have Access or don't want to try messing with this, then we should look into why you're having trouble with the scripts that you said don't work.

-m_bojangles
This is not working for me! Could it be because My Music is in a whole other drive from the Media Monkey program itself, and if this is so how would I write the Query?
Lowlander
Messages : 59388
Inscription : sam. sept. 06, 2003 5:53 pm

Message par Lowlander »

Nop, the location of your music has no effect on the query.

What doesn't work, can you be more specific?
rickp
Messages : 1
Inscription : sam. févr. 12, 2005 10:06 am

export album/artist script

Message par rickp »

The script example provided by Turin Brakes works well to export the album name, but the artist name appears to be the song artist name for the first song selected for an album (not the album artist name as expected). Is there a way to retrieve the album artist name for exporting in such a script?
jessica80
Messages : 3
Inscription : mer. janv. 26, 2005 4:43 am

Message par jessica80 »

This might be a really stupid question... but even when i query the database there are no entries. Is it supposed to automatically have all my mp3 info already?

:(
jessica80
Messages : 3
Inscription : mer. janv. 26, 2005 4:43 am

Message par jessica80 »

Oh, haha thanks Lowlander, I found the answer to my question in one of your posts ^.^
johnm

Re: You can try this in Access...

Message par johnm »

m_bojangles a écrit :SELECT Albums.Album, Artists.Artist
FROM Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID
ORDER BY Albums.Album, Artists.Artist;

-m_bojangles

How do you add the song info as well to the above query?

thanks
Répondre