<?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>raoli.com &#187; AppleScript</title>
	<atom:link href="http://raoli.com/category/applescript/feed/" rel="self" type="application/rss+xml" />
	<link>http://raoli.com</link>
	<description>random and occassionally coherent musings</description>
	<lastBuildDate>Thu, 27 May 2010 13:02:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Automating the Amazon MP3 Downloader</title>
		<link>http://raoli.com/2007/12/02/automating-the-amazon-mp3-downloader/</link>
		<comments>http://raoli.com/2007/12/02/automating-the-amazon-mp3-downloader/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 05:27:13 +0000</pubDate>
		<dc:creator>Eric Blair</dc:creator>
				<category><![CDATA[AppleScript]]></category>

		<guid isPermaLink="false">http://raoli.com/2007/12/02/automating-the-amazon-mp3-downloader/</guid>
		<description><![CDATA[It&#8217;s Amazon day at raoli.com, as I finally got around to trying Amazon MP3 and the Amazon MP3 Downloader app. At first, I wasn&#8217;t seeing the downloader launch automatically, then it dawned on me that said behavior was probably tied to Safari&#8217;s Open &#8220;safe&#8221; files after downloading preference.1
Between security concerns and general annoyance, I&#8217;d turned [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s Amazon day at raoli.com, as I finally got around to trying <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Famazon.com%2Fmp3&amp;tag=raolicom-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">Amazon MP3</a> and the Amazon MP3 Downloader app. At first, I wasn&#8217;t seeing the downloader launch automatically, then it dawned on me that said behavior was probably tied to Safari&#8217;s Open &#8220;safe&#8221; files after downloading preference.<sup>1</sup></p>
<p>Between security concerns and general annoyance, I&#8217;d turned this feature off some time ago. In Amazon&#8217;s case, I actually wanted this functionality. A short AppleScript later and I had a working solution.</p>
<pre><code>on adding folder items to this_folder after receiving added_items
    repeat with item_ in added_items
        tell application "Finder"

            if name extension of item_ is "amz" then
                open item_
            end if

        end tell
    end repeat
end adding folder items to
</code></pre>
<p>Save the script to ~/Library/Scripts/Folder Action Scripts/. In the Finder, navigate to your downloads folder, select Attach a Folder Action&#8230; from the contextual menu, and locate your newly saved script in the resulting file selection dialog. Now, whenever you download a new amz file from Amazon MP3, the Amazon MP3 Downloader will launch. Nothing earth-shattering, but I found that it improved the shopping experience.</p>
<p>Should you at some point activate the Open safe files&#8230; option in Safari, I&#8217;d recommend disabling this folder action. I haven&#8217;t done any testing, so I don&#8217;t know how well using both would or would not work.</p>
<ol class="footnotes">
<li id="footnote_0_372" class="footnote">Yeah, putting &#8220;safe&#8221; in quotes sounds <em>really</em> reassuring.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://raoli.com/2007/12/02/automating-the-amazon-mp3-downloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EagleFiler 1.2.6</title>
		<link>http://raoli.com/2007/10/24/eaglefiler-126/</link>
		<comments>http://raoli.com/2007/10/24/eaglefiler-126/#comments</comments>
		<pubDate>Wed, 24 Oct 2007 19:46:39 +0000</pubDate>
		<dc:creator>Eric Blair</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://raoli.com/2007/10/24/eaglefiler-126/</guid>
		<description><![CDATA[EagleFiler 1.2.6 has been released and it incorporates the work I&#8217;ve did on the MarsEdit capture script.1
Michael added support for setting the source URL to the post&#8217;s permalink. Among other things, this activates the Open Source URL command in the Record menu.
If you&#8217;ve got my capture script installed in EagleFiler&#8217;s Application Support folder, you won&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://c-command.com/eaglefiler/">EagleFiler 1.2.6</a> has been released and it incorporates the work I&#8217;ve did on the <a href="http://raoli.com/2007/09/19/marsedit-to-eaglefiler/">MarsEdit capture script</a>.<sup>1</sup></p>
<p>Michael added support for setting the source URL to the post&#8217;s permalink. Among other things, this activates the Open Source URL command in the Record menu.</p>
<p>If you&#8217;ve got my capture script installed in EagleFiler&#8217;s Application Support folder, you won&#8217;t see this new functionality &#8212; EagleFilers gives precedence to user-installed scripts over its own bundled scripts. If you&#8217;re just using the capture script as I originally posted it, you can delete my script. You&#8217;ll gain the source URL functionality without losing anything.</p>
<p>If you&#8217;ve customize the capture script to better suit your workflow, you can apply Michael&#8217;s change to add support for setting the source URL. Just replace this line:</p>
<pre><code>return {{|path|:tempPath, |title|:theTitle, tags:theTags, |deleteWhenDone|:true, |note|:theNote}}
</code></pre>
<p>with the following (sorry about the long lines):</p>
<pre><code>if thePermalink is not "" then
    return {{|path|:tempPath, |title|:theTitle, tags:theTags, |deleteWhenDone|:true, |note|:theNote, |sourceURL|:thePermalink}}
else
    return {{|path|:tempPath, |title|:theTitle, tags:theTags, |deleteWhenDone|:true, |note|:theNote}}
end if
</code></pre>
<hr />
<p>While checking out the <a href="http://c-command.com/blog/2007/10/24/eaglefiler-126/">change notes</a> for the updated EagleFiler, I noticed the following line:</p>
<blockquote>
<p>You can now <a href="http://c-command.com/eaglefiler/manual-ah/writing-capture-scripts">modify capture scripts</a> while EagleFiler is open without having to relaunch for it to notice the changes.</p>
</blockquote>
<p>Thank you. Thank You! ThanksYouThankYouThankYouThankYou!</p>
<p>(Can you tell I hit this issue while writing the original capture script?)</p>
<p>Oh, did I say thank you?</p>
<hr />
<p>I&#8217;ve been playing around with an updated capture script on my own system, but I&#8217;ve been hesitant to post it because it relies on components that are part of a stock Tiger installation. I want to check out whether the situation is any different when running Leopard. I&#8217;m not sure when I&#8217;ll get around to upgrading, though.</p>
<ol class="footnotes">
<li id="footnote_0_362" class="footnote">The new raoli.com: all capture scripts, all the time.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://raoli.com/2007/10/24/eaglefiler-126/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EagleFiler and MarsEdit 1.2</title>
		<link>http://raoli.com/2007/10/23/eaglefiler-and-marsedit-12/</link>
		<comments>http://raoli.com/2007/10/23/eaglefiler-and-marsedit-12/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 19:54:34 +0000</pubDate>
		<dc:creator>Eric Blair</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://raoli.com/2007/10/23/eaglefiler-and-marsedit-12/</guid>
		<description><![CDATA[If you&#8217;ve tried using using my EagleFiler Capture Script with MarsEdit 1.x, you&#8217;ve probably noticed that it doesn&#8217;t work &#8212; EagleFiler claims it doesn&#8217;t support capturing from MarsEdit.
The solution is to rename the capture script from com.red-sweater.marsedit.applescript to com.ranchero.MarsEdit.applescript. Once you do this, EagleFiler will recognize the older version of MarsEdit.
You&#8217;ll also need to comment [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve tried using using my <a href="http://raoli.com/2007/09/19/marsedit-to-eaglefiler/">EagleFiler Capture Script</a> with MarsEdit 1.x, you&#8217;ve probably noticed that it doesn&#8217;t work &#8212; EagleFiler claims it doesn&#8217;t support capturing from MarsEdit.</p>
<p>The solution is to rename the capture script from <code>com.red-sweater.marsedit.applescript</code> to <code>com.ranchero.MarsEdit.applescript</code>. Once you do this, EagleFiler will recognize the older version of MarsEdit.</p>
<p>You&#8217;ll also need to comment out or delete the two lines in the script that begin with <code>if theVersion &#8805; 2</code>. As the line implies, the functionality is only present in the newer version of MarsEdit. I had assumed that including the conditional statement would allow the script to run with older versions of MarsEdit, but it would appear that I was wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://raoli.com/2007/10/23/eaglefiler-and-marsedit-12/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MarsEdit to EagleFiler</title>
		<link>http://raoli.com/2007/09/19/marsedit-to-eaglefiler/</link>
		<comments>http://raoli.com/2007/09/19/marsedit-to-eaglefiler/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 23:58:15 +0000</pubDate>
		<dc:creator>Eric Blair</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://raoli.com/2007/09/19/marsedit-to-eaglefiler/</guid>
		<description><![CDATA[Update (11/24/07): EagleFiler 1.2.6 now includes built-in support for capturing from MarsEdit that expands on this capture script. That capture script is located inside the EagleFiler application, in the Contents/Resources/Capture Scripts/ folder. More information is available here.

With MarsEdit 2.0&#8217;s release, I&#8217;ve decided to re-evaluate my post management scheme. Previously, I created my posts in BBEdit, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update (11/24/07)</strong>: <a href="http://c-command.com/eaglefiler/index">EagleFiler 1.2.6</a> now includes built-in support for capturing from MarsEdit that expands on this capture script. That capture script is located inside the EagleFiler application, in the Contents/Resources/Capture Scripts/ folder. More information is <a href="http://raoli.com/2007/10/24/eaglefiler-126/" title="EagleFiler 1.2.6">available here</a>.</p>
<hr />
<p>With <a href="http://www.red-sweater.com/marsedit/">MarsEdit 2.0</a>&#8217;s release, I&#8217;ve decided to re-evaluate my post management scheme. Previously, I created my posts in BBEdit, then <a href="http://raoli.com/2004/10/09/bbedit-to-marsedit/" title="BBEdit to MarsEdit">moved</a> them over MarsEdit via an AppleScript. I did this because I wanted to have copies of my posts archived on my hard drive and not lost whenever I refreshed my weblog in MarsEdit. A downside to this approach is that I end up underusing MarsEdit&#8217;s Draft&#8217;s functionality &#8212; I&#8217;d either keep the BBEdit window open the whole time I was working on a post or I&#8217;d save the post to my Posting directory and have to remember finish editing it at a later date.</p>
<p>My app tool-chain has shifted a bit over the last 3 years, so I now have a few more options at my disposal. One of those is <a href="http://c-command.com/eaglefiler/index">EagleFiler</a>. My new workflow is to compose and post in MarsEdit, then move the completed post of to Eagle Filer. To facilitate this, I&#8217;ve written an EagleFiler capture script for MarsEdit &#8212; to archive my post, I simply need to hit F1.</p>
<p>The script&#8217;s a bit long to include here, so I&#8217;m just going to post it for download.</p>
<p><a href="http://raoli.com/wp-content/uploads/2007/09/com.red-sweater.marsedit.applescript.zip">Download MarsEdit Capture Script</a></p>
<p>To use this script, save it to ~/Library/Application Support/EagleFiler/Capture Scripts/, creating the last folder if necessary.</p>
<p>There are a few notes about what information is available for capture. First, you can&#8217;t capture a draft from the main MarsEdit window, only from the individual post window. Second, drafts which you have saved locally will have a value for date published. I believe this is the date the draft was first saved. Third, posts captured from the post window will not have a permalink value. Hopefully, future updates to MarsEdit will allow me to rectify at least a few of these.</p>
<p>There&#8217;s certainly room for some individualization in this script. Though I&#8217;ve stripped out the modification for public usage, my personal copy of this script adds some custom tags to each posting and sets BBEdit as the file creator. Another modification I&#8217;ve seen is adding the category information to the text of the posting. Additionally, you could add support for creating EagleFiler tags out of post keywords in addition/in place of post categories. Since Wordpress doesn&#8217;t support keywords, I didn&#8217;t implement this.</p>
<p>If you do edit the capture script after installing it, you&#8217;ll need to restart EagleFiler so the application will see the changes.</p>
<p>I wrote and tested this script for use with Wordpress blog. As far as other blogging packages are concerned, the script appears not to fail, though I can&#8217;t guarantee it&#8217;ll actually work.</p>
]]></content:encoded>
			<wfw:commentRss>http://raoli.com/2007/09/19/marsedit-to-eaglefiler/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.243 seconds -->
