Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Copy music to iPod based on recent iTunes playback iPod
My iTunes library is much larger than the capacity of a 4GB (or even 8GB) Flash-memory-based iPod. Therefore I searched for a solution that would allow me to automatically copy a selection of songs I'm actually listening to over to my iPod. I didn't want to bother changing the playlist I am syncing with the iPod manually every week or so.

The solution was based on this AppleScript snippet I found on the Internet, with some changes to make it work the way I wanted it to work. The script adds albums to a playlist based on the songs I recently played. In that way, the iPod is always filled with the music I'm enjoying right now. 2br Here is the script:
with timeout of 1000 seconds
    tell application "iTunes"
        if exists user playlist "Copy to iPod" then
            delete every file track of user playlist "Copy to iPod"
        else
            make new user playlist at folder playlist "Test" with properties {name:"Copy to iPod"}
        end if
        repeat with aTrack in (file tracks of user playlist "Recently played for iPod")
            set tempAlbum to album of aTrack
            --Make sure we haven't already added this album
            set testAlbum to count (every file track of user playlist "Copy to iPod" whose album is tempAlbum)
            if testAlbum = 0 then
                -- Nope, it's not in the playlist
                -- Let's check and see if there's room to add it
                -- Edit the next row (after: is less than) to set the maximum size limit. 15 GB for example is 1.5E+10, 7GB is 7E+9
                if (size of user playlist "Copy to iPod" is less than 7.5E+9) then
                    duplicate (every file track of library playlist 1 whose album is tempAlbum) to user playlist "Copy to iPod"
                else
                    exit repeat
                end if
            end if
        end repeat
    end tell
end timeout
To use this script, you need to create two playlists: One smart playlist called Recently played (for iPod), with time-based selection limits (like the built-in Recently Played playlist), and whatever other conditions you want to apply (e.g. no audio books). The ability to add my own conditions is why I used my own version of the Recently Played playlist, instead of the provided version. The second playlist is a standard playlist called Copy to iPod. The Copy to iPod playlist is the one that will be synced with the iPod.

The major drawback is that you have to play a song first in iTunes (playcount must be raised) before the album containing the song will be copied to the iPod.

[robg adds: I haven't tested this one. ]
    •    
  • Currently 2.38 / 5
  You rated: 1 / 5 (8 votes cast)
 
[10,080 views]  

Copy music to iPod based on recent iTunes playback | 12 comments | Create New Account
Click here to return to the 'Copy music to iPod based on recent iTunes playback' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Copy music to iPod based on recent iTunes playback
Authored by: joshforman on Sep 25, '08 08:09:09AM

Why not just use the Recently Played playlist (even your own variation of it)?

---
Josh Forman

http://www.joshforman.com/



[ Reply to This | # ]
Copy music to iPod based on recent iTunes playback
Authored by: evanr on Sep 25, '08 11:22:56AM

Because that would only get you the tracks that you had recently heard, whereas this setup gives you a bunch of albums that you have been listening to tracks from.

As someone who really hates an ipod full of singles, this script might be the best thing since sliced bread.

Yeah, it's totally a personal preference, but itunes doesn't offer an album by album understanding through smart playlists, and this gives us that functionality.



[ Reply to This | # ]
Copy music to iPod based on recent iTunes playback
Authored by: joshforman on Oct 15, '08 07:38:53AM

I didn't catch that whole-album angle, so I see where the difference lies now. :)

---
Josh Forman

http://www.joshforman.com/



[ Reply to This | # ]
Copy music to iPod based on recent iTunes playback
Authored by: zn0k on Sep 25, '08 08:15:42AM

Make a new Smart Playlist, match a rule of "Last played is in the last 2 weeks" (adjusted for what you like) and restrict it with "Limit to 4GB".

Then set that playlist to automatically sync.

That would seem considerably easier.



[ Reply to This | # ]
Copy music to iPod based on recent iTunes playback
Authored by: Anonymous on Sep 25, '08 11:56:44AM

Thank you for your sanity.

I'd make it hierarchical, by making a second "dumb" playlist of songs I'd like to hear (a manual override), and a third smart playlist that populates itself from members of the first and second.

Any tracks you haven't played recently and want to hear can then be just added to the "dumb" playlist.

This could be extended even further by having a dumb playlist of perpetual standards. Call it "My Freebirds" if you hate classic rock radio.



[ Reply to This | # ]
Copy music to iPod based on recent iTunes playback
Authored by: frgough on Sep 25, '08 09:08:03AM

Many, many moons ago I came across a very clever use of smart playlists that would create a "radio station"

Here's the setup:

Core: Smartlist to include all music you want in your radio station.

Infuser: Select from Core any songs played less than X times (this is your new music).

Rotation: Select from Core any music you haven't heard in two months. This rotates the song into your station for one play, then kicks it back out for two months.

Sprinkler: Select from Core your favorite songs (mine are 3 stars or better) not heard in the last 2 weeks. This throws in your favorite songs more often for one play.

Station: Select from Infuser, Rotation and Sprinkler.

The Station list has a varying amount of music in it. New stuff plays x times and then either gets tossed out for two months or two weeks depending on how much you like it, before coming back into play for one play. You can make any song "new" at any time by re-setting its play count. I sometimes do this when a song I haven't heard in a couple of months comes back into rotation and I decide I'm in the mood to hear it a few times.

You can make different stations (classical, rock, etc.) by repeating the above, but with different genre filters on your Core list.

You can then sync your Station list with your iPod, and you will always have different music with you every time.

I have found that I don't listen to anything other than my stations most of the time.



[ Reply to This | # ]
Copy music to iPod based on recent iTunes playback
Authored by: joshforman on Oct 15, '08 07:40:44AM

Just did this and like the results so far. I might add a few other playlists, like an Unrated-but-recently-played playlist to help me rate stuff.

---
Josh Forman

http://www.joshforman.com/



[ Reply to This | # ]
HINT SUCKS
Authored by: Girrelephants on Sep 25, '08 09:15:17PM
The much easier way is to open iTunes and create a smart playlist, and add a rule for: Playlist is Music and then just check the "Limit to __ items selected by most recently played"

[ Reply to This | # ]
Copy music to iPod based on recent iTunes playback
Authored by: lokon1979 on Sep 26, '08 01:40:42AM

can i give negative point to this clever "hints"?



[ Reply to This | # ]
To all those bashing this hint
Authored by: Akira on Sep 26, '08 03:36:12AM
Please read the hint again carefully! The poster wants the full albums on the songs he is listening to on his iPod. If you sync the playlist Recently Played, you'll only end up with the songs.
That said, I think just rating good songs, putting shuffle on albums and making a playlist with random top rated albums limited to 4 GB would be a better solution.

[ Reply to This | # ]
Copy music to iPod based on recent iTunes playback
Authored by: hessi on Oct 01, '08 07:23:03AM

Since most people do not seem to "get" your hint, let me thank you for all people who do get it and were eager to get some album intelligence into playlists.

One problem though: The script stops at one song of an album which isn't available (and not checked). Any chance to only include checked songs?



[ Reply to This | # ]
Copy music to iPod based on recent iTunes playback
Authored by: hessi on Oct 01, '08 08:28:09AM

So, after some googling I found the solution myself:

duplicate (every file track of library playlist 1 whose (album is tempAlbum and enabled is true)) to user playlist "Copy to iPod"

Only problem: It's slow as hell. Took about 40 minutes to fill a 7GB playlist on my iTunes - CPU at 100% the whole time, Script Editor and iTunes not usable at all. :-(



[ Reply to This | # ]