Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create uniq files in itunes playlist

Status
Not open for further replies.

pujas

Programmer
Feb 2, 2005
22
0
0
US
Hi,
I have a function in VB. that copies all files in a given folder to the itunes playlist.

The below function creats a playlist "puja" in itunes and
copies all songs from the folder c:\Pujafolder to puja.

Public Function CopyAudioToiTunes()

PlaylistName = "Puja"
'Set iTunesApp = CreateObject("iTunes.Application")
Set iTunesApp = New iTunesApp
Dim Albumplaylist
Set Albumplaylist = Nothing
Set Albumplaylist = iTunesApp.LibrarySource.Playlists.ItemByName(PlaylistName)
If Albumplaylist Is Nothing Then
Set Albumplaylist = iTunesApp.CreatePlaylist(PlaylistName)
MsgBox "Creating new Playlist" & Albumplaylist.Name
End If
Dim AudioFilesArray(0) As String
AudioFilesArray(0) = "c:\Pujafolder"

Albumplaylist.AddFiles (AudioFilesArray)
MsgBox ("Created playlists and added audio files to itunes.")

End Function


The problem is everytime i add new audio files to the folder Pujafolder and call this function it copies all the files (the old and the new ones) . Is there a way to only copy those files which don't exist in the current playlist.

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top