<?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>langui.sh &#187; applescript</title>
	<atom:link href="http://langui.sh/tag/applescript/feed/" rel="self" type="application/rss+xml" />
	<link>http://langui.sh</link>
	<description>Fun hacks, WP plugins, photography, and PKI junk.  Languishing since 2008.</description>
	<lastBuildDate>Sat, 19 May 2012 01:42:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Folder Actions in OS X</title>
		<link>http://langui.sh/2008/12/31/folder-actions-in-os-x/</link>
		<comments>http://langui.sh/2008/12/31/folder-actions-in-os-x/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 20:23:43 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=17</guid>
		<description><![CDATA[<a href="http://langui.sh/2008/12/31/folder-actions-in-os-x/" title="Folder Actions in OS X"></a>Awhile back I started getting annoyed at the process of manually moving files around after downloading, so I decided to investigate one of Apple&#8217;s more hidden features&#8230;Folder Actions! For those who don&#8217;t know, folder actions are configurable scripts that can &#8230;<p class="read-more"><a href="http://langui.sh/2008/12/31/folder-actions-in-os-x/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2008/12/31/folder-actions-in-os-x/" title="Folder Actions in OS X"></a><p>Awhile back I started getting annoyed at the process of manually moving files around after downloading, so I decided to investigate one of Apple&#8217;s more hidden features&#8230;Folder Actions!  For those who don&#8217;t know, folder actions are configurable scripts that can be attached to folders and run whenever the contents of the folder change. They can do anything from copying mp3s you download from Amazon MP3 automatically into iTunes to converting documents automatically into PDF.</p>
<p>In a fit of boredom I have made a <a href='http://cdn.langui.sh/2008/12/folderactions.mov'>screencast</a> showing how to make a simple folder action. If you&#8217;d like to follow along yourself, here is the applescript script (please note that you&#8217;ll need to create a folder named JPEGs in your ~/Downloads folder as well).  Open Script Editor and paste it in to begin!</p>

<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">on</span> <span style="color: #0066ff;">adding</span> <span style="color: #0066ff;">folder</span> <span style="color: #0066ff;">items</span> <span style="color: #ff0033; font-weight: bold;">to</span> my_folder <span style="color: #ff0033;">after</span> <span style="color: #0066ff;">receiving</span> the_files
<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Finder&quot;</span>
<span style="color: #ff0033; font-weight: bold;">set</span> jpgFolder <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">folder</span> <span style="color: #009900;">&quot;JPEGs&quot;</span> <span style="color: #ff0033; font-weight: bold;">in</span> my_folder
<span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">with</span> f <span style="color: #ff0033; font-weight: bold;">in</span> the_files
<span style="color: #ff0033; font-weight: bold;">if</span> f<span style="">'</span>s <span style="color: #0066ff;">name</span> ends <span style="color: #ff0033; font-weight: bold;">with</span> <span style="color: #009900;">&quot;.jpg&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
<span style="color: #0066ff;">move</span> f <span style="color: #ff0033; font-weight: bold;">to</span> jpgFolder
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #0066ff;">adding</span> <span style="color: #0066ff;">folder</span> <span style="color: #0066ff;">items</span> <span style="color: #ff0033; font-weight: bold;">to</span></pre></div></div>

<p>Obviously this represents a profoundly simple use case, but folder actions can have near limitless complexity.  Unfortunately there are several issues with the implementation of this feature in OS X.  Whenever the folder action actually triggers you will briefly get a flicker in your foreground window as the Finder takes focus, and for reasons I can&#8217;t quite nail down actions do not seem to trigger with 100% reliability.  Despite these issues, this is a powerful tool that can be exploited in fascinating ways.</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2008/12/31/folder-actions-in-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.swearingscience.com/wp-content/uploads/2008/12/folderactions.mov" length="10979566" type="video/quicktime" />
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 4/15 queries in 0.004 seconds using memcached
Object Caching 407/420 objects using memcached

Served from: langui.sh @ 2012-05-21 12:34:20 -->
