applescript help

Discussion in 'Mac Programming' started by trainguy77, Apr 29, 2008.

  1. trainguy77 macrumors 68040

    Joined:
    Nov 13, 2003
    #1
    Code:
    tell application "iTunes"
    	if selection is not {} then
    		my addNextSong(item 1 of selection)
    	end if
    end tell
    
    on addNextSong(trackID)
    	tell application "iTunes"
    		set thePlaylist to playlist "Party Shuffle"
    		
    		duplicate trackID to thePlaylist
    	end tell
    	
    end addNextSong
    I found this, but i need to make it so it adds the whole selection not just one song. How would i do that?
     
  2. xUKHCx Administrator emeritus

    xUKHCx

    Joined:
    Jan 15, 2006
    Location:
    The Kop
    #2
    this work for you (?)
    Code:
    tell application "iTunes"
    	if selection is not {} then
    		my addNextSong(selection)
    	end if
    end tell
    
    on addNextSong(selection)
    	repeat with every_item in selection
    		tell application "iTunes"
    			set thePlaylist to playlist "test"
    			duplicate every_item to thePlaylist
    		end tell
    	end repeat
    end addNextSong
     
  3. trainguy77 thread starter macrumors 68040

    Joined:
    Nov 13, 2003

Share This Page