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


Click here to return to the 'Sync more data from iTunes to manually-synced iPods' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Sync more data from iTunes to manually-synced iPods
Authored by: PizzaCake on May 12, '07 04:27:04AM

Glad you like it. I've made two small changes to the applescript so that it now also updates skipped count and skipped date. Changes as follows:
1.
from-
set ipodTrackData to {name, artist, album, played date, played count, rating} of ipodTrack
to-
set ipodTrackData to {name, artist, album, played date, played count, rating, skipped count, skipped date} of ipodTrack
2.
add after-
try
set rating of eachFoundTrackInPlaylist to item 6 of ipodTrackData
end try
this-
try
set skipped count of eachFoundTrackInPlaylist to item 7 of ipodTrackData
end try
try
set skipped date of eachFoundTrackInPlaylist to item 8 of ipodTrackData
end try

The whole thing should hopefully look like this:
tell application "iTunes"
set iPodName to ""
set syncPlaylists to {"Music", "Podcasts"}
repeat with syncPlaylist in syncPlaylists
repeat with i from 1 to count of sources
if the kind of source i is iPod then
set iPodName to name of source i as string
set ipodPlaylistId to (first playlist of source iPodName whose name is syncPlaylist)
end if
end repeat
set musicLibraryId to (first playlist whose name is syncPlaylist)
--update every track itunes syncPlaylist with data from ipod syncPlaylist
repeat with ipodPlaylistTracksCounter from 1 to count of tracks of ipodPlaylistId
set ipodTrack to track ipodPlaylistTracksCounter of ipodPlaylistId
set ipodTrackData to {name, artist, album, played date, played count, rating, skipped count, skipped date} of ipodTrack
set foundTracksInPlaylist to (every track of musicLibraryId whose ((name is item 1 of ipodTrackData) and (artist is item 2 of ipodTrackData) and (album is item 3 of ipodTrackData)))
repeat with eachFoundTrackInPlaylist in foundTracksInPlaylist
--use try blocks in case of missing data
try
set played date of eachFoundTrackInPlaylist to item 4 of ipodTrackData
end try
try
set played count of eachFoundTrackInPlaylist to item 5 of ipodTrackData
end try
try
set rating of eachFoundTrackInPlaylist to item 6 of ipodTrackData
end try
try
set skipped count of eachFoundTrackInPlaylist to item 7 of ipodTrackData
end try
try
set skipped date of eachFoundTrackInPlaylist to item 8 of ipodTrackData
end try
end repeat
end repeat
end repeat
end tell



[ Reply to This | # ]
Sync more data from iTunes to manually-synced iPods
Authored by: robg on May 15, '07 04:12:33AM

I've also updated the linked source in the original hint with the updated version.

-rob.



[ Reply to This | # ]