<?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>Brett Terpstragtd page  - Brett Terpstra</title>
	<atom:link href="http://brettterpstra.com/tag/gtd/feed/" rel="self" type="application/rss+xml" />
	<link>http://brettterpstra.com</link>
	<description>Elegant solutions to complex problems.</description>
	<lastBuildDate>Tue, 22 May 2012 02:49:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>A few scripts for TaskPaper users</title>
		<link>http://brettterpstra.com/a-few-scripts-for-taskpaper-users/</link>
		<comments>http://brettterpstra.com/a-few-scripts-for-taskpaper-users/#comments</comments>
		<pubDate>Sat, 08 May 2010 19:00:51 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[gtd]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[TaskPaper]]></category>
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=414</guid>
		<description><![CDATA[<p>I’ve been using Things for task management lately, mostly because it has a decent iPad app. I really do love my iPad… however, I often use TaskPaper from Hog Bay Software for weekend to-do lists and for tracking bugs and fixes on my various freetime projects. I sometimes edit my TaskPaper files (which are just plain text) in TextMate and&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/a-few-scripts-for-taskpaper-users/">A few scripts for TaskPaper users</a></p>]]></description>
			<content:encoded><![CDATA[<p>I’ve been using <a href="http://culturedcode.com/things/">Things</a> for task management lately, mostly because it has a decent iPad app. I really do love my iPad… however, I often use <a href="http://www.hogbaysoftware.com/products/taskpaper">TaskPaper</a> from <a href="http://www.hogbaysoftware.com/">Hog Bay Software</a> for weekend to-do lists and for tracking bugs and fixes on my various freetime projects. I sometimes edit my TaskPaper files (which are just plain text) in TextMate and use some Ruby scripts adapted from the GTDAlt bundle to do some fun things, but I really like the interface you get when you actually use TaskPaper. So I started scripting it…</p>

<p>There are three scripts I’m going to share, two are pure AppleScript and one depends on a Ruby library called “Chronic.” A download will be available at the end of the article that is an AppleScript bundle with the Ruby library included, so it should run fine without any extra hassle.</p>

<p>The first two scripts work in tandem, and increment and decrement the priority of the current or selected tasks. TaskPaper lets you add a value to a tag, e.g. @priority(4). These can be used for sorting or searching and can be very valuable. Read on for the scripts I’ve been using to make it even more so…</p>

<p><span id="more-414"></span>
The basic idea is to assign a keyboard shortcut to the scripts and be able to add a priority tag if it doesn’t exist, remove it if we decrement it below 1, and be able to change the priority incrementally with repeat keystrokes.</p>

<p>To add a script to TaskPaper, just pull down its script icon in the top menu and choose “Open Scripts Folder.” That’s where you’ll put your compiled scripts and they’ll show up in TaskPaper. Add keyboard shortcuts using the Keyboard Preference pane in System Preferences, adding an application shortcut for TaskPaper and setting it to the exact name of the menu item your script creates (the title of the script without the extension). I have my increment and decrement scripts set to  ⌘⇧- and ⌘⇧+ (command shift minus, and command shift plus).</p>

<h4>The increment priority script</h4>

<div markdown=0>
<pre><code>
tell application &quot;TaskPaper&quot;
    repeat with _task in selected entries as list
        if exists tag named &quot;priority&quot; of _task then
            set _val to value of tag named &quot;priority&quot; of _task as integer
            if _val &lt; 9 then
                set _val to _val + 1
                set value of tag named &quot;priority&quot; of _task to _val
            else if _val = 9 then
                tell _task to delete tag named &quot;priority&quot; of _task
            end if
        else
            tell _task to make tag with properties {name:&quot;priority&quot;, value:1}
        end if
    end repeat
end tell
</code></pre>
</div>

<h4>The decrement priority script</h4>

<div markdown=0>
<pre><code>
tell application "TaskPaper"
    repeat with _task in selected entries as list
        if exists tag named "priority" of _task then
            set _val to value of tag named "priority" of _task as integer
            if _val > 1 then
                set _val to _val - 1
                set value of tag named "priority" of _task to _val
            else if _val = 1 then
                tell _task to delete tag named "priority" of _task
            end if
        else
            tell _task to make tag with properties {name:"priority", value:5}
        end if
    end repeat
end tell
</code></pre>
</div>

<h4>The other script</h4>

<p>I’m just going to make this one available for download (see the bottom of the post for all three scripts) and not try to post the code here. What it does is expand natural language dates into a date format that TaskPaper and other scripts can easily recognize. It looks for @start() and @due() tags, and runs whatever value they contain through the Ruby Chronic library. This turns things like “next tuesday” and “in 3 days” into usable dates. I have it assigned to  ⌘= (command equal). It will function on the current line or an entire selection.</p>

<p>That’s it for now. I’ve got others, but some of them are too complicated to try to share, and some just do things I don’t think anyone else would actually want to do. If you have any questions or suggestions, though, feel free to comment or contact me!</p>

<h3>Download the scripts!</h3>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/TaskPaperScripts1.0.zip?9d7bd4" title="Download TaskPaper Scripts (600)"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/downloads/thumbnails/2010/09/taskpaperscripticon.png?9d7bd4" alt="download image for TaskPaper Scripts" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/TaskPaperScripts1.0.zip?9d7bd4" title="Download TaskPaper Scripts (600)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/TaskPaperScripts1.0.zip?9d7bd4" title="Download TaskPaper Scripts (600)">TaskPaper Scripts</a> — A few scripts for TaskPaper users. Allows keyboard shortcuts for incrementing and decrementing priority tags, and expansion of natural language dates in start and due tags. <a href="http://brettterpstra.com/2010/05/08/a-few-scripts-for-taskpaper-users/">More Info</a></p></div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/taskpaper-date-scripts/' rel='bookmark' title='Taskpaper Date Scripts'>Taskpaper Date Scripts</a></li>
<li><a href='http://brettterpstra.com/log-taskpaper-archives-to-day-one/' rel='bookmark' title='Log TaskPaper archives to Day One'>Log TaskPaper archives to Day One</a></li>
<li><a href='http://brettterpstra.com/totally-taskpaper/' rel='bookmark' title='Totally TaskPaper'>Totally TaskPaper</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/a-few-scripts-for-taskpaper-users/">A few scripts for TaskPaper users</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/a-few-scripts-for-taskpaper-users/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced
Database Caching 7/29 queries in 0.546 seconds using xcache
Object Caching 833/854 objects using xcache
Content Delivery Network via cdn2.brettterpstra.com

Served from: brettterpstra.com @ 2012-05-23 03:10:38 -->
