Posts Tagged ‘iTunes’

lasTunes 1.0

Wednesday, February 11th, 2009

I just finished writing my first WordPress plugin! here is some information about lasTunes:

Adds iTunes links to Last.fm user’s Recently Played Tracks feed and displays them.

Multiple options, including:

  • Add direct links to each track artist’s myspace and last.fm pages
  • Add link to album
  • Add link to user’s last.fm page

see it in action below. oh, and check out the lasTunes WordPress plugins page, where you can/should download it. while I may provide updates here from time to time, all new versions will be posted there. namaste!

recently listened tracks of cfretts
Alan JacksonWho's Cheatin' Who [Extended]Everything I Love
Paper CrowsFollow The Leader (George Lenton remix)Stop, Revive, Survive
Foster The PeoplePumped Up KicksTorches
Death Cab for CutieYou Are A TouristCodes and Keys
alexkillsdieALEX JONES MEGA RANT (dubstep remix)alexkillsdie

lasTunes by Calen Fretts

iTunes – List Dead Tracks – To File

Friday, September 19th, 2008

this script will list all dead tracks in your iTunes library in a file called “DeadTracks.txt”

/* by Calen Fretts */ var ITTrackKindFile = 1; var iTunesApp = WScript.CreateObject("iTunes.Application"); var tracks = iTunesApp.LibraryPlaylist.Tracks; var numTracks = tracks.Count; var matchTracks = 0; var fso = new ActiveXObject("Scripting.FileSystemObject"); var FILE_NAME = "DeadTracks.txt"; var myFile = fso.CreateTextFile(FILE_NAME); WScript.Echo("Finding dead tracks..."); while (numTracks != 0) { var currTrack = tracks.Item(numTracks); // is this a track? if (currTrack.Kind == ITTrackKindFile) { if (currTrack.Location == "") { myFile.WriteLine("" + currTrack.Artist + " - " + currTrack.Album + " - " + currTrack.TrackNumber + " - " + currTrack.Name + ""); matchTracks++; } } numTracks--; } myFile.Close(); if (matchTracks == 0) { WScript.Echo("No dead tracks."); myFile = fso.GetFile(FILE_NAME); myFile.Delete(); } else { WScript.Echo("Found " + matchTracks + " dead tracks - see the following file: " + FILE_NAME); }

copy the code into a new text file, and rename its extension to “.js”. if you post this code anywhere else, please be sure to give me credit by linking back to this site. got questions or improvements? leave a comment!

iTunes – No Artwork To Playlist

Friday, September 12th, 2008

over the years, I’ve written a few custom scripts to do my electronic dirty work. some of these are iTunes scripts, and I think others will find them useful as well. copy the following code into a new text file, and rename its extension to “.js”

/* by Calen Fretts */ var ITTrackKindFile = 1; var iTunesApp = WScript.CreateObject("iTunes.Application"); var tracks = iTunesApp.LibraryPlaylist.Tracks; var numTracks = tracks.Count; var matchTracks = 0; var myNewPlaylistName = "---------NO ARTWORK"; var myNewPlaylist = iTunesApp.CreatePlaylist(myNewPlaylistName); WScript.Echo("Finding tracks with no artwork..."); while (numTracks != 0) { var currTrack = tracks.Item(numTracks); // is this a track? if (currTrack.Kind == ITTrackKindFile) { if (currTrack.Artwork.Count == 0) { var bSuccess = myNewPlaylist.AddTrack(currTrack); matchTracks++; } } numTracks--; } if (matchTracks == 0) { myNewPlaylist.Delete(); WScript.Echo("No tracks found."); } else { WScript.Echo("Found " + matchTracks + " tracks. Added to playlist '" + myNewPlaylistName + "'."); }

if you post this code anywhere else, please be sure to give me credit by linking back to this site. got improvements? leave a comment!


Switch to our mobile site