Results 1 to 3 of 3
  1. #1

    AustinMatherne's Avatar
    Member Since
    Feb 16, 2010
    Location
    Stamford, Connecticut, USA
    Posts
    2
    Specs:
    Apple MacBook Pro 17"
    Question AppleScript Help Needed: Delete Watched TV Shows in iTunes
    First off, I'm extremely new to AppleScripting, I've only read a few beginners guides and I'm just starting to understand how it all works. But you gotta start somewhere right?

    What I'm trying to create is an AppleScript that will delete any watched TV Show from both the iTunes database and the physical video files. I figure that if I create a smart playlist in iTunes that pulls in every TV Show with a play count greater than 0 it should make deleting the shows a bit easer.

    If anyone knows how to do this and could point me in the right direction, I would truly appreciate it.

    Thanks,
    ~ Austin

  2. #2

    AustinMatherne's Avatar
    Member Since
    Feb 16, 2010
    Location
    Stamford, Connecticut, USA
    Posts
    2
    Specs:
    Apple MacBook Pro 17"
    I've got the script below which seems to work perfectly, but I'm stuck on adding an error check so that if it doesn't find anything to delete it won't display an error. If anyone knows how to do this, I'd truly appreciate the help.

    Code:
    tell application "iTunes"
     	set filesToDelete to location of (file tracks whose (video kind is TV show) and (unplayed is false))
     	delete (tracks whose (video kind is TV show) and (unplayed is false))
     end tell
     tell application "Finder"
     	repeat with theFile in filesToDelete
     		delete theFile
     	end repeat
     end tell
    Thanks,
    ~ Austin

  3. #3


    Member Since
    Oct 25, 2009
    Posts
    59
    Control-click. Error Handlers > Message and OK.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to delete TV shows from ipad
    By janisg in forum Switcher Hangout
    Replies: 3
    Last Post: 01-21-2013, 08:39 AM
  2. AppleScript Help Needed
    By lovinthemac in forum OS X - Apps and Games
    Replies: 13
    Last Post: 01-14-2010, 07:53 PM
  3. Delete files with AppleScript.
    By user99672 in forum OS X - Operating System
    Replies: 4
    Last Post: 12-20-2009, 05:57 PM
  4. iTunes applescript aid needed
    By nozomimomi in forum OS X - Apps and Games
    Replies: 0
    Last Post: 06-06-2005, 03:35 PM
  5. Applescript Help Needed
    By pphking in forum Apple Desktops
    Replies: 2
    Last Post: 02-21-2005, 12:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •