<?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>johneday</title>
	<atom:link href="http://www.johneday.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.johneday.com</link>
	<description>for thoughts greater than 140 characters...</description>
	<lastBuildDate>Wed, 01 May 2013 14:48:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>EXIF Data Alfred Workflow</title>
		<link>http://www.johneday.com/831/exif-data-alfred-workflow</link>
		<comments>http://www.johneday.com/831/exif-data-alfred-workflow#comments</comments>
		<pubDate>Sun, 21 Apr 2013 16:07:45 +0000</pubDate>
		<dc:creator>johneday</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[alfred]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[exiftool]]></category>
		<category><![CDATA[mdls]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[workflows]]></category>

		<guid isPermaLink="false">http://www.johneday.com/?p=831</guid>
		<description><![CDATA[Now that you know how to access metadata with ExifTool and generate feedback in Alfred workflows, let&#8217;s put them together to quickly view metadata in Alfred. Usage: Select a file and call the EXIF Data workflow with the et keyword. Map the four Hotkeys to bypass the main menu and execute options directly. Select an [...]]]></description>
				<content:encoded><![CDATA[<p>Now that you know how to <a title="ExifTool Service" href="http://www.johneday.com/219/exiftool-service-for-quick-metadata-access" target="_blank">access metadata with ExifTool</a> and <a title="Generate Feedback in Alfred 2" href="http://www.johneday.com/617/generate-feedback-in-alfred-2-workflows" target="_blank">generate feedback in Alfred workflows</a>, let&#8217;s put them together to quickly view metadata in <a href="http://www.alfredapp.com/" title="Alfred" target="_blank">Alfred</a>.</p>
<p><a target="_blank" href="https://dl.dropboxusercontent.com/u/2422542/media/EXIF%20Data.alfredworkflow" class="woo-sc-button  green small" ><span class="woo-download">Download</span></a><br />
<strong>Usage:</strong><br />
<strong>Select a file</strong> and call the EXIF Data workflow with the <strong>et keyword</strong>. Map the four Hotkeys to bypass the main menu and execute options directly.</p>
<p><img src="http://www.johneday.com/wp-content/uploads/jed125.png" alt="jed125" width="648" height="295" class="aligncenter size-full wp-image-930" /></p>
<p>Select an item from the <strong>View in Alfred</strong> option to copy the tag&#8217;s information to the clipboard.</p>
<p><img src="http://www.johneday.com/wp-content/uploads/jed126.png" alt="jed126" width="648" height="490" class="aligncenter size-full wp-image-931" /></p>
<p>Select one or multiple items from the <strong>Choose from list</strong> option to copy the tag and its information to the clipboard.</p>
<p><img src="http://www.johneday.com/wp-content/uploads/jed127.png" alt="jed127" width="566" height="761" class="aligncenter size-full wp-image-859" /></p>
<p>Select the <strong>Export to file</strong> option to save metadata to a text file in ~/Documents/metadata/ using ExifTool. One or multiple files may be processed with this option. If the selection is not a <a title="ExifTool Supported File Types" href="http://www.sno.phy.queensu.ca/~phil/exiftool/index.html#supported" target="_blank">supported file type</a>, you are given the option to use mdls to view available information.</p>
<p><img src="http://www.johneday.com/wp-content/uploads/jed128.png" alt="jed128" width="594" height="537" class="aligncenter size-full wp-image-869" /></p>
<p>Select the <strong>Export mdls to file</strong> option to save metadata to a text file in ~/Documents/metadata/ using mdls. One or multiple files may be processed with this option.</p>
<p><img src="http://www.johneday.com/wp-content/uploads/jed129.png" alt="jed129" width="561" height="541" class="aligncenter size-full wp-image-871" /></p>
<p><strong>System Modifications:</strong><br />
A metadata folder is created in Documents to archive the text files created by the Export to file and Export mdls to file commands.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johneday.com/831/exif-data-alfred-workflow/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate Feedback in Alfred 2 Workflows</title>
		<link>http://www.johneday.com/617/generate-feedback-in-alfred-2-workflows</link>
		<comments>http://www.johneday.com/617/generate-feedback-in-alfred-2-workflows#comments</comments>
		<pubDate>Wed, 10 Apr 2013 14:26:43 +0000</pubDate>
		<dc:creator>johneday</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[alfred]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[workflows]]></category>

		<guid isPermaLink="false">http://www.johneday.com/?p=617</guid>
		<description><![CDATA[After realizing that I had run out of function keys to launch my growing library of Services, I decided to try Alfred as an application launcher. The interface is intuitive and within an hour I had reassigned all of my keyboard shortcuts and was calling scripts by keyword. The option to generate feedback in workflows [...]]]></description>
				<content:encoded><![CDATA[<p>After realizing that I had run out of function keys to launch my growing library of Services, I decided to try <a href="http://www.alfredapp.com/" title="Alfred" target="_blank">Alfred</a> as an application launcher. The interface is intuitive and within an hour I had reassigned all of my keyboard shortcuts and was calling scripts by keyword. <div class="woo-sc-divider flat"></div> <img class="aligncenter size-full wp-image-738" src="http://www.johneday.com/wp-content/uploads/feedback.png" alt="" width="648" height="334" /> The option to generate feedback in workflows means that you no longer have to use dialogs or hard-coded script properties to set users&#8217; preferences. However, despite <a title="tutorial" href="http://www.alfredforum.com/topic/5-generating-feedback-in-workflows/" target="_blank">David Ferguson&#8217;s excellent tutorial</a> and the <a title="user forum" href="http://www.alfredforum.com/forum/3-share-your-workflows/" target="_blank">examples available in the forum</a>, the learning curve noticeably steepened when I tried to incorporate feedback into my workflow. This example demonstrates several scenarios and can be used as a template for your AppleScript projects.</p>
<a target="_blank" href="http://www.johneday.com/wp-content/uploads/Feedback.zip" class="woo-sc-button  green small" ><span class="woo-download">Download</span></a>
<p><strong>Overview:</strong><br />
To generate feedback in Alfred, we use a Script Filter to pass a query to the xml.scpt AppleScript. The script then processes the query and returns a properly formatted XML string containing information for each item to be displayed. After you import the Generate Feedback workflow, launch it with the <strong>gf</strong> keyword to view my five examples. To reveal the <strong>xml.scpt</strong> you will need to edit, open the <strong>gf Script Filter</strong> and click the <strong>Open workflow folder</strong> button at the bottom of the window.</p>
<p><strong>Basic Usage:</strong><br />
Add each item you would like to be displayed in your workflow to the itemList by passing a <a title="record" href="http://developer.apple.com/library/mac/#documentation/applescript/conceptual/applescriptlangguide/reference/ASLR_classes.html#//apple_ref/doc/uid/TP40000983-CH1g-BBCDGEAH" target="_blank">record</a> containing the required labels to the <strong>xmlItem</strong> handler. For an in-depth description of each attribute, I have included pieces of David&#8217;s tutorial in the script&#8217;s comments.</p>
<pre class="brush: applescript; title: ; notranslate">
on run argv
	-- coerce the argv list to text
	set query to argv as text

	-- create an empty list to hold the items
	set itemList to {}

	-- Feedback item 1
	set end of itemList to xmlItem({uid:&quot;My uid&quot;, arg:&quot;My arg&quot;, title:&quot;My Title&quot;})

	-- Wrap the elements of the list with a declaration and return the list to Alfred
	return giveFeedback(itemList)
end run
</pre>
<p><strong>xmlItem Handler</strong><br />
Required labels:</p>
<pre class="brush: applescript; title: ; notranslate">{uid:&quot;My uid&quot;, arg:&quot;My arg&quot;, title:&quot;My Title&quot;}</pre>
<p>Optional labels:</p>
<pre class="brush: applescript; title: ; notranslate">
subtitle:&quot;My Subtitle&quot;
valid:&quot;no&quot;
autocomplete:&quot;Autocompleted text&quot;
icon:&quot;icon.png&quot;
icon:&quot;public.plain-text&quot;, iconAttribute:&quot;filetype&quot;  -- iconAttribute must be used with icon
icon:&quot;/Applications&quot;, iconAttribute:&quot;fileicon&quot;       -- iconAttribute must be used with icon
</pre>
<p><strong>Advanced Usage:</strong><br />
Characters <strong>&lt; &gt; &amp; &quot;</strong> need to be escaped properly for XML. To insert items that may contain these characters, pass the string to the <strong>clean</strong> handler along with a true/false value to remove leading and trailing whitespace.</p>
<pre class="brush: applescript; title: ; notranslate">clean(&quot;     Title with leading whitesplace &amp; &lt; &gt; \&quot; characters, trimming is true&quot;, true)</pre>
<p>Alfred uses the uid attribute to learn which results are selected the most and then uses this information to sort your feedback. If you would like to manually arrange the returned items, use the <strong>uuid</strong> handler to generate a unique uid. In Alfred&#8217;s next release (after 2.0.2), this issue will be resolved and the item UID attribute will be optional.</p>
<pre class="brush: applescript; title: ; notranslate">uid:uuid()</pre>
<p>Typically, you will want to match the displayed Icon with the arg by passing the same value to the arg and icon labels. </p>
<pre class="brush: applescript; title: ; notranslate">arg:&quot;/Applications&quot;, icon:&quot;/Applications&quot;, iconAttribute:&quot;fileicon&quot;</pre>
<p>I have also included a list of file types with the workflow that may be used as <strong>values for the icon label when paired with iconAttribute:&#8221;filetype&#8221;</strong>. See <a title="Imgur gallery" href="http://imgur.com/a/0zXVX" target="_blank">http://imgur.com/a/0zXVX </a>for the corresponding icons.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johneday.com/617/generate-feedback-in-alfred-2-workflows/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create time-based Gmail filters with Google Apps Script</title>
		<link>http://www.johneday.com/422/time-based-gmail-filters-with-google-apps-script</link>
		<comments>http://www.johneday.com/422/time-based-gmail-filters-with-google-apps-script#comments</comments>
		<pubDate>Sat, 12 Jan 2013 14:33:22 +0000</pubDate>
		<dc:creator>johneday</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[auto-archive]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[inbox zero]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[sweep]]></category>

		<guid isPermaLink="false">http://www.johneday.com/?p=422</guid>
		<description><![CDATA[Somewhere between spam and archived messages are the emails that I want to glance at briefly, yet I don&#8217;t want clogging my Inbox when I forget to delete them. Apple Mail lets you create a rule for messages received greater than x days old. However, because the condition is only tested as messages arrive, none [...]]]></description>
				<content:encoded><![CDATA[<p>Somewhere between spam and archived messages are the emails that I want to glance at briefly, yet I don&#8217;t want clogging my Inbox when I forget to delete them. Apple Mail lets you create a rule for messages received greater than x days old. However, because the condition is only tested as messages arrive, none of the messages will meet the criteria. You can get around this by reapplying the rule, but that defeats the purpose of automating the process. Thankfully, Gmail users can take advantage of Google Apps Script to create time-based events that will move, mark, or label your messages without having to open a mail client.</p>
<p>For this example, let&#8217;s create a script that will <strong>delete all messages from the &#8220;delete me&#8221; label that are older than two days</strong>. First, make a new Gmail filter and populate the search options so it will catch all of your semi-spam. Remember to create and apply the &#8220;delete me&#8221; label to the matched messages.</p>
<p><a href="http://www.johneday.com/422/time-based-gmail-filters-with-google-apps-script/time-based-filter" rel="attachment wp-att-461"><img class="aligncenter size-full wp-image-461" src="http://www.johneday.com/wp-content/uploads/time-based-filter.png" alt="" width="512" height="221" /></a> Go to <a title=" https://script.google.com" href="https://script.google.com" target="_blank">https://script.google.com </a>, create a script for a Blank Project, and paste the code below into the editor. You may edit the delayDays variable to specify how many days should pass before the matched messages will be moved to the trash.</p>
<pre class="brush: jscript; title: ; notranslate">
function cleanUp() {
  var delayDays = 2 // Enter # of days before messages are moved to trash
  var maxDate = new Date();
  maxDate.setDate(maxDate.getDate()-delayDays);
  var label = GmailApp.getUserLabelByName(&quot;delete me&quot;);
  var threads = label.getThreads();
  for (var i = 0; i &lt; threads.length; i++) {
    if (threads[i].getLastMessageDate()&lt;maxDate)
      {
        threads[i].moveToTrash();
      }
  }
}
</pre>
<p>After you save your script, run it by either clicking the play button or by selecting it from the Run menu at the top of the screen. Authorize the script to access your Gmail account, then schedule the interval in which you would like the script to run. Select Current script&#8217;s triggers&#8230; from the Resources menu and select a period, I chose every 30 minutes.</p>
<p><a href="http://www.johneday.com/?attachment_id=457" rel="attachment wp-att-457"><img src="http://www.johneday.com/wp-content/uploads/time-based-schedule.png" alt="" width="816" height="226" class="aligncenter size-full wp-image-457" /></a></p>
<p>Notice that your Trash is now filled with old messages, previously destined to collect dust in your Inbox. To save one of your &#8220;delete me&#8221; messages, simply remove the label.</p>
<p>Time-based filters can also be used to <strong>auto-archive emails older than x days</strong>. You can simplify your javascript function by using the <a href="https://developers.google.com/apps-script/class_gmailapp#search" title="search method" target="_blank">search method</a> to combine several <a href="https://support.google.com/mail/bin/answer.py?hl=en&amp;answer=7190" title="advanced search operators" target="_blank">advanced search operators</a>. For example, using the script below I can archive every thread in my Inbox that is read, older than two days, and not labeled &#8220;delete me&#8221;.</p>
<pre class="brush: jscript; title: ; notranslate">
function archiveInbox() {
// Every thread in your Inbox that is read, older than two days, and not labeled &quot;delete me&quot;.
var threads = GmailApp.search('label:inbox is:read older_than:2d -label:&quot;delete me&quot;');
  for (var i = 0; i &lt; threads.length; i++) {
    threads[i].moveToArchive();
}
}
</pre>
<p>Deleting or archiving thousands of messages may take some time. You can <strong>speed things up</strong> and minimize &#8220;Exceeded maximum execution time&#8221; errors by processing threads in batches of 100. Here are several examples:</p>
<p><strong>Batch Delete Functions</strong></p>
<pre class="brush: jscript; title: ; notranslate">
function batchDeleteA() {
  var batchSize = 100 // Process up to 100 threads at once
  var threads = GmailApp.search('label:&quot;delete me&quot; older_than:2d');
  for (j = 0; j &lt; threads.length; j+=batchSize) {
    GmailApp.moveThreadsToTrash(threads.slice(j, j+batchSize));
  }
}

function batchDeleteB() {
  var mySearch = &quot;'label:\&quot;delete me\&quot; older_than:2d'&quot;
  var batchSize = 100 // Process up to 100 threads at once
  while (GmailApp.search(mySearch, 0, 1).length == 1)
  {
    GmailApp.moveThreadsToTrash(GmailApp.search(mySearch, 0, batchSize));
  }  
}

function multipleLabels() {
  var myLabels = {'&quot;delete me&quot;': &quot;2d&quot;, '&quot;scripts&quot;': &quot;5d&quot;};
  var batchSize = 100; // Process up to 100 threads at once
  for(aLabel in myLabels)
  {
    var threads = GmailApp.search('label:'+aLabel+' older_than:'+myLabels[aLabel]+'');
    for (j = 0; j &lt; threads.length; j+=batchSize) {
      GmailApp.moveThreadsToTrash(threads.slice(j, j+batchSize));
    }
  }  
}

</pre>
<p><strong>Batch Archive Functions</strong></p>
<pre class="brush: jscript; title: ; notranslate">
function batchArchiveA() {
  var batchSize = 100 // Process up to 100 threads at once
  var threads = GmailApp.search('label:inbox is:read older_than:2d -label:&quot;delete me&quot;');
  for (j = 0; j &lt; threads.length; j+=batchSize) {
    GmailApp.moveThreadsToArchive(threads.slice(j, j+batchSize));
  }
}

function batchArchiveB() {
  var mySearch = &quot;'label:inbox is:read older_than:2d -label:\&quot;delete me\&quot;'&quot;
  var batchSize = 100 // Process up to 100 threads at once
  while (GmailApp.search(mySearch, 0, 1).length == 1)
  {
    GmailApp.moveThreadsToTrash(GmailApp.search(mySearch, 0, batchSize));
  }  
}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.johneday.com/422/time-based-gmail-filters-with-google-apps-script/feed</wfw:commentRss>
		<slash:comments>79</slash:comments>
		</item>
		<item>
		<title>Imgur Service for fast image sharing</title>
		<link>http://www.johneday.com/272/imgur-service-for-fast-image-sharing</link>
		<comments>http://www.johneday.com/272/imgur-service-for-fast-image-sharing#comments</comments>
		<pubDate>Mon, 27 Aug 2012 16:43:14 +0000</pubDate>
		<dc:creator>johneday</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[BBCode]]></category>
		<category><![CDATA[imgur]]></category>

		<guid isPermaLink="false">http://www.johneday.com/?p=272</guid>
		<description><![CDATA[Posting images in most message boards involves uploading the image to a host, copying the URL, and then enclosing the URL in Bulletin Board Code [img][/img] tags. This service uses the Imgur API to reduce the steps in the process to one control-click. Register for a free Anonymous API Developer Key. Then, choose a Service [...]]]></description>
				<content:encoded><![CDATA[<p>Posting images in most message boards involves uploading the image to a host, copying the URL, and then enclosing the URL in Bulletin Board Code [img][/img] tags. This service uses the Imgur API to reduce the steps in the process to one control-click. <div class="woo-sc-divider flat"></div> <a href="http://www.johneday.com/272/imgur-service-for-fast-image-sharing/imgur_service2" rel="attachment wp-att-291"><img class="alignleft size-medium wp-image-291" src="http://www.johneday.com/wp-content/uploads/imgur_service2-300x117.png" alt="" width="300" height="117" /></a></p>
<p>Register for a free Anonymous <a title="API Key" href="https://imgur.com/register/api_anon" target="_blank">API Developer Key</a>. Then, choose a Service template in Automator that receives files or folders in Finder and paste the AppleScript below into a Run AppleScript action. Enter your API Key in the apiKey property. <div class="woo-sc-divider flat"></div></p>
<pre class="brush: applescript; title: ; notranslate">property apiKey : &quot;enter your api key&quot;</pre>
<p>The script will populate your clipboard with a URL that is ready to post. If you simply want the URL without the [img][/img] tags, change the img_tag property from <code>true</code> to <code>false</code>. <div class="woo-sc-divider flat"></div></p>
<p><a target="_blank" href="http://www.johneday.com/wp-content/uploads/imgur.zip" class="woo-sc-button  green small" ><span class="woo-download">Download</span></a><br />
<a href="http://www.johneday.com/272/imgur-service-for-fast-image-sharing/imgur_service" rel="attachment wp-att-275"><img class="aligncenter size-full wp-image-275" src="http://www.johneday.com/wp-content/uploads/imgur_service.png" alt="" width="635" height="933" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johneday.com/272/imgur-service-for-fast-image-sharing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExifTool Service for quick metadata access</title>
		<link>http://www.johneday.com/219/exiftool-service-for-quick-metadata-access</link>
		<comments>http://www.johneday.com/219/exiftool-service-for-quick-metadata-access#comments</comments>
		<pubDate>Sun, 26 Aug 2012 05:14:53 +0000</pubDate>
		<dc:creator>johneday</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[exiftool]]></category>
		<category><![CDATA[metadata]]></category>

		<guid isPermaLink="false">http://www.johneday.com/?p=219</guid>
		<description><![CDATA[ExifTool by Phil Harvey, does a fantastic job of extracting and manipulating metadata. However, the extra few steps of using a command-line application can be frustrating when you are looking for quick information. To save some keystrokes, I wrote a service to access multiple files&#8217; metadata with a single control-click. After installing ExifTool, create a [...]]]></description>
				<content:encoded><![CDATA[<p>ExifTool by Phil Harvey, does a fantastic job of extracting and manipulating metadata. However, the extra few steps of using a command-line application can be frustrating when you are looking for quick information. To save some keystrokes, I wrote a service to access multiple files&#8217; metadata with a single control-click. <a href="http://www.johneday.com/219/exiftool-service-for-quick-metadata-access/jed124" rel="attachment wp-att-228"><img class="aligncenter size-full wp-image-228" style="border: 0px none;margin-top: 0px;margin-bottom: 0px" src="http://www.johneday.com/wp-content/uploads/jed124.png" alt="" width="468" height="355" /></a> After installing <a title="ExifTool" href="http://owl.phy.queensu.ca/~phil/exiftool/" target="_blank">ExifTool</a>, create a new Service workflow in Automator that receives files or folders in Finder. Paste the AppleScript below into a Run AppleScript action, save your newly created service and enjoy. Each time the service is run, a text file containing your information will be added to the &#8220;metadata&#8221; folder within your Documents. <div class="woo-sc-divider flat"></div></p>
<p><a target="_blank" href="http://www.johneday.com/wp-content/uploads/metadata.zip" class="woo-sc-button  green small" ><span class="woo-download">Download</span></a><br />
<a href="http://www.johneday.com/219/exiftool-service-for-quick-metadata-access/exiftool_1" rel="attachment wp-att-295"><img class="aligncenter size-full wp-image-295" src="http://www.johneday.com/wp-content/uploads/exiftool_1.png" alt="" width="678" height="532" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johneday.com/219/exiftool-service-for-quick-metadata-access/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rename and File Aperture Projects by Date</title>
		<link>http://www.johneday.com/9/rename-and-file-aperture-projects-by-date</link>
		<comments>http://www.johneday.com/9/rename-and-file-aperture-projects-by-date#comments</comments>
		<pubDate>Tue, 17 Jul 2012 15:35:39 +0000</pubDate>
		<dc:creator>johneday</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[aperture]]></category>
		<category><![CDATA[applescript]]></category>

		<guid isPermaLink="false">http://www.johneday.com/?p=9</guid>
		<description><![CDATA[Although every Aperture 3 user organizes their projects differently, I am sure most of you have some unfiled, unnamed, and otherwise unorganized projects floating around your Library. To prevent having an unmanageable sidebar with endless scrolling, I file these projects in a folder until I find a home for them. Select a project, folder, or [...]]]></description>
				<content:encoded><![CDATA[<p>Although every Aperture 3 user organizes their projects differently, I am sure most of you have some unfiled, unnamed, and otherwise unorganized projects floating around your Library. To prevent having an unmanageable sidebar with endless scrolling, I file these projects in a folder until I find a home for them.</p>
<p><a href="http://www.johneday.com/9/rename-and-file-aperture-projects-by-date/jed31" rel="attachment wp-att-35"><img class="alignleft size-thumbnail wp-image-35" src="http://www.johneday.com/wp-content/uploads/jed31-150x150.png" alt="" width="150" height="150" /></a></p>
<p>Select a project, folder, or album from the sidebar and run the script. Projects named YYYY-MM-DD are created in the “Imported by Date” folder and all items of the selected project are filed according to their EXIF tag ImageDate. I prefer using the ISO 8601 date format <strong>2011-08-27</strong> rather than the default <strong>Aug 27, 2011</strong>, especially when working with long lists. <a href="http://www.johneday.com/wp-content/uploads/File-Projects-by-Date.zip" class="woo-sc-button  green small" ><span class="woo-download">Download</span></a> <div class="woo-sc-divider flat"></div></p>
<pre class="brush: applescript; title: ; notranslate">
set yourFolder to &quot;Imported by Date&quot; -- Name your folder here
set appendParent to false -- If true, the selected parent's name will be appended to the new project name 
set makeSubfolders to false -- If true, new projects will be created in year/month/ folders.
property delimiter : &quot;-&quot;
set exifProblems to {}

tell application &quot;Aperture&quot;
	activate
	
	-- Wait until Aperture is finished processing other tasks
	repeat
		set taskCount to count of tasks
		if taskCount is 1 then
			display alert &quot;Aperture is processing another task&quot; message &quot;Please wait for the task to complete and try again&quot; buttons {&quot;Try again&quot;, &quot;Cancel&quot;} default button {&quot;Try again&quot;} cancel button {&quot;Cancel&quot;}
		else if taskCount &gt; 1 then
			display alert &quot;Aperture is processing &quot; &amp; taskCount &amp; &quot; tasks&quot; message &quot;Please wait for the tasks to complete and try again&quot; buttons {&quot;Try again&quot;, &quot;Cancel&quot;} default button {&quot;Try again&quot;} cancel button {&quot;Cancel&quot;}
		else
			exit repeat
		end if
	end repeat
	
	-- Verify that at least one item is selected
	if selection is {} then display alert &quot;The selection {} is empty&quot; message &quot;Please select ONE Project, Folder or Album from the Library tab in the sidebar and try again.&quot; buttons {&quot;OK&quot;} cancel button {&quot;OK&quot;}
	
	-- Get the selected Parent ID
	tell item 1 of (selection as list) to set theParent to parent
	set {parentClass, parentName} to {class, name} of theParent
	if parentClass is album then display dialog &quot;Albums may contain images from multiple projects. Are you sure you want to move these images from their projects?&quot;
	
	-- Get date of every image in the selected Parent
	tell theParent to set dateList to every image version's (value of EXIF tag &quot;ImageDate&quot;)
	
	tell library 1
		-- Create your folder if it does not exist
		if not (exists folder yourFolder) then make new folder with properties {name:yourFolder}
		
		-- Assign name of every project in your folder to a list for the Create project command below
		-- (exists project isoImageDate) command is too slow to be included in the loop
		if not makeSubfolders then tell folder yourFolder to set parentList to name of every project
		
		set dateTest to {}
		repeat with aDate in my dateList
			-- Test each date to avoid processing duplicates
			set shortDate to short date string of aDate
			if dateTest does not contain shortDate then
				set end of dateTest to shortDate
				
				-- Convert the image date to YYYY-MM-DD format 
				set projectYear to year of aDate as string
				set projectMonth to (month of aDate as integer) as string
				if length of projectMonth is 1 then set projectMonth to &quot;0&quot; &amp; projectMonth
				set projectDay to (day of aDate as integer) as string
				if length of projectDay is 1 then set projectDay to &quot;0&quot; &amp; projectDay
				set isoImageDate to projectYear &amp; delimiter &amp; projectMonth &amp; delimiter &amp; projectDay as string
				if appendParent then set isoImageDate to isoImageDate &amp; space &amp; parentName
				
				tell folder yourFolder
					if makeSubfolders then
						--Create year and month folders if year folder does not exist
						if not (exists folder projectYear) then make new folder with properties {name:projectYear}
						tell folder projectYear
							if not (exists folder projectMonth) then make new folder with properties {name:projectMonth}
						end tell
						--Create project if it does not exist
						if ((name of every project of folder projectMonth of folder projectYear) does not contain isoImageDate) then tell folder projectMonth of folder projectYear to make new project with properties {name:isoImageDate}
						
						try
							-- Move the images into the project
							move (every image version of theParent whose value of EXIF tag &quot;CaptureYear&quot; is year of aDate and value of EXIF tag &quot;CaptureMonthOfYear&quot; is month of aDate as integer and value of EXIF tag &quot;CaptureDayOfMonth&quot; is day of aDate) to project isoImageDate of folder projectMonth of folder projectYear
						on error
							set targetProject to project isoImageDate of folder projectMonth of folder projectYear
							tell me to set exifProblems to exifProblems &amp; exifCheck(theParent, aDate, targetProject)
						end try
						
					else -- If not makeSubfolders
						--Create project if it does not exist
						if parentList does not contain isoImageDate then make new project with properties {name:isoImageDate}
						
						try
							-- Move the images into the project
							move (every image version of theParent whose value of EXIF tag &quot;CaptureYear&quot; is year of aDate and value of EXIF tag &quot;CaptureMonthOfYear&quot; is month of aDate as integer and value of EXIF tag &quot;CaptureDayOfMonth&quot; is day of aDate) to project isoImageDate
						on error
							set targetProject to project isoImageDate
							tell me to set exifProblems to exifProblems &amp; exifCheck(theParent, aDate, targetProject)
						end try
						
					end if
				end tell
			end if
		end repeat
		
		-- Move the initial container to the Trash if no images remain or if it is an album			
		if parentClass is album then
			delete theParent
		else if (count of image versions of theParent) is 0 then
			delete theParent
		end if
		beep
	end tell
end tell

if exifProblems ≠ {} then
	set exifProblems to text 1 thru -3 of (exifProblems as text)
	tell me
		activate
		display alert &quot;The script had problems processing EXIF info: &quot; message (exifProblems as text) buttons {&quot;OK&quot;} default button 1 cancel button 1
	end tell
end if

on exifCheck(theParent, aDate, destination)
	tell application &quot;Aperture&quot;
		script o
			property parentImages : every image version of theParent
			property badExif : {}
		end script
		
		repeat with anImage in o's parentImages
			try
				if value of EXIF tag &quot;CaptureYear&quot; of anImage is year of aDate and value of EXIF tag &quot;CaptureMonthOfYear&quot; of anImage is month of aDate as integer and value of EXIF tag &quot;CaptureDayOfMonth&quot; of anImage is day of aDate then move anImage to destination
			on error
				set end of o's badExif to (anImage's name) &amp; &quot;,&quot; &amp; space
			end try
		end repeat
		return o's badExif
	end tell
end exifCheck
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.johneday.com/9/rename-and-file-aperture-projects-by-date/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
	</channel>
</rss>
