' A simple script that swaps the content of Title and Artist fields of selected tracks

Sub SwapTitleArtist
  ' Define variables
  Dim list, itm, i, tmp

  ' Get list of selected tracks from MediaMonkey
  Set list = SDB.SelectedSongList 
  If list.count=0 Then 
  Set list = SDB.AllVisibleSongList 
  End If  

  ' 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
    itm.ArtistName = tmp

    ' Update the changes in DB
    itm.UpdateDB
  Next
End Sub
