<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Doug&#039;s AppleScripts for iTunes &#187; Managing Tracks</title>
	<atom:link href="http://dougscripts.com/itunes/category/managing-tracks/feed/" rel="self" type="application/rss+xml" />
	<link>http://dougscripts.com</link>
	<description>AppleScripts for iTunes</description>
	<lastBuildDate>Sun, 13 May 2012 13:40:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='dougscripts.com' port='80' path='/itunes/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>UPDATED: Track Down Purchases v2.0</title>
		<link>http://dougscripts.com/itunes/2011/10/updated-track-down-purchases-v2-0/</link>
		<comments></comments>
		<pubDate>Thu, 20 Oct 2011 14:23:05 +0000</pubDate>
		<dc:creator>dougscripts</dc:creator>
				<category><![CDATA[Cocoa-AppleScript]]></category>
		<category><![CDATA[Managing Tracks]]></category>

		<guid isPermaLink="false">http://dougscripts.com/itunes/?p=1390</guid>
		<description><![CDATA[If you have been making purchases from the iTunes Store using several names or account names then maybe you&#8217;ll have noticed that there&#8217;s no easy way to sort purchased tracks by the name or account name used to make the purchase. Oh, wait a minute. Yes there is.
Track Down Purchases v2.0 will examine each track [...]]]></description>
			<content:encoded><![CDATA[<p>If you have been making purchases from the iTunes Store using several names or account names then maybe you&#8217;ll have noticed that there&#8217;s no easy way to sort purchased tracks by the name or account name used to make the purchase. Oh, wait a minute. Yes there is.</p>
<p><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=trackdownpurchases" title="Sort purchased tracks into discrete playlists by name or account">Track Down Purchases</a> v2.0 will examine each track in your entire iTunes library&#8212;or a selection of tracks&#8212;for items purchased from the iTunes Store (audio, video, and books) and then sort them by either the purchaser&#8217;s name (the &#8220;Purchased by&#8221; entry in a track&#8217;s Get Info Summary tab) or account (&#8221;Account Name&#8221;) into discrete playlists.</p>
<p><img src="http://dougscripts.com/itunes/pix/trackdownpurchases.png" /></p>
<p>This latest version is written as a Cocoa-AppleScript applet for OS 10.6 or 10.7 only, adds the ability to sort by account name, and provides a progress indicator. (My thanks to Correspondent Andrew Wynn Rouse for inventing the account name search portion.)</p>
<hr/><small><a href="http://dougscripts.com/itunes/dougsupdated.rss" title="Take me to your reader">30 Most Recent RSS Feed</a> | <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Script Stats Page</a> by <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Name</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Most Recent&op=y">Most Recent</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Download Count&op=y">Download Count</a></small>]]></content:encoded>
			</item>
		<item>
		<title>UPDATED: Remove n Characters from Front or Back v4.0</title>
		<link>http://dougscripts.com/itunes/2011/07/updated-remove-n-characters-from-front-or-back-v4-0/</link>
		<comments></comments>
		<pubDate>Mon, 25 Jul 2011 15:43:46 +0000</pubDate>
		<dc:creator>dougscripts</dc:creator>
				<category><![CDATA[Cocoa-AppleScript]]></category>
		<category><![CDATA[Managing Tracks]]></category>
		<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://dougscripts.com/itunes/?p=1320</guid>
		<description><![CDATA[Remove n Characters From Front or Back v4.0 helps you delete a specified number of characters from either the beginning or the ending of the Song Name, Album, Artist, Comments, Composer or Show tag (or their &#8220;Sort&#8221; siblings) of each selected track. For example, delete the initial digits and the space from &#8220;01 First Track&#8221;, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=removenchars" title="Delete characters from the beginning or ending of selected tracks' name, artist, album, comments, composer, or show tags">Remove n Characters From Front or Back</a> v4.0 helps you delete a specified number of characters from either the beginning <em>or</em> the ending of the Song Name, Album, Artist, Comments, Composer or Show tag (or their &#8220;Sort&#8221; siblings) of each selected track. For example, delete the initial digits and the space from &#8220;01 First Track&#8221;, &#8220;02 Second Track&#8221;, and so on.</p>
<p><img src="http://dougscripts.com/itunes/pix/removenchars.png" /></p>
<p>This latest version is written as a Cocoa-AppleScript Applet and can only run in OS X 10.6 or 10.7. As you can see from the pic above, it consolidates all settings into a single window and provides an example that is updated as the settings are changed. Text between the arrows would be removed.</p>
<hr/><small><a href="http://dougscripts.com/itunes/dougsupdated.rss" title="Take me to your reader">30 Most Recent RSS Feed</a> | <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Script Stats Page</a> by <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Name</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Most Recent&op=y">Most Recent</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Download Count&op=y">Download Count</a></small>]]></content:encoded>
			</item>
		<item>
		<title>Get a Track Reference from a File Path</title>
		<link>http://dougscripts.com/itunes/2010/12/get-a-track-reference-from-a-file-path/</link>
		<comments></comments>
		<pubDate>Tue, 28 Dec 2010 17:19:14 +0000</pubDate>
		<dc:creator>dougscripts</dc:creator>
				<category><![CDATA[Managing Files]]></category>
		<category><![CDATA[Managing Tracks]]></category>

		<guid isPermaLink="false">http://dougscripts.com/itunes/?p=1184</guid>
		<description><![CDATA[Correspondent Wayne B. recently wondered if there is a way to get a reference to a track in iTunes based on its file path. Well, unfortunately, you can&#8217;t do something like this:

tell application "iTunes"
	set trackRef  to (get some file track of library playlist 1 whose location is "some/file/path.ext")
end tell

That will generate an error. But [...]]]></description>
			<content:encoded><![CDATA[<p>Correspondent Wayne B. recently wondered if there is a way to get a reference to a track in iTunes based on its file path. Well, unfortunately, you <em>can&#8217;t</em> do something like this:</p>
<pre style="margin-bottom:1em;">
<span style="color:blue;"><b>tell</b></span> <span style="color:blue;">application</span> "iTunes"
	<span style="color:blue;"><b>set</b></span> <span style="color:green;">trackRef </span> <span style="color:blue;"><b>to</b></span> (<span style="color:blue;"><b>get</b></span> <span style="color:blue;"><b>some</b></span> <span style="color:blue;">file</span> <span style="color:blue;">track</span> <span style="color:blue;"><b>of</b></span> <span style="color:blue;">library</span> <span style="color:blue;">playlist</span> 1 <span style="color:blue;"><b>whose</b></span> <span style="color:blue;">location</span> <span style="color:blue;"><b>is</b></span> "some/file/path.ext")
<span style="color:blue;"><b>end</b></span> <span style="color:blue;"><b>tell</b></span>
</pre>
<p>That will generate an error. But you can trick iTunes into giving you the track reference by using the <strong>add</strong> command&#8211;if you are certain the file is already in iTunes&#8217; database. When you <strong>add</strong> the file iTunes will check its database for the the corresponding library track <em>for you</em> and if it exists will give up the reference&#8211;and it <em>won&#8217;t</em> re-add it:</p>
<pre style="margin-bottom:1em;">
<b>set</b> <span style="color:green;">theFile</span> <b>to</b> choose file
<span style="color:gray;">--</span> <span style="color:gray;">or</span> <span style="color:gray;">however</span> <span style="color:gray;">you</span> <span style="color:gray;">get</span> <span style="color:gray;">the</span> <span style="color:gray;">file</span> <span style="color:gray;">path</span>

<b>tell</b> <span style="color:blue;">application</span> "iTunes"
	<b>try</b>
		<b>set</b> <span style="color:green;">trackRef</span> <b>to</b> (<span style="color:blue;"><b>add</b></span> <span style="color:green;">theFile</span> <b>as</b> <span style="color:blue;">alias</span>)
		<b>tell</b> <span style="color:green;">trackRef</span>
			<span style="color:blue;"><b>log</b></span> (<b>get</b> <span style="color:purple;">name</span>)
			<span style="color:gray;">#</span> <span style="color:gray;">and</span> <span style="color:gray;">so</span> <span style="color:gray;">on</span>...
		<b>end</b> <b>tell</b>
	<b>end</b> <b>try</b>
<b>end</b> <b>tell</b>

<a href="applescript://com.apple.scripteditor?action=new&#038;script=set theFile to choose file%0D-- or however you get the file path%0D%0Dtell application %22iTunes%22%0D%09try%0D%09%09set trackRef to %28add theFile as alias%29%0D%09%09tell trackRef%0D%09%09%09log %28get name%29%0D%09%09%09%23 and so on%2E%2E%2E%0D%09%09end tell%0D%09end try%0Dend tell" title="Click to open in AppleScript Editor. Works via most modern Mac browsers."><img src="http://dougscripts.com/itunes/pix/clickscriptsmall.jpg" alt="" /></a>
</pre>
<p>But remember that if the file <em>isn&#8217;t</em> already in iTunes&#8217; database then iTunes will add the file as a matter of course, <em>which may not be what you want</em>. So this trick may work best only when you know a file is currently in your library.</p>
<p>You will not want to use the <strong>open</strong> command instead of <strong>add</strong>, because <strong>open</strong> will compel iTunes to play the file in addition to any <strong>add</strong>-housekeeping.</p>
<hr/><small><a href="http://dougscripts.com/itunes/dougsupdated.rss" title="Take me to your reader">30 Most Recent RSS Feed</a> | <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Script Stats Page</a> by <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Name</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Most Recent&op=y">Most Recent</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Download Count&op=y">Download Count</a></small>]]></content:encoded>
			</item>
		<item>
		<title>Library Benefits</title>
		<link>http://dougscripts.com/itunes/2010/11/library-benefits/</link>
		<comments></comments>
		<pubDate>Mon, 29 Nov 2010 14:49:20 +0000</pubDate>
		<dc:creator>dougscripts</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Managing Tracks]]></category>

		<guid isPermaLink="false">http://dougscripts.com/itunes/?p=1176</guid>
		<description><![CDATA[A Correspondent observes that PDFs and digital booklets are no longer lodged in the &#8220;Music&#8221; library but in the &#8220;Books&#8221; library. Thus he laments that he is unable to access these books alongside the music tracks while browsing the &#8220;Music&#8221; library. While book-type tracks and music tracks can reside in the same playlist, yes, they [...]]]></description>
			<content:encoded><![CDATA[<p>A Correspondent observes that PDFs and digital booklets are no longer lodged in the &#8220;Music&#8221; library but in the &#8220;Books&#8221; library. Thus he laments that he is unable to access these books alongside the music tracks while browsing the &#8220;Music&#8221; library. While book-type tracks and music tracks can reside in the same playlist, yes, they do belong to different libraries. But creating a separate playlist for every album with a PDF or digital booklet doesn&#8217;t seem very efficient.</p>
<p>I used <a href="http://dougscripts.com/itunes/scripts/ss.php?sp=changehiddenprefs" title="Change the settings of hidden iTunes preferences">Change Hidden iTunes Preferences</a> to toggle the visibility of the &#8220;Library&#8221; library playlist. In the pic below it is listed atop the other library playlists. In the old days, this was <em>the</em> main library playlist and listed everything in the library. Well, it still does. When the &#8220;Library&#8221; is available, you can use the Column Browser to access an entire Album, which will include any associated booklet (providing the Artist/Album tags correspond correctly):</p>
<div style="text-align:center;border:0;"><img src="http://dougscripts.com/itunes/pix/librarybenefits.png" /></div>
<p>(The yellow highlight over the booklet is an <em>artistic representation</em>.)</p>
<hr/><small><a href="http://dougscripts.com/itunes/dougsupdated.rss" title="Take me to your reader">30 Most Recent RSS Feed</a> | <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Script Stats Page</a> by <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Name</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Most Recent&op=y">Most Recent</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Download Count&op=y">Download Count</a></small>]]></content:encoded>
			</item>
		<item>
		<title>NEW: Report Real Play Time</title>
		<link>http://dougscripts.com/itunes/2010/06/new-report-real-play-time/</link>
		<comments></comments>
		<pubDate>Thu, 10 Jun 2010 18:03:07 +0000</pubDate>
		<dc:creator>dougscripts</dc:creator>
				<category><![CDATA[Managing Tracks]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://dougscripts.com/itunes/?p=1015</guid>
		<description><![CDATA[Correspondent Jamie Shaw sent me a version of a script that calculates the play time of selected tracks or tracks in a playlist when the user-set Start and Stop times are also accounted for. In such cases, the total play time (for a playlist) would be shorter than what is displayed along the bottom of [...]]]></description>
			<content:encoded><![CDATA[<p>Correspondent Jamie Shaw sent me a version of a script that calculates the play time of selected tracks or tracks in a playlist when the user-set Start and Stop times are also accounted for. In such cases, the total play time (for a playlist) would be shorter than what is displayed along the bottom of the playlist. I threw in a routine that lets you enter your Crossfade time (not really accessible programatically) and this is also part of the calculation. <a href="http://dougscripts.com/itunes/scripts/ss.php?sp=reportrealplaytime" title="Calculate total playing time considering tracks' start, finish, and crossfade times">Report Real Play Time</a> works especially nice when assigned a <a href="http://dougscripts.com/itunes/itinfo/shortcutkeys.php">keyboard shortcut</a>.</p>
<hr/><small><a href="http://dougscripts.com/itunes/dougsupdated.rss" title="Take me to your reader">30 Most Recent RSS Feed</a> | <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Script Stats Page</a> by <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Name</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Most Recent&op=y">Most Recent</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Download Count&op=y">Download Count</a></small>]]></content:encoded>
			</item>
		<item>
		<title>NEW: Mark All Episodes As Played</title>
		<link>http://dougscripts.com/itunes/2010/04/new-mark-all-episodes-as-played/</link>
		<comments></comments>
		<pubDate>Sun, 11 Apr 2010 15:03:57 +0000</pubDate>
		<dc:creator>dougscripts</dc:creator>
				<category><![CDATA[Managing Tracks]]></category>
		<category><![CDATA[Podcasts]]></category>

		<guid isPermaLink="false">http://dougscripts.com/itunes/?p=995</guid>
		<description><![CDATA[A Correspondent bemoaned the loss of the &#8220;Mark as&#8230;&#8221; contextual menu item when control-clicking a Podcast library subscription title while in List View. I wouldn&#8217;t have noticed that in a million years. Still, it&#8217;s an expulsion only slightly more arcane than doing away with my beloved Mute button, so I was sympathetic, and produced Mark [...]]]></description>
			<content:encoded><![CDATA[<p>A Correspondent bemoaned the loss of the &#8220;Mark as&#8230;&#8221; contextual menu item when control-clicking a Podcast library subscription title while in List View. I wouldn&#8217;t have noticed that in a million years. Still, it&#8217;s an expulsion only slightly more arcane than doing away with my beloved <a href="http://dougscripts.com/itunes/2010/04/no-more-mute/">Mute button</a>, so I was sympathetic, and produced <a href="http://dougscripts.com/itunes/scripts/ss.php?sp=markallasplayed" title="Mark each episode in a podcast subscription as Played or Watched">Mark All Episodes As Played</a>. While the Podcast library is in List View, select any one (or more) episode(s) of a podcast <strong>or</strong> its subscription title and run this script to mark every episode of the podcast as Played (or Watched). Works great when assigned a <a href="http://dougscripts.com/itunes/itinfo/shortcutkeys.php">shortcut</a>. </p>
<hr/><small><a href="http://dougscripts.com/itunes/dougsupdated.rss" title="Take me to your reader">30 Most Recent RSS Feed</a> | <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Script Stats Page</a> by <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Name</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Most Recent&op=y">Most Recent</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Download Count&op=y">Download Count</a></small>]]></content:encoded>
			</item>
		<item>
		<title>Updated a Handful</title>
		<link>http://dougscripts.com/itunes/2009/08/updated-a-handful/</link>
		<comments></comments>
		<pubDate>Fri, 28 Aug 2009 18:56:00 +0000</pubDate>
		<dc:creator>dougscripts</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Exporting Info]]></category>
		<category><![CDATA[Managing Playlists]]></category>
		<category><![CDATA[Managing Track Info]]></category>
		<category><![CDATA[Managing Tracks]]></category>
		<category><![CDATA[None/All Bug]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://dougscripts.com/itunes/wpfol/?p=6</guid>
		<description><![CDATA[Nothing to do with Snow Leopard&#8211;what a relief, eh? I&#8217;ve updated seven scripts today:

Assimilate View Options
Batch-Delete Playlists
Block Party!
Compare Two Playlists
Export Smart Playlist Criteria
Move Playlists to Folder
Selected Playlists To iPod

These seem to be the most popular scripts that are affected by the &#8220;none/all&#8221; issue introduced in iTunes 8.2. There may be a few others, but I [...]]]></description>
			<content:encoded><![CDATA[<p>Nothing to do with Snow Leopard&#8211;what a relief, eh? I&#8217;ve updated seven scripts today:</p>
<ul>
<li><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=assimilateviewoptions" title="Recreate a playlist such that its view options mirror the Music library">Assimilate View Options</a></li>
<li><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=batchdeleteplaylists" title="Delete several playlists at once in either iTunes or iPod">Batch-Delete Playlists</a></li>
<li><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=blockparty" title="Create a Block Party! playlist of random Artists and specific number of their random songs to be played in a row">Block Party!</a></li>
<li><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=comparetwoplaylists" title="Create text file listing tracks common to and exclusive to two playlists">Compare Two Playlists</a></li>
<li><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=exportsmartcriteria" title="Export just the criteria of Smart Playlist(s) to XML, import later">Export Smart Playlist Criteria</a></li>
<li><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=moveplaylisttofolder" title="Move selected playlists to a new or existing folder">Move Playlists to Folder</a></li>
<li><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=selectedplayliststoipod" title="Copy multiple playlists from iTunes to iPod">Selected Playlists To iPod</a></li>
</ul>
<p>These seem to be the most popular scripts that are affected by the <a href="http://dougscripts.com/itunes/itinfo/noneallissue.php">&#8220;none/all&#8221; issue</a> introduced in iTunes 8.2. There may be a few others, but I haven&#8217;t gotten email feedback on those nor have I run across a problem with any other scripts I use regularly. But if you ever get a error like this:</p>
<p style="text-align:center;overflow: hidden;"><img src="http://dougscripts.com/itunes/pix/noneallerror.png" border="0"  alt="" /></p>
<p>&#8230;then let me know.</p>
<hr/><small><a href="http://dougscripts.com/itunes/dougsupdated.rss" title="Take me to your reader">30 Most Recent RSS Feed</a> | <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Script Stats Page</a> by <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Name</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Most Recent&op=y">Most Recent</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Download Count&op=y">Download Count</a></small>]]></content:encoded>
			</item>
		<item>
		<title>Re-Posting Stream Startup Script</title>
		<link>http://dougscripts.com/itunes/2009/08/re-posting-stream-startup-script/</link>
		<comments></comments>
		<pubDate>Tue, 11 Aug 2009 14:44:05 +0000</pubDate>
		<dc:creator>dougscripts</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Managing Tracks]]></category>
		<category><![CDATA[Missing Menu Commands]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://dougscripts.com/itunes/wpfol/?p=22</guid>
		<description><![CDATA[A couple few days ago I posted a script here that would ping the Radio Paradise stream until its server accepted the connection, suppressing the error dialog that would appear when a connection was denied. Well, that was the wrong version of the script. Here is the correct version, and the one I fire up [...]]]></description>
			<content:encoded><![CDATA[<p>A couple few days ago I posted a script here that would ping the Radio Paradise stream until its server accepted the connection, suppressing the error dialog that would appear when a connection was denied. Well, that was the wrong version of the script. Here is the correct version, and the one I fire up every morning. You must select a radio stream track <em>first</em>, <em>then</em> run the script:</p>
<pre style="margin-bottom:1em;">
<b>tell</b> application "iTunes"
	<b>if</b> selection <b>is</b> {} <b>then</b> <b>return</b>
	<b>set</b> <span style="color:blue;">strm</span> <b>to</b> (item 1 <b>of</b> selection)
	<b>if</b> (<b>get</b> class <b>of</b> <span style="color:blue;">strm</span>) <b>is</b> <b>not</b> URL track <b>then</b> <b>return</b>
	<b>repeat</b>
		<b>try</b>
			play <span style="color:blue;">strm</span>
			<b>exit</b> <b>repeat</b>
		<b>on</b> <b>error</b> <span style="color:blue;">m</span> number <span style="color:blue;">n</span>
			delay 15
		<b>end</b> <b>try</b>
	<b>end</b> <b>repeat</b>
<b>end</b> <b>tell</b>

<a href="applescript://com.apple.scripteditor?action=new&#038;script=tell application %22iTunes%22%0D%09if selection is {} then return%0D%09set strm to %28item 1 of selection%29%0D%09if %28get class of strm%29 is not URL track then return%0D%09repeat%0D%09%09try%0D%09%09%09play strm%0D%09%09%09exit repeat%0D%09%09on error m number n%0D%09%09%09delay 15%0D%09%09end try%0D%09end repeat%0Dend tell" title="Open in Script Editor. Works via most modern Mac browsers."><img src="pix/clickscriptsmall.jpg" alt="" /></a>
</pre>
<p>The earlier script used the <strong>open location</strong> command, errors from which could not be defeated with the <strong>try</strong> block.</p>
<hr/><small><a href="http://dougscripts.com/itunes/dougsupdated.rss" title="Take me to your reader">30 Most Recent RSS Feed</a> | <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Script Stats Page</a> by <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Name</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Most Recent&op=y">Most Recent</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Download Count&op=y">Download Count</a></small>]]></content:encoded>
			</item>
		<item>
		<title>UPDATED: No Lyrics to Playlist v2.0</title>
		<link>http://dougscripts.com/itunes/2009/02/updated-no-lyrics-to-playlist-v2-0/</link>
		<comments></comments>
		<pubDate>Fri, 27 Feb 2009 13:41:18 +0000</pubDate>
		<dc:creator>dougscripts</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Managing Tracks]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://dougscripts.com/itunes/wpfol/?p=102</guid>
		<description><![CDATA[No Lyrics to Playlist has been updated to version 2.0. It will search a selected playlist for all tracks in the selected playlist that do not contain lyrics and copy them to a playlist it will create called &#8220;No Lyrics&#8221;. Includes a second script to clear the &#8220;No Lyrics&#8221; playlist of tracks with lyrics.This set [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=nolyricstoplaylist" title="Copy tracks without lyrics to a "No Lyrics" playlist">No Lyrics to Playlist</a> has been updated to version 2.0. It will search a selected playlist for all tracks in the selected playlist that do not contain lyrics and copy them to a playlist it will create called &#8220;No Lyrics&#8221;. Includes a second script to clear the &#8220;No Lyrics&#8221; playlist of tracks with lyrics.<br/><br/>This set of scripts was written by Herwin Lans and originally posted about four years ago. Because of changes in iTunes, it required updating and, particularly, the &#8220;Clear No Lyrics Playlist&#8221; script needed an over-haul.</p>
<hr/><small><a href="http://dougscripts.com/itunes/dougsupdated.rss" title="Take me to your reader">30 Most Recent RSS Feed</a> | <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Script Stats Page</a> by <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Name</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Most Recent&op=y">Most Recent</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Download Count&op=y">Download Count</a></small>]]></content:encoded>
			</item>
		<item>
		<title>UPDATED: Gather Up the One-Hits v2.2</title>
		<link>http://dougscripts.com/itunes/2008/12/updated-gather-up-the-one-hits-v2-2/</link>
		<comments></comments>
		<pubDate>Mon, 01 Dec 2008 16:23:38 +0000</pubDate>
		<dc:creator>dougscripts</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Managing Tracks]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://dougscripts.com/itunes/?p=174</guid>
		<description><![CDATA[Gather Up the One-Hits had a persistent problem for some users whereby only a single track would be copied to the &#8220;One Hits&#8221; playlist. I believe I have fixed the problem, albeit at a cost of some speed; but it should only take a few seconds rather than a few moments to run.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://dougscripts.com/itunes/scripts/ss.php?sp=gatheruptheonehits">Gather Up the One-Hits</a> had a persistent problem for some users whereby only a single track would be copied to the &#8220;One Hits&#8221; playlist. I believe I have fixed the problem, albeit at a cost of some speed; but it should only take a few seconds rather than a few moments to run.</p>
<hr/><small><a href="http://dougscripts.com/itunes/dougsupdated.rss" title="Take me to your reader">30 Most Recent RSS Feed</a> | <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Script Stats Page</a> by <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Name&op=y">Name</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Most Recent&op=y">Most Recent</a>, <a href="http://dougscripts.com/itunes/scripts/scriptcount.php?sortBy=Download Count&op=y">Download Count</a></small>]]></content:encoded>
			</item>
	</channel>
</rss>

