<?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>betaplane.org &#187; regex</title>
	<atom:link href="http://www.betaplane.org/tag/regex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.betaplane.org</link>
	<description>Arno C. Hammann, Princeton NJ USA</description>
	<lastBuildDate>Tue, 18 Oct 2011 03:57:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>An OS X Service to batch-rename song titles in iTunes</title>
		<link>http://www.betaplane.org/itunes-batch-rename/</link>
		<comments>http://www.betaplane.org/itunes-batch-rename/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 04:21:50 +0000</pubDate>
		<dc:creator>Arno Hammann</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[Automator]]></category>
		<category><![CDATA[batch rename]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[song titles]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.betaplane.org/?p=437</guid>
		<description><![CDATA[I&#8217;ve always found it annoying that you can&#8217;t make pattern-like changes to the titles of a batch of songs, in the spirit of batch renaming files (admittedly, a bit of a science itself). So, I figured, maybe that&#8217;s finally a reason to learn how to use Automator, and the time spent on it might come [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always found it annoying that you can&#8217;t make pattern-like changes to the <em>titles</em> of a batch of songs, in the spirit of batch renaming files (admittedly, a bit of a science itself). So, I figured, maybe that&#8217;s finally a reason to learn how to use <a href="http://www.macosxautomation.com/automator/">Automator</a>, and the time spent on it might come in useful later on if I ever want to create another Automator workflow. Needless to say, I gave up <sup class='footnote'><a href='#fn-437-1' id='fnref-437-1'>1</a></sup>, except: Automator <em>does</em> let you just package any <a href="http://www.macosxautomation.com/applescript/">AppleScript</a> as a <a href="http://www.apple.com/macosx/what-is-macosx/scripting.html">Service</a> (although only since Snow Leopard, I believe), and that&#8217;s exactly what I did.</p>
<p>Download here: <a href="http://www.betaplane.org/wp1/../downloads/iTbr.zip" onClick="javascript: pageTracker._trackPageview('iTbr'); ">iTunes batch rename workflow</a></p>
<p>Install: unzip, double click install.app<br />
Requirements: OS X 10.6 Snow Leopard (I believe)<br />
Use: select files in iTunes, go to menu iTunes > Services > iTunes batch rename</p>
<p>When invoked from the Services menu, a dialog box asks for a <a href="http://www.perl.org/">Perl</a> substitution pattern of the form <code>s/expr1/expr2/</code> etc, where <code>expr1</code> is a <a href="javascript:searchWWW('perl+regular+expression')" title="search with google">Perl regular expression</a> to be replaced by <code>expr2</code>. The given expression is applied to all song titles, not the file names.</p>
<p>For example, if your song titles all contain the name of the artist, say</p>
<blockquote><p>Telephone (Lady Gaga)<br />
Bad Romance (Lady Gaga)<sup class='footnote'><a href='#fn-437-2' id='fnref-437-2'>2</a></sup></p></blockquote>
<p>you can simply strip it by using the pattern <code>s/ \(Lady Gaga\)//</code> . The backslashes just escape the brackets, which are reserved characters in Perl; if you&#8217;re not familiar with Perl regular expressions, find a nice tutorial on them via the search engine of your choice. </p>
<p>If I see that people are at all interested and download the workflow, I might start implementing more features (of course you might also just do it yourself&#8230;). The first one on my list is to put the songs&#8217; actual filenames in a variable so one can parse them to fill in blank song titles. A semi-natural second follow-up would be the ability to modify the artist field as well. I&#8217;m thinking here of files with a filename containing both artist and title, but devoid of metadata.
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-437-1'>It seems to me that anything I am interested in doing with Automator can either <em>only</em> or <em>much more quickly</em> be done in AppleScript or other script languages&#8230; and that even though I know almost nothing about AppleScript. And btw, I just wanted to try this footnote plugin. <span class='footnotereverse'><a href='#fnref-437-1'>&#8617;</a></span></li>
<li id='fn-437-2'>No, I&#8217;m not a fan, in fact, I couldn&#8217;t care less&#8230; <span class='footnotereverse'><a href='#fnref-437-2'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.betaplane.org/itunes-batch-rename/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

