RSS Feedings
What's New...
30 Most Recent
dougscrptr
Site Menu
[ Home
[ What's New
[ 450 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
[ Tumblr: dougscrptr
[ Twitter: DougScripts
[ my delicious
[ Uhm, Windows?
Shareware Apps
- Dupin v1.4.2
- Join Together v5.3.2
- iTunes Library Manager v5.2.1
Site Info
- Who's Doug?
10 Most Recently Added:
Links point to a script's entry page...
- UPDATED today:
Gather Up the One-Hits v2.3 Copy iTunes "one-track wonders" to their own playlist - NEW today:
All HD/SD to Playlist v1.0 Two scripts create discrete playlists of all HD or all SD videos - NEW 4 days ago:
Change Hidden iTunes Preferences v1.0 Change the settings of hidden iTunes preferences - UPDATED December 11, 2008:
Add from Amazon MP3 Folder v1.1 Add files from the Amazon MP3 downloads folder to iTunes - UPDATED December 11, 2008:
Add from eMusic Downloads Folder v1.1 Add files from the eMusic downloads folder to iTunes - UPDATED December 4, 2008:
Search Amazon UK MP3 v1.0 Search Amazon UK's MP3 website using terms from selected iTunes track - UPDATED December 3, 2008:
Reset Bookmarks to Start v2.0 Reset selected tracks' bookmark position to their Start Time - NEW December 3, 2008:
Reset Tracks Start-Stop v1.0 Batch-reset the Start and Stop Time of selected tracks to their entire duration - UPDATED October 6, 2008:
Quick Convert v2.9 Convert or import tracks with any encoder on the fly - UPDATED August 20, 2008:
New iPod Playlist From Selection v3.2 Copy selected tracks or playlist to a new iPod playlist - 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 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 [134511]
- Super Remove Dead Tracks [118140]
- Find Album Artwork with Google [84659]
- Corral iTunes Dupes [72787]
- Import iPod Audio Files [66155]
- Tracks Without Artwork to Playlist [45808]
- CDDB Safari Kit [42669]
- Remove Duplicate Tracks From Playlist [33500]
- Corral All Dupes [31389]
- Set Video Kind of Selected [29989]
- Remove n Characters From Front or Back [28936]
- 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...
- Downstream Remove streams from main library to selected playlist
(Managing Tracks) - NOT Part of a Compilation Change compilation setting of Album tracks whose Artist is the same
(Managing Files) - Backup Selection/Playlist to MP3 CD Organize files for burning to MP3-CD
(Managing Files) - Drop to Add 'n' Make Playlists Droplet/applet adds files, creates playlists based on artist-album or folder name
(Managing Playlists) - Batch-Delete Playlists Delete several playlists at once in either iTunes or iPod
(Managing Playlists) - iTunes Track CPR Re-associate MIA tracks (!) with existing files
(Managing Files) - Transfer Bookmark and Play Transfer bookmark point between selected iPod track and corresponding library track, or visa versa
(Managing Tracks) - Add Selected Tracks to iPod and Backup Copy selected tracks to iPod and to a designated backup playlist
(iPod) - Wrangle Same-Named Tracks Assist with discovering and eliminating same-named tracks
(Managing Tracks) - Lossless to AAC Workflow Two scripts assist with importing/managing Lossless files and sending converted AAC copies to iPod
(Managing Files)
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
Set Skipped Count/Skipped Date
iTunes will only increase a track's skipped count if it is skipped during the first 2 to 20 seconds of play. This script will correctly set the skipped count and skipped date no matter when and advance to the next track.
tell application "iTunes" if player state is not stopped then set theTrack to current track set oldSkipCount to (get skipped count of theTrack) next track tell theTrack if (get skipped count) = oldSkipCount then try set skipped count to (get skipped count + 1) set skipped date to (get current date) end try end if end tell 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
![]()
12 Second Fade/Stop and Next Track
Run to initiate a 12 second fade-to-stop of the current playing track and then play the next track
tell application "iTunes" if player state is playing then set stoVO to get sound volume set diff to (stoVO / 12) repeat set sv to (get sound volume) set sub to (sv - diff) if (sub is less than or equal to 3) then copy 0 to sound volume exit repeat end if copy sub to sound volume delay 1 end repeat stop copy stoVO to sound volume next track play end if end tell
![]()
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