MediaMonkey - Script zum splitten von Interpret/Titel

SK1NNER

Lt. Junior Grade
Registriert
Feb. 2011
Beiträge
294
Hallo,

ich habe hier in MediaMonkey ein paar Alben, die falsch benannt sind, und zwar folgendermaßen:

Titel: Interpret - Songtitel Interpret: Various
Jetzt möchte ich, dass es so aussieht (so wie es ja sein sollte :p):
Titel: Songtitel Interpret: Interpret
Und da es insgesamt ca. 700 Songs sind, die so benannt sind, wollte ich es eigentlich über die Script-Funktion machen. Da ich mich da aber nicht auskenne, wollte ich fragen, ob mir jemand das folgende Script umschreiben könnte:
Code:
' A simple script that swaps the content of Title and Artist fields of selected tracks

Sub SwapArtistTitle
  ' Define variables
  Dim list, itm, i, tmp

  ' Get list of selected tracks from MediaMonkey
  Set list = SDB.CurrentSongList 

  ' Process all selected tracks
  For i=0 To list.count-1
    Set itm = list.Item(i)

    ' Swap the fields
    tmp = itm.Title
    itm.Title = itm.ArtistName
    If itm.AlbumArtistName = itm.ArtistName Then     ' Modify Album Artist as well if is the same as Artist
      itm.AlbumArtistName = tmp
    End If
    itm.ArtistName = tmp
  Next

  ' Write all back to DB and update tags
  list.UpdateAll
End Sub

Dieses Script liegt MediaMonkey standardmäßig bei und kann den Titel und den Interpret vertauschen.

Vielen Dank im Vorraus, bin gespannt, ob das jemand schafft !
 
Hat keiner eine Idee ? :(
 
Hallo overc0re

Ich habe leider keine Ahnung von MediaMonkey oder VBScript(was bei den Scripts verwendet wird).

Trotzdem habe ich einige Funktionen etc. zusammengesucht und dir das geünschte Script zusammengebastelt. Leider kann ich nicht überprüfen, ob dieses Script auch wirklich funktioniert. Deshalb würde ich an deiner Stelle besser auf eine Antwort eines erfahrenen VBS-Scripters warten oder falls du die Möglichkeit hast, das Script vorher testen.

Code:
Sub SwapArtistTitle
  ' Define variables
  Dim list, itm, i, interpret, title

  ' Get list of selected tracks from MediaMonkey
  Set list = SDB.CurrentSongList 

  ' Process all selected tracks
  For i=0 To list.count-1
    Set itm = list.Item(i)
    Set interpret = Mid(itm.Title,0,Len(itm.Title) - (InStr(itm.Title,"-")-1))
    Set title = Mid(itm.Title, (InStr(itm.Title,"-")+2))
    itm.Title = title
    itm.ArtistName = interpret
  Next

  ' Write all back to DB and update tags
  list.UpdateAll
End Sub

Freundliche Grüsse,
Spartan-117
 
Da du nichtmehr geantwortet hast geh ich mal davon aus das das problem noch besteht
sollte so eigentlich ganz gut funktionieren
es muss hald wirklich alles Interpret - Title aufgebaut sein ansonsten ist eben falschrum
Code:
Sub SwapArtistTitle()
    Dim list, itm, i, tmp
    list = SDB.CurrentSongList

    For i = 0 To list.count - 1
        itm = list.Item(i)

        Dim strSplitedTitle() As String = itm.Title.Split("-")
        itm.ArtistName = Split(0).Trim()
        itm.Titlle = Split(0).Trim()
    Next
    list.UpdateAll()
End Sub
 
Zurück
Oben