<?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>One Man's Walk in work &#187; applescript</title>
	<atom:link href="http://onemanswalk.com/work/tag/applescript/feed/" rel="self" type="application/rss+xml" />
	<link>http://onemanswalk.com/work</link>
	<description>jeremy lightsmith on agile, ruby, and consulting</description>
	<lastBuildDate>Wed, 04 May 2011 04:29:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linking Delicious Library to Your Movies</title>
		<link>http://onemanswalk.com/work/2008/07/25/linking-delicious-library-to-your-movies/</link>
		<comments>http://onemanswalk.com/work/2008/07/25/linking-delicious-library-to-your-movies/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 15:47:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[fun]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	If you&#8217;re like me, you value traveling light.  If you&#8217;re like me, anything that can live in digital form does.  I haven&#8217;t seen most of the actual DVD&#8217;s I own for quite some time now.  But the movies on them all live on a hard drive that&#8217;s hooked up to my television. [...]]]></description>
			<content:encoded><![CDATA[	<p>If you&#8217;re like me, you value traveling light.  If you&#8217;re like me, anything that can live in digital form does.  I haven&#8217;t seen most of the actual <span class="caps">DVD</span>&#8217;s I own for quite some time now.  But the movies on them all live on a hard drive that&#8217;s hooked up to my television.  I love the instant gratification.  I love that I can download a movie to my laptop and watch it on the plane.</p>

	<p><a href="http://www.delicious-monster.com/" title="">Delicious Library</a> makes this even cooler.  As much as I love having everything digital, I miss being able to take a quick glance at 100 covers and recognize the one I want.  I miss the association between images and memories.  Delicious gives this back to me.</p>

	<p>However, it&#8217;d be really cool if I could go browsing in my  delicious &#8220;library&#8221;, find the movie I want, and double click it to play.  Turns out you can easily extend the program with applescript, and a couple hours after I decided such a script didn&#8217;t already exist on the interweb, it now does.</p>

	<p>This applescript will open vlc with the file associated to a media object in delicious.  If there isn&#8217;t one already, it will prompt you for this file and then remember it for next time.  It&#8217;s really simple, and happy <img src='http://onemanswalk.com/work/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="applescript"><span style="color: #808080; font-style: italic;">-- this will play the currently selected file in vlc using either </span>
<span style="color: #808080; font-style: italic;">-- the associated url or prompting you to find the file on disk</span>
&nbsp;
<span style="color: #b1b100;">tell</span> <span style="color: #000000; font-weight: bold;">first</span> document <span style="color: #b1b100;">of</span> application <span style="color: #ff0000;">&quot;Delicious Library 2&quot;</span>
    <span style="color: #b1b100;">set</span> selectedMedia <span style="color: #b1b100;">to</span> selected media
    <span style="color: #b1b100;">repeat</span> <span style="color: #b1b100;">with</span> selectedMedium <span style="color: #b1b100;">in</span> selectedMedia
        <span style="color: #b1b100;">set</span> movieUrl <span style="color: #b1b100;">to</span> associated URL <span style="color: #b1b100;">of</span> selectedMedium
&nbsp;
        <span style="color: #b1b100;">if</span> movieUrl starts <span style="color: #b1b100;">with</span> <span style="color: #ff0000;">&quot;file://&quot;</span> <span style="color: #b1b100;">then</span>
            <span style="color: #b1b100;">set</span> movieFile <span style="color: #b1b100;">to</span> rich text <span style="color: #cc66cc;">8</span> <span style="color: #000000; font-weight: bold;">through</span> <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">of</span> movieUrl
        <span style="color: #b1b100;">else</span>
            <span style="color: #b1b100;">set</span> movieFile <span style="color: #b1b100;">to</span> <span style="color: #66cc66;">&#40;</span>choose file <span style="color: #b1b100;">with</span> prompt <span style="color: #ff0000;">&quot;Find the file for &quot;</span> \
                                            <span style="color: #66cc66;">&amp;</span> name <span style="color: #b1b100;">of</span> selectedMedium <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot;:&quot;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
            <span style="color: #b1b100;">set</span> associated URL <span style="color: #b1b100;">of</span> selectedMedium <span style="color: #b1b100;">to</span> <span style="color: #ff0000;">&quot;file://&quot;</span> <span style="color: #66cc66;">&amp;</span> movieFile
        <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">if</span>
&nbsp;
        <span style="color: #b1b100;">tell</span> application <span style="color: #ff0000;">&quot;VLC&quot;</span>
            activate
            <span style="color: #000066;">open</span> movieFile
            fullscreen
        <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">tell</span>
    <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">repeat</span>
<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">tell</span></pre></div></div>
</p>



 &#8211; thanks <a href="http://brokenbuild.com/" title="">Wes</a> for pointing me to such a cool program!
 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2008/07/25/linking-delicious-library-to-your-movies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

