RSS Feedings
What's New...
30 Most Recent
dougscrptr
Site Menu
[ Home
[ What's New
[ 440 Scripts...
- ...by category:
- Managing Tracks
- Managing Track Info
- Managing Artwork
- Managing Playlists
- Controlling iTunes
- Exporting Info
- Managing Files
- Networking
- Internet
- iPod
- Miscellaneous
- With Other Apps
- Retro Scripts
- Script Stats
[ Download FAQ...
[ Missing Menu Commands
[ FAQ & Solutions
[ Tips & Info
[ Forum at iLounge
[ dougscrptr
[ Twitter
[ my del.icio.us
[ Uhm, Windows?
Shareware Apps
- Dupin v1.3.3
- Join Together v5.2.1
- iTunes Library Manager v5.1
Site Info
- Who's Doug?
10 Most Recently Added:
Links point to a script's entry page...
- Super Remove Dead Tracks v2.1
Remove missing (!) tracks from entire Library (apr 6 '08) - Quick Convert v2.7
Convert or import tracks with any encoder on the fly (apr 3 '08) - Make Bookmarkable v2.3
Change file type to make selected AACs bookmarkable (apr 3 '08) - Make UN-Bookmarkable v3.2
Make selected tracks NOT bookmarkable (apr 3 '08) - Block Party! v2.0
Create a Block Party! playlist of random Artists and specific number of their random songs to be played in a row (mar 31 '08) - Now Where Was I? v1.0
Remember current track when quitting iTunes, pick up playing on next start (mar 31 '08) - Make Video Tags v1.1
Application assists with batch-editing video track tags (feb 26 '08) - Re-Add Selected Tracks as Podcast v1.1
Re-add any tracks as Podcast episodes to the Podcasts playlist (feb 22 '08) - CDDB Safari Kit v2.4.1
Search for info and get track names from CDDB web site using Safari (feb 20 '08) - List Music Folder Files Not Added v2.0
List files in chosen folder(s) which aren't in iTunes (jan 21 '08) - the 30 most recent...
30 Most Recent RSS Feed
Your donation allows me keep the site up-to-date, fun, and easy to use. Thanks!
Donations of any convenient size help defray my personal costs in keeping the site going. Making a contribution via Amazon Honor, Kagi, or PayPal is easy, safe, and secure. Future visitors salute you!
Purchase Superb dougscripts.com Shirts & Mugs from CafePress

Purchasing recommended products from Amazon also supports the site!
Top 11 Downloads
Links point to a script's entry page...
[#] = total downloads
- Make Bookmarkable [103045]
- Super Remove Dead Tracks [86048]
- Find Album Artwork with Google [72854]
- Corral iTunes Dupes [60091]
- Import iPod Audio Files [58225]
- CDDB Safari Kit [36609]
- Remove Duplicate Tracks From Playlist [32287]
- Tracks Without Artwork to Playlist [30567]
- Corral All Dupes [26590]
- Remove n Characters From Front or Back [21079]
- Google Lyric Search [20230]
- full list...
Other Sites' Favorites
lifehacker: Top 13 iTunes AppleScripts
Playlist: Top 10 iTunes AppleScripts
Macworld: iTunes' "hidden" features
10 Random Scripts
Links point to a script's entry page...
- iTunes Database FMP Export iTunes track data to a FileMaker Pro database
(Exporting Info) - Play Grouping Next In Party Shuffle Add tracks with same Grouping tag in track order to Party Shuffle
(Controlling iTunes) - Playlist Creator Create a new iTunes playlist by dropping a folder of MP3s on to it
(Managing Playlists) - Disable Gracenote Disable (or re-enable) Gracenote CDDB searches
(Controlling iTunes) - Append to Comments Batch-append text to comments
(Managing Track Info) - Batch-Delete Playlists Delete one or more playlists at once in either iTunes or iPod
(Managing Playlists) - Link Playlist to Folder Link a playlist with a folder of files
(Managing Playlists) - Update iPod Sync iPod on-the-fly
(iPod) - Album Ranking Export to HTML a list of your highest rated albums
(Exporting Info) - Access Stream Address Get URL track's address and send to browser or clipboard
(Internet)
Missing Menu Commands
This is a list (a very subjective list) of scripts that perform tasks you may wish were actual iTunes Menu commands. Just copy and paste 'em to your Script Editor and save to your iTunes Scripts folder...then add a Shortcut.
Optionally, you can click the mini-script icon link beneath each snippet to open the script in Script Editor on your computer. This is URL Protocol Messaging and works with most modern Mac browsers (IE for Mac is not considered one of these).
Following these scripts is a list of other Missing Menu Command candidates that are available for downloading elsewhere on the site.
This list is still growing. Send your suggestions.
View Main Library
This is helpful in iTunes 7 for displaying the entire "master" library and listing all tracks. (BROKEN as of iTunes 7.1. See the workaround on this page.)
tell application "iTunes" set view of front browser window to library playlist 1 end tell
![]()
View Party Shuffle
Same as above but selects the "Party Shuffle" Playlist.
tell application "iTunes" set view of front browser window to playlist "Party Shuffle" end tell
![]()
View Current Playlist
Select playlist containing currently playing track. Same as Command-L without current track being selected.
tell application "iTunes" if player state is playing then set view of front window to playlist (name of current playlist) end if end tell
![]()
Jump to Playlist
Enter a name or first few letters of a playlist and the script will select it in the main browser window.
tell application "iTunes" repeat set search_for_this to text returned of ¬ (display dialog "Enter the name or first few letters of the playlist you want to view:" default answer "") if search_for_this is not "" then exit repeat end repeat try set view of front browser window to playlist ¬ (name of (get (first playlist whose name starts with search_for_this))) on error display dialog "None of your playlists seem to begin with \"" & ¬ search_for_this & "\"" buttons {"Cancel"} default button 1 end try end tell
![]()
Delete Selected Playlists
tell application "iTunes" set deleteThese to (choose from list (name of user playlists) as list with prompt "Select Playlists to delete..." with multiple selections allowed) if deleteThese is false then error number -128 -- cancel repeat with thisPlaylist in deleteThese try delete playlist thisPlaylist end try end repeat display dialog "Playlists have been deleted!" buttons {"Thanks"} default button 1 giving up after 10 end tell
![]()
Virgin Again
Set the played count of selected tracks to 0 and set their last played date to a time long ago.
from Dale Critchley
tell application "iTunes"
if selection of front browser window is not {} then
set sel to selection of front browser window
repeat with this_track in sel
try
set played date of this_track to date "Wednesday, June 16, 1993 12:00:00 AM"
set played count of this_track to 0
end try
end repeat
end if
end tell
Add/Subtract Half Star
iTunes 6.0.2 recognizes half-star ratings. The four scripts below increase or decrease the selected tracks' (or current track's) ratings by half a star (see the script Add-Subtract A Half Star.)
-- add a half star tell application "iTunes" if selection is not {} then set sel to selection with timeout of 30000 seconds repeat with this_track in sel my add_half(this_track) end repeat end timeout else display dialog "Select some tracks first..." buttons {"Cancel"} default button 1 with icon 2 giving up after 15 end if end tell to add_half(this_track) tell application "iTunes" try set rat to (get this_track's rating) if rat is less than or equal to 90 then set this_track's rating to (rat + 10) end try end tell end add_half
![]()
-- subtract a half star tell application "iTunes" if selection is not {} then set sel to selection with timeout of 30000 seconds repeat with this_track in sel my sub_half(this_track) end repeat end timeout else display dialog "Select some tracks first..." buttons {"Cancel"} default button 1 with icon 2 giving up after 15 end if end tell to sub_half(this_track) tell application "iTunes" try set rat to (get this_track's rating) if rat is greater than or equal to 10 then set this_track's rating to (rat - 10) end try end tell end sub_half
![]()
-- add a half star to current track tell application "iTunes" if player state is not stopped then my add_half(get current track) end tell to add_half(this_track) tell application "iTunes" try set rat to (get this_track's rating) if rat is less than or equal to 90 then set this_track's rating to (rat + 10) end try end tell end add_half
![]()
-- subtract a half star to current track tell application "iTunes" if player state is not stopped then my sub_half(get current track) end tell to sub_half(this_track) tell application "iTunes" try set rat to (get this_track's rating) if rat is greater than or equal to 10 then set this_track's rating to (rat - 10) end try end tell end sub_half
![]()
Selected Tracks to Current Playlist
tell application "iTunes" if player state is not stopped then set curPlaylist to current playlist if curPlaylist is not view of front browser window and ¬ class of curPlaylist is user playlist and ¬ not smart of curPlaylist and selection is not {} then duplicate selection to curPlaylist display dialog "Tracks copied." buttons {"Thanks"} ¬ default button 1 giving up after 10 end if end if end tell
![]()
Play Random Track of Next Playlist
tell application "iTunes" if player state is playing then set last_p to (index of last user playlist) set this_p to index of current playlist if this_p is not last_p then my play_this(this_p + 1) else my play_this(1) end if end if end tell to play_this(i) tell application "iTunes" set view of front browser window to playlist i -- un-comment to shuffle the playlist first (* repeat 5 times set shuffle of playlist i to false set shuffle of playlist i to true end repeat *) play some track of playlist i end tell end play_this
![]()
Play Random Track of Random Playlist
tell application "iTunes" if player state is playing then set last_p to (index of last user playlist) my play_this(random number from 1 to last_p) end if end tell to play_this(i) tell application "iTunes" set view of front browser window to playlist i -- un-comment to shuffle the playlist first (* repeat 5 times set shuffle of playlist i to false set shuffle of playlist i to true end repeat *) play some track of playlist i end tell end play_this
![]()
De-Shuffle All Playlists
Turns "Shuffle" off for every playlist.
tell application "iTunes" repeat with i from 1 to (index of last playlist) try set shuffle of playlist i to false end try end repeat end tell
![]()
Choose Playlist
from Jason Kacmarski
tell application "iTunes" set matchFound to false set hasList to {} set myPlaylist to the text returned of ¬ (display dialog "Enter a Playlist Name" default answer "" default button 2) set allPlaylists to name of playlists repeat with thisPlaylist in allPlaylists if thisPlaylist is myPlaylist then set matchFound to true exit repeat else if thisPlaylist contains myPlaylist then set end of hasList to thisPlaylist end if end if end repeat if not matchFound then if length of hasList is 0 then display dialog "No matching playlist was found." else if length of hasList is 1 then set thisPlaylist to hasList as string else set thisPlaylist to (choose from list hasList ¬ with prompt "The following playlists contain " & ¬ myPlaylist without empty selection allowed) if thisPlaylist is false then return end if end if try set view of browser window 1 to playlist thisPlaylist play track 1 of playlist thisPlaylist end try end tell
![]()
Skip Ahead n Seconds
Change the "differential" property to the number of seconds you want the current track to skip ahead to. Useful for skipping over commercials and what not. Works great when assigned a shortcut.
property differential : 120 -- seconds tell application "iTunes" if current track exists then if player position is greater than start of current track ¬ and player position is less than ((finish of current track) - differential) then set player position to (player position + differential) end if end if end tell
![]()
Update iPod Songs
(Not effective if iPod Options are set to "Manually manage songs and playlists".)
from Jason Kacmarski
tell application "iTunes" set mySource to some source whose name contains "iPod" update mySource end tell
![]()
Open iTunes Scripts Folder
The two variations below will open the iTunes Scripts folder and make it frontmost.
tell application "Finder" open folder (((path to "dlib" from user domain) as string) & "iTunes:Scripts") as alias activate end tell
![]()
tell application "Finder" open folder ((path to home folder as string) & "Library:iTunes:Scripts") activate end tell
![]()
Go To Doug's With Safari
from Brian Purnell
tell application "Safari" activate if URL of document 1 does not contain "dougscripts" then make new document at beginning of documents end if set the URL of document 1 to "http://dougscripts.com/itunes/" end tell
![]()
Toggle Check Marks of Selected Tracks
tell application "iTunes" set sel to selection if sel is not {} then repeat with aTrack in sel tell aTrack try set enabled to not (get enabled) end try end tell end repeat end if end tell
![]()
Search Results To New Playlist
iTunes 4.5 or better
tell application "iTunes" set searchString to text returned of (display dialog "Enter text to search for:" default answer "" default button 2) set searchResult to search library playlist 1 for searchString if searchResult is not {} then set newPlaylist to (make playlist with properties {name:searchString}) repeat with t in searchResult duplicate t to newPlaylist end repeat set view of front browser window to newPlaylist else display dialog "No result." buttons {"Cancel"} default button 1 end if end tell
![]()
Skip & Pretend We Played This
Increment the Play Count of the currently playing track and set its Last Played Date to "now", and, irregardless of acomplishing that, advance to the next track in the current playlist. (I have a Smart Playlist that live updates to tracks not played in the last 8 weeks. If a song from it is playing that I don't want to hear again for another 8 weeks, I run this script while it's playing, it leaves the Smart Playlist, and the next song plays.)
tell application "iTunes" if player state is not stopped then try tell current track set played count to (get played count) + 1 set played date to (get current date) end tell end try next track end if end tell
![]()
Pretend We Played This Today
Select one or more tracks; increases each track's played count and sets its last played date to "now". (I have a Smart Playlist that live updates to tracks not played in the last 8 weeks. If I see some songs I don't want in the playlist, I run this script on 'em.)
tell application "iTunes"
if selection is not {} then
set sel to selection
repeat with cur in sel
if class of cur is file track then
tell cur
set played count to (get played count) + 1
set played date to (get current date)
end tell
end if
end repeat
end if
end tell
Refresh Live-Updating Smart Playlist
Remove all the tracks from the selected playlist. It must be a Smart Playlist. Use carefully: there is no way to check for "Live Updating".
tell application "iTunes" set lib to view of front browser window if class of lib is user playlist and smart of lib then display dialog "Remove all tracks from this playlist?" default button 2 ¬ buttons {"Cancel", "Proceed..."} delete every file track of lib end if end tell end
![]()
Super Shuffle
Select a playlist in the Source column and run this script to super-shuffle the tracks. For more super-ness, change the 7 in "repeat 7 times" to as large a number as you can stand. (Strangely, "Party Shuffle" is impervious to shufflin'.)
tell application "iTunes" tell view of front browser window if name is not "Party Shuffle" then repeat 7 times set shuffle to false set shuffle to true end repeat end if end tell end tell
![]()
Super Shuffle Plus
Like the script above, will "Super Shuffle" the selected Playlist, then select a random track to initiate playing the playlist.
tell application "iTunes" set myPlaylist to view of front window stop tell myPlaylist repeat 7 times set shuffle to false set shuffle to true end repeat end tell play some track of myPlaylist end tell
![]()
Current Track to (Select Playlist)
tell application "iTunes" if player state is not stopped then set cur_track to current track with timeout of 300 seconds -- comment out one or the other by placing "--" in front of the line: -- use for pre-iTunes 4.9 set the_playlist to ((choose from list (get name of every user playlist whose smart is false and ¬ name is not "Party Shuffle" and name is not "Purchased Music") with prompt "Copy \"" & (name of cur_track) & ¬ "\" to..." OK button name "This Playlist" without multiple selections allowed) as string) -- use for iTunes 4.9 and later set the_playlist to ((choose from list (get name of every user playlist whose smart is false and ¬ special kind is none) with prompt "Copy \"" & (name of cur_track) & ¬ "\" to..." OK button name "This Playlist" without multiple selections allowed) as string) if the_playlist is "false" then return else set the_playlist to playlist the_playlist end if end timeout try if not (exists (some track of the_playlist whose database ID is (get cur_track's database ID))) then ¬ duplicate cur_track to the_playlist end try end if end tell
![]()
Selected Tracks to (Select Playlist)
tell application "iTunes"
if selection is not {} then
set sel to selection
-- comment out one or the other by placing "--" in front of the line:
-- use for pre-iTunes 4.9
set the_playlist to ((choose from list (get name of every user playlist whose smart is false and ¬
name is not "Party Shuffle" and name is not "Purchased Music") with prompt ¬
"Copy selected tracks to..." OK button name "This Playlist" without multiple selections allowed) as string)
-- use for iTunes 4.9 and later
set the_playlist to ((choose from list (get name of every user playlist whose smart is false and ¬
special kind is none) with prompt ¬
"Copy selected tracks to..." OK button name "This Playlist" without multiple selections allowed) as string)
if the_playlist is "false" then
return
else
set the_playlist to playlist the_playlist
end if
with timeout of 30000 seconds
repeat with this_track in sel
try
if not (exists (some track of the_playlist whose database ID is (get this_track's database ID))) then ¬
duplicate this_track to the_playlist
end try
end repeat
end timeout
try
if button returned of (display dialog "Done" buttons {"Select " & (name of the_playlist), "Thanks"} default button 2 ¬
giving up after 15) starts with "sel" then set view of front browser window to the_playlist
end try
else
display dialog "No tracks selected..." buttons {"Cancel"} default button 1 with icon 2 giving up after 15
end if
end tell
Scripts Posted For Download
Links will take you to the script's description and download page.
- AMG EZ Search
Search All Music Guide in Safari with data from selected or playing track - Artist - Name Corrector
Correct song titles listed as "Artist - Song Name" - Display Sundry File Info
Display various info about the file of a selected track - Downstream
Remove streams from main library to selected playlist - Google Lyric Search
Search for lyric sites with Google using info from the current or selected track - Import and Eject
Import enabled CD tracks and automatically eject CD when finished - Import iPod Audio Files
Select any type of iPod music files in iTunes and import them to your Music folder - iPod Space
Reports free space in iPod - Where Is This?
Displays file path and file name of current track - Make Bookmarkable
Change file type to make selected AACs bookmarkable - New iPod Playlist From Selection
Copy selected tracks to a new user-named iPod playlist - Quick Convert
Convert or import tracks with any encoder on the fly - Replay Last Bit
Replay current track from last few seconds - Save Artwork To Folder
Save artwork of a selected track as PNG or JPG - Search iTunes Music Store for Current
Search the iTunes Store with criteria from currently playing track - Show Current Track's Playlists
Choose box lists all playlists containing current track - time and space
Display total size and time of selected tracks - Whack Current Track
Deletes the current track from all playlists and moves to Trash - What Are People Listening 2?
List songs in your shared library being heard by others