dougscripts.com

October 16 2018 - 12:51 pm

Unfinished TV Shows

The TV Shows library can show you Watched shows and Unwatched shows. And how much time is left in shows you've started. But there's no way to sort these unfinished tracks or gather them all together, say, with a Smart playlist rule.

So here's a script that will find TV Show tracks that haven't been played all the way through and copies them to a new appropriately named playlist:

property tvPlaylistName : "_Un-Finished TV Shows"

tell application "iTunes"

set tvLib to (get some playlist whose special kind is TV Shows)

-- delete any old playlists

if (exists playlist tvPlaylistName) then

delete (every playlist whose name is tvPlaylistName)

end if

-- recreate, add date in playlist description

make new playlist with properties {name:tvPlaylistName}

tell playlist tvPlaylistName

set description to date string of (get current date)

end tell

-- examine each TV track

repeat with i from 1 to (count tracks of tvLib)

try

set aTVTrack to track i of tvLib

if (bookmark of aTVTrack) > 0.0 then

duplicate aTVTrack to playlist tvPlaylistName

end if

end try

end repeat

end tell

Open this in Script Editor by clicking the little little script icon above. Save it named whatever you like with the Format "Script" (.scpt) in your ~/Library/iTunes/Scripts/ folder so that it will be listed in the iTunes Script menu.

This script will need to be run manually every so often in order to refresh the playlist. Follow the instructions on this page to add a keyboard shortcut.

For Smarties: tracks in other libraries use the bookmark property (some by default) as well. Podcasts, Movies and Audiobooks can be sorted using a smilar script that targets those special kind libraries.

Site contents © 2001 - 2024 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not be interrupting the one who is doing it.