<?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>infotexture &#187; zip</title>
	<atom:link href="http://infotexture.net/tag/zip/feed/" rel="self" type="application/rss+xml" />
	<link>http://infotexture.net</link>
	<description>Information Architecture &#38; Content Strategy</description>
	<lastBuildDate>Sat, 03 Sep 2011 14:59:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Snow Leopard Services: Set ZIP File Date</title>
		<link>http://infotexture.net/2009/11/snow-leopard-services-set-zip-file-date/</link>
		<comments>http://infotexture.net/2009/11/snow-leopard-services-set-zip-file-date/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 20:05:15 +0000</pubDate>
		<dc:creator>roger</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Automator]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://blog.infotexture.net/?p=305</guid>
		<description><![CDATA[One of the more popular posts on this site is an entry from October of 2007 on creating a ZIP archive and setting the modification date via an Automator workflow. As I wrote then: “&#8230;when you’re archiving older data, it’s much more useful for the ZIP file date to reflect the date of its contents, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.infotexture.net/wp-content/uploads/2009/11/advanced-preferences-icon.png" alt="advanced-preferences-icon.png" border="0" width="32" height="32" align="right" />One of the more popular posts on this site is an entry from October of 2007 on <a href="http://blog.infotexture.net/2007/10/18/automator-workflow-set-zip-file-date/">creating a ZIP archive and setting the modification date</a> via an <a href="http://www.macosxautomation.com/automator/">Automator</a> workflow. </p>

<p>As I wrote then:</p>

<blockquote>
  <p>“&#8230;when you’re archiving older data, it’s much more useful for the ZIP file date to reflect the date of its contents, since a few years from now you probably won’t care when you compressed the stuff, but rather how old the files inside are.”</p>
</blockquote>

<p>With Mac OS 10.6 <em>Snow Leopard,</em> this same workflow can be set up to run as a service, accessible from the context menu in any Finder window. The process is essentially the same as described in the <a href="http://blog.infotexture.net/2007/10/18/automator-workflow-set-zip-file-date/">original post</a>, with the following adjustments:</p>

<p>To create the workflow,</p>

<ol>
<li>Open <code>/Applications/Automator.app</code>, select the <strong>Service</strong> template and click <strong>Choose</strong>.</li>
<li>At the top of the workflow area on the right side of the window, change the first list option to <strong>files or folders</strong>.</li>
<li>From the <strong>Finder</strong> library, drag the <strong>Create Archive</strong> action to the workflow area. In the action settings, specify the default name and location for the archive file. <em>(I prefer the same name &amp; folder as the input, but you can set the <strong>Options</strong> to prompt for this information when the workflow runs.)</em></li>
<li>From the <strong>Automator</strong> library, add the <strong>Run Shell Script</strong> action.
Leave the <strong>Shell</strong> set to <code>/bin/bash</code>, set <strong>Pass input</strong> to <code>as arguments</code>, and replace the default script in the text box with <code>zip -o "$@"</code>.</li>
</ol>

<p>Save the workflow as a service, and you can run it on files &amp; folders in the Finder by Control-clicking and choosing your new command from the <strong>Services</strong> submenu in the shortcut menu.</p>

<p class="note"><strong>Note:</strong> To create a service that will set the date for existing ZIP files, skip Step 3 above.</p>
]]></content:encoded>
			<wfw:commentRss>http://infotexture.net/2009/11/snow-leopard-services-set-zip-file-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automator Workflow: Set ZIP File Date</title>
		<link>http://infotexture.net/2007/10/automator-workflow-set-zip-file-date/</link>
		<comments>http://infotexture.net/2007/10/automator-workflow-set-zip-file-date/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 13:03:23 +0000</pubDate>
		<dc:creator>roger</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Automator]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://blog.infotexture.net/index.php/2007/10/18/automator-workflow-set-zip-file-date/</guid>
		<description><![CDATA[When you compress a file or folder in the Finder via the Create Archive command, a ZIP file is created using the current date as modification date. But when you&#8217;re archiving older data, it&#8217;s much more useful for the ZIP file date to reflect the date of its contents, since a few years from now [...]]]></description>
			<content:encoded><![CDATA[<p>When you compress a file or folder in the Finder via the <strong>Create Archive</strong> command, a ZIP file is created using the current date as modification date.</p>

<p>But when you&#8217;re archiving older data, it&#8217;s much more useful for the ZIP file date to reflect the date of its contents, since a few years from now you probably won&#8217;t care when you compressed the stuff, but rather how old the files inside are.</p>

<p>Fortunately, the command line version of ZIP included in Mac OS X includes an option to do just this: <code>zip -o</code>, which according to the <code>man</code> page will</p>

<blockquote>
  <p>Set the &#8220;last modified&#8221; time of the zip archive to the latest (oldest) &#8220;last modified&#8221; time found among the entries in the zip archive</p>
</blockquote>

<p>&#8212;which is just what we want.</p>

<p>But depending on your command line proficiency, you may find it a bit tedious to open up a terminal window and look up the command syntax every time you need to compress a file.</p>

<p>Enter <em>Automator</em>, one of the most useful <em>(and unsung)</em> productivity tools in OS X, which we&#8217;ll use to create a new Finder plug-in (or &#8220;workflow&#8221;).</p>

<p>To create the workflow, open <code>/Applications/Automator.app</code> and add three  actions in this order:</p>

<ol>
<li>From the <strong>Finder</strong> library, drag the <strong>Get Selected Finder Items</strong> action to the workflow area on the right side of the window.</li>
<li><p>Drag the <strong>Create Archive</strong> Finder action to the workflow area, placing it after the first action. </p>

<p><em>(At this point, you can pre-specify a name and location for the archive file, or set the <strong>Options</strong> to prompt for this information when the workflow runs.)</em></p></li>
<li>From the <strong>Automator</strong> library, add the <strong>Run Shell Script</strong> action.
Leave the <strong>Shell</strong> set to <code>/bin/bash</code>, set <strong>Pass input</strong> to <code>as arguments</code>, and replace the default script in the text box with <code>zip -o "$@"</code>.</li>
</ol>

<p>That&#8217;s it!&#8212;Save the workflow as a Finder Plug-in, and you can run it on files &amp; folders in the Finder by Control-clicking and choosing your new command from the <strong>Automator</strong> submenu in the shortcut menu.</p>
]]></content:encoded>
			<wfw:commentRss>http://infotexture.net/2007/10/automator-workflow-set-zip-file-date/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

