Add to iTunes, delete from Downloads, add Grouping to ID3?

GO TO ADMIN PANEL > ADD-ONS AND INSTALL VERTIFORO SIDEBAR TO SEE FORUMS AND SIDEBAR

dozens

New member
Joined
May 17, 2010
Messages
8
Points
0
I'm trying to make an Applescript that can be used as a Folder Action to watch the Downloads folder and:

-- Open .mp3s in iTunes and replace any text in Grouping field with 'singles' to track Grouping, then delete original .mp3s.

I'm stuck at the appending to Grouping part right now. Here's what I have so far:

Code:
property myFiletypes : {"mp3"}

on adding folder items to this_folder after receiving added_items
   repeat with anItem in added_items
       try
           -- see if the file has the right extension
           if myFiletypes contains (name extension of (info for anItem)) then
               -- add track to iTunes
               tell application "iTunes"
                   set addedTrack to add anItem
                   -- add grouping to track
                   set trackGrouping to grouping of addedTrack
                   if trackGrouping is "" then
                       set grouping of addedTrack to "singles"
                   else
                       set grouping of addedTrack to trackGrouping & return & "singles"
                   end if
               end tell
               tell application "Finder" to delete anItem
           end if
       end try
   end repeat
end adding folder items to
Any help is very appreciated!
 
Top