Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Option-deleting [macosxhints.com] a song from a Smart Playlist will delete it from your iTunes Library. Also, option-deleting a whole playlist will delete the playlist and all of the songs it contains (which is probably not what you want to do with your "Played Podcasts" Smart Playlist).
    • Neat. I didn't know about opt-delete.

      Also, because I can ... not that it is any longer necessary, but still:
      use Mac::Glue ':all';
       
      my $itunes = new Mac::Glue 'iTunes';
       
      my $podcasts = $itunes->obj(
          playlist  => 1,
          playlists => whose(special_kind => equals => enum('podcasts'))
      );
       
      my $tracks = $podcasts->obj(
          file_track => whose(played_count => g_t => 0)
      );
       
      for my $track ($tracks->get) {
          my $location = $track->prop('location')->get;
          unlink $location if $location && $location ne 'msng';
          $track->delete;
      }