RSS Feedings
What's New...
30 Most Recent
dougscrptr
Site Menu
[ Home
[ What's New
[ 446 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 List
[ Download FAQ...
[ Forum at iLounge
[ dougscrptr
[ Twitter
[ my delicious
[ Uhm, Windows?
Shareware Apps
- Dupin v1.3.4
- Join Together v5.3.1
- iTunes Library Manager v5.1
Site Info
- Who's Doug?
10 Most Recently Added:
Links point to a script's entry page...
- 3 days ago:
Rip To iPod v2.1
Rips CD tracks straight to iPod - 3 days ago:
New iPod Playlist From Selection v3.1
Copy selected tracks or playlist to a new iPod playlist - 3 days ago:
Lossless to AAC Workflow v2.1
Two scripts assist with importing/managing Lossless files and sending converted AAC copies to iPod - 7 days ago:
Update Expired Podcasts v2.0
Update podcasts which have expired by virtue of being ignored for five or more days - 7 days ago:
Add from Amazon MP3 Folder v1.0
Add files from the Amazon MP3 downloads folder to iTunes - 7 days ago:
Add from eMusic Downloads Folder v1.0
Add files from the eMusic downloads folder to iTunes - 11 days ago:
GET Available Podcast Episodes v2.0
Download any or all available subscribed Podcast episodes not yet downloaded - 13 days ago:
Make Video Tags v1.2
Application assists with batch-editing video track tags - 13 days ago:
Clipboard to Multi-Tracks Lyrics v1.0
Paste text contents of the clipboard to each of the selected tracks' Lyrics tag - 14 days ago:
Make Bookmarkable v2.5
Change file type to make selected AACs bookmarkable - 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 [120513]
- Super Remove Dead Tracks [99799]
- Find Album Artwork with Google [77705]
- Corral iTunes Dupes [66421]
- Import iPod Audio Files [62259]
- CDDB Safari Kit [39587]
- Tracks Without Artwork to Playlist [37704]
- Remove Duplicate Tracks From Playlist [34743]
- Corral All Dupes [29047]
- Set Video Kind of Selected [25449]
- Remove n Characters From Front or Back [24605]
- 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...
- addToLib Add files to iTunes from any folder
(Managing Files) - Strip Stuff From Tracks Remove unwanted characters from track names
(Managing Track Info) - TuneSpy Logs playing tracks
(Managing Playlists) - CD Text to CD Info Import CD Text data to selected CD's disc and track tags
(Managing Track Info) - Move En|Dis-Abled Moves enabled or disabled tracks to a new playlist.
(Managing Tracks) - Current Song to Current Chat Send info about the current track to front message window in iChat
(With Other Apps) - Rip This Where I Want It Rip CD tracks on the fly, but don't add to iTunes
(Controlling iTunes) - Unique To This iPod Playlist Create a new iPod playlist of tracks not assigned to other playlists
(iPod) - Update Expired Podcasts Update podcasts which have expired by virtue of being ignored for five or more days
(Controlling iTunes) - CDDB Safari Kit Search for info and get track names from Gracenote web pages using Safari
(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 list is still growing. Send your suggestions.
View Master Libraries ("Music", "Movies", "TV Shows", and so on)
Before iTunes 7, you could select the entire single library (named "Library") listing all tracks. Now, of course, iTunes manages tracks by kind in Master Libraries. These scripts will select the respective Master Library without having to click on it in the Source pane. Note that by not using the actual name of the Master Library and instead using the playlist's special kind property, localization problems are averted.
-- select "Music" playlist tell application "iTunes" set view of front browser window to (get some playlist whose special kind is Music) end tell
![]()
-- select "Movies" playlist tell application "iTunes" set view of front browser window to (get some playlist whose special kind is Movies) end tell
![]()
-- select "TV Shows" playlist tell application "iTunes" set view of front browser window to (get some playlist whose special kind is TV Shows) end tell
![]()
-- select "Podcasts" playlist tell application "iTunes" set view of front browser window to (get some playlist whose special kind is Podcasts) end tell
![]()
-- select "Audiobooks" playlist tell application "iTunes" set view of front browser window to (get some playlist whose special kind is Audiobooks) end tell
![]()
View Party Shuffle
Same as above but selects the "Party Shuffle" Playlist.
-- select "Part Shuffle" playlist tell application "iTunes" set view of front browser window to (get some playlist whose special kind is Party Shuffle) end tell
![]()
View Current Playlist
Selects the playlist containing currently playing track. Same as Command-L without current track being selected.
tell application "iTunes" if player state is not stopped then set view of front browser window to (get current playlist) end if end tell
![]()
Show Get Info Window of a Track's File
Select a track and run this script to display its file's Get Info window in the Finder.
tell application "iTunes" set sel to selection if sel is not {} and length of sel is 1 then my openInfo(get location of item 1 of sel) end if end tell to openInfo(l) try tell application "Finder" open the information window of l activate end tell end try end openInfo
![]()
Append Track Count to Playlist Name
The name of the selected Playlist will be changed to something like "90s Music [107]"
tell application "iTunes" tell view of front browser window if special kind is none then set name to (get name & " [" & (count tracks) & "]") end if end tell 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
Displays a list of user playlists from which you select those you want to delete.
tell application "iTunes" set listOfPlaylists to (get name of user playlists whose special kind is none) set deleteThese to (choose from list listOfPlaylists as list ¬ with prompt "Select Playlists to delete..." with multiple selections allowed) if deleteThese is false then return -- operation canceled repeat with thisPlaylist in deleteThese try delete playlist thisPlaylist end try end repeat 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
Reset Start and Stop Times
Set the Start and Stop times to their default.
tell application "iTunes" set sel to selection if sel is not {} then repeat with t in sel tell t try set {start, finish} to {0, -1} end try end tell 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