<?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 Terpstraosx page  - Brett Terpstra</title>
	<atom:link href="http://brettterpstra.com/tag/osx/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>Spotlight tricks: search by category</title>
		<link>http://brettterpstra.com/spotlight-tricks-search-by-category/</link>
		<comments>http://brettterpstra.com/spotlight-tricks-search-by-category/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 13:51:56 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[spotlight]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3953</guid>
		<description><![CDATA[<p>You know those categories the App Stores use to sort applications by their intended use? You can use those in Spotlight on iOS. Did you know you can do that on your Mac, too? I didn’t, and I didn’t find many references to this on the web, so I’ll share the discovery: I was thinking about Spotlight on my iPhone&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/spotlight-tricks-search-by-category/">Spotlight tricks: search by category</a></p>]]></description>
			<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/04/categorymusic.jpg?9d7bd4" alt="Categorymusic" title="categorymusic.jpg" border="0" width="350" height="271" class="alignright shadow" />You know those categories the App Stores use to sort applications by their intended use? You can use those in Spotlight on iOS. Did you know you can do that on your Mac, too? I didn’t, and I didn’t find many references to this on the web, so I’ll share the discovery:</p>

<p>I was thinking about Spotlight on my iPhone and iPad, where I can just type a keyword and see apps that have nothing in their title about the search. I love that, because once you get enough apps it’s really easy to forget their names. I thought I’d try it on Lion.</p>

<p>First, I searched “productivity kind:app” in Spotlight on my Lion system… and it worked. All the apps built with recent versions of Xcode (which allows for categorization in info.plist) showed up, including non-Mac App Store apps. A little metadata inspection and I found a query syntax specifically for this purpose: <code>category:</code>. If you type “category:news” in Spotlight, you’ll get all of your News applications. You can save these as Smart Folders in Finder, too, and replicate Lion’s Launchpad to some extent.</p>

<p>Useful for forgetful people like me. I don’t know yet if it works anywhere other than Lion, but give it a shot.</p>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/fixing-spotlight-indexing-of-markdown-content/' rel='bookmark' title='Fixing Spotlight indexing of Markdown content'>Fixing Spotlight indexing of Markdown content</a></li>
<li><a href='http://brettterpstra.com/app-review-tunesque/' rel='bookmark' title='App Review: Tunesque'>App Review: Tunesque</a></li>
<li><a href='http://brettterpstra.com/app-review-launchpad-control/' rel='bookmark' title='App review: Launchpad-Control'>App review: Launchpad-Control</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/spotlight-tricks-search-by-category/">Spotlight tricks: search by category</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/spotlight-tricks-search-by-category/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New text navigation KeyBindings</title>
		<link>http://brettterpstra.com/new-text-navigation-keybindings/</link>
		<comments>http://brettterpstra.com/new-text-navigation-keybindings/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 17:59:12 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[keybindings]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3941</guid>
		<description><![CDATA[<p>I haven’t had much time to write here this week thanks to some day job stress, major additions to Marked, writing for other venues, updating iTextEditors and various other fun. I had a brainstorm that resulted in new KeyBindings this morning, though, and thought it would be a good chance to get a post up before anyone thinks I’ve been&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/new-text-navigation-keybindings/">New text navigation KeyBindings</a></p>]]></description>
			<content:encoded><![CDATA[<p>I haven’t had much time to write here this week thanks to some day job stress, major additions to Marked, writing for other venues, updating iTextEditors and various other fun. I had a brainstorm that resulted in new KeyBindings this morning, though, and thought it would be a good chance to get a post up before anyone thinks I’ve been kidnapped.</p>

<p>In case you’ve missed my past keybinding craziness, you can catch up on the evolution <a href="http://brettterpstra.com/tag/keybindings/">in the tag archive</a>. Basically, OS X has a text system that lets you add custom commands and shortcuts that trigger sequences of the text commands you use every day (e.g. option-arrow word navigation, command-arrow to end of line, etc.).</p>

<p>My shorcut collection is pretty extensive (and beyond even my capability to memorize), but you can pick and choose what’s handy for you and create your own KeyBindings.dict file from it. The latest versions are always <a href="https://github.com/ttscoff/KeyBindings">up on Github</a>.</p>

<p><span id="more-3941"></span></p>

<h3>Paragraph navigation</h3>

<p>The new bindings are primarily for paragraph navigation. One of the features I’ve come to love in several code editing applications is the ability to jump to the first character in the line (after any whitespace). So I added Command-Option-Left/Right Arrow navigation to do just that (and handle last character before trailing whitespace as well). I also added one that jumps to the first alphanumeric character in the line, which is great when working with Markdown lists. The unordered ones, at least, because numbers will stop the movement and it has the same result as jump to first character. This is bound to Control-Command-Option-Left Arrow. You can use them from anywhere in the paragraph, even if you’re at the beginning of a line and intuitively think that left arrow will move backward… with these commands it will always jump to the first character even if it’s in front of the cursor.</p>

<p>Jumping to the last character is cool, but in most of my work any whitespace after that shouldn’t be there. Even when I’m just writing Markdown, I don’t want any extra space triggering a hard line break accidentally. I added one more command to the set for this purpose: Control-Option-Right Arrow jumps to the last character and deletes any space following it. In a similar vein, I updated the Full Outdent command (Control-Shift-Command-Left Arrow) to use the same technique, no longer deleting the first character if the line was already fully outdented.</p>

<p><code>~/Library/KeyBindings/DefaultKeyBinding.dict</code> code for all of the above:</p>

<pre><code>// Move to first Alphanumeric character of line (new)
  "@~^\UF702" = (moveToBeginningOfParagraph:,moveWordRight:, moveWordLeft:);
// Move to first non-whitespace character of line (new)
"@~\UF702" = (moveToBeginningOfParagraph:, insertText:, " ", moveLeft:, selectWord:, moveRight:, setMark:, moveToBeginningOfParagraph:, deleteForward:, swapWithMark:, moveLeft:);
// Select to first character of line with leading space (new)
"@~$\UF702" = (setMark:,moveToBeginningOfParagraph:,selectWord:, moveRight:, selectToMark:);
// Move to last non-whitespace character of paragraph (new)
"~@\UF703" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, moveLeft:, setMark:, moveToEndOfParagraph:, deleteBackward:, swapWithMark:);
// Move to end of paragraph and delete trailing whitespace (new)
"^~\UF703" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, deleteBackward:);
</code></pre>

<h3>Markdown line breaks</h3>

<p>Lastly, this somehow inspired me to add a couple of linebreak commands. In Markdown, adding two spaces at the end of a line causes it to be interpreted as a hard break instead of just concatenating the next line to it in a paragraph. I bound Control-Option-Return to add these spaces to the end of the current line–regardless of cursor position–and begin a new line.</p>

<p>The other line break command (Control-Command-Return) is Markdown again, this time adding two spaces and starting a new paragraph from the cursor position; basically just a way to add a quick hard line break in the middle of a paragraph. This binding conflicts with the Line Focus shortcut in Byword<sup id="fnref:cmdenter"><a href="#fn:cmdenter" rel="footnote">1</a></sup>, by the way, so if I get used to using it I’ll either change the binding in Byword (I never use line focus) or update my own bindings. Feel free to change it to whatever is intuitive to you, keeping in mind that control-enter and shift-enter may already be bound to behaviors in the Cocoa application you’re working in.</p>

<p>Here’s the code for these:</p>

<pre><code>// Add hard break for current line and insert newline below (new)
"^~\U000D" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, deleteBackward:, insertText:, "  ", insertNewline:);
// Break line at cursor and add Markdown hard line break (new)
"^@\U000D" = (insertText:, "  ", insertNewline:);
</code></pre>

<h3>Cheatsheet</h3>

<p>In addition to the readme.md file in the repo, I’ve updated the <a href="http://brettterpstra.com/cheaters-customizable-cheat-sheet-system/">Cheaters</a> cheat sheet for the KeyBindings (because I regularly lose track of the shortcuts for lesser-used bindings). The new sheet is available <a href="https://gist.github.com/2465402">as a gist</a> or you can just right-click and <a href="https://raw.github.com/gist/2465402/7093bbd405dea7c1b424ecab76e92290725fab07/keybindings.html">download the raw file</a>. If you have a default install of Cheaters, you can just overwrite the old <code>keybindings.html</code> file with this one. The new keybindings are marked with “(new)” in green, which is mostly for my own good in locating them quickly<sup id="fnref:search"><a href="#fn:search" rel="footnote">2</a></sup>.</p>

<p>Grab the whole thing from the <a href="https://github.com/ttscoff/KeyBindings">KeyBindings repo on Github</a>.</p>

<p>I know, I’m a little crazy.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:cmdenter">
<p>Command-Enter–my TextMate-style binding for starting a new paragraph from anywhere within a line without breaking it–also conflicts with the full-screen keyboard shortcut. I overrode that one in Byword using System Preferences-&gt;Keyboard-&gt;Applications, but I also include Option-O and Option-Shift-O (Vim-like) in the default file for this reason. <a href="#fnref:cmdenter" rev="footnote">↩</a></p>
</li>

<li id="fn:search">
<p>I really want to add an in-page search to Cheaters. It would greatly improve its usefulness for me if I could just quickly type any part of what I’m looking for and jump to the info. I’ll work on that soon, I think. <a href="#fnref:search" rev="footnote">↩</a></p>
</li>

</ol>
</div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/keybindings-new-improved-surround-commands/' rel='bookmark' title='KeyBindings: new, improved “surround” commands'>KeyBindings: new, improved “surround” commands</a></li>
<li><a href='http://brettterpstra.com/textmate-keybinding-tip/' rel='bookmark' title='A quick TextMate KeyBindings tip'>A quick TextMate KeyBindings tip</a></li>
<li><a href='http://brettterpstra.com/quick-tip-repeat-cocoa-text-actions-emacsvim-style/' rel='bookmark' title='Quick Tip: repeat Cocoa text actions, Emacs/Vim style'>Quick Tip: repeat Cocoa text actions, Emacs/Vim style</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/new-text-navigation-keybindings/">New text navigation KeyBindings</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/new-text-navigation-keybindings/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>MultiMarkdown Quick Look with Style</title>
		<link>http://brettterpstra.com/multimarkdown-quick-look-with-style/</link>
		<comments>http://brettterpstra.com/multimarkdown-quick-look-with-style/#comments</comments>
		<pubDate>Mon, 19 Mar 2012 23:43:04 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[markdown]]></category>
		<category><![CDATA[multimarkdown]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[quicklook]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3798</guid>
		<description><![CDATA[<p>I added a little hack to Fletcher Penney’s MultiMarkdown Quick Look generator to give it a default style (Github CSS) and allow for customization via a .mdqlstyle.css file located in your home folder. Full details and download available on Github. Screenshot of a Quick Look preview using the Upstanding Citizen style (available on the Github page): I have found that&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/multimarkdown-quick-look-with-style/">MultiMarkdown Quick Look with Style</a></p>]]></description>
			<content:encoded><![CDATA[<p>I added a little hack to Fletcher Penney’s MultiMarkdown Quick Look generator to give it a default style (Github CSS) and allow for customization via a <code>.mdqlstyle.css</code> file located in your home folder. Full details and download available <a href="https://github.com/ttscoff/MMD-QuickLook">on Github</a>.</p>

<p>Screenshot of a Quick Look preview using the Upstanding Citizen style (available on the Github page):</p>

<p><img src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/MMDQLUpstandingCropped.jpg?9d7bd4" alt="Upstanding Citizen preview" /></p>

<p>I have found that some Markdown tools which come with their own Quick Look generators will always override my custom one, even when they aren’t the file’s owner (e.g. iA Writer). I don’t know how to get around this short of the brute force hack: open the <code>Info.plist</code> inside the qlgenerator file within the offending app’s bundle and delete the entry for <code>net.daringfireball.markdown</code>. That, or just delete the .qlgenerator bundle in the app entirely. That only works until the next time you upgrade, though, and it’s not recommended. If anyone knows a better solution, please shout.</p>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/marked-1-3-1-more-multimarkdown-goodies/' rel='bookmark' title='Marked 1.3.1, more MultiMarkdown goodies'>Marked 1.3.1, more MultiMarkdown goodies</a></li>
<li><a href='http://brettterpstra.com/notational-velocity-and-multimarkdown/' rel='bookmark' title='Notational Velocity and MultiMarkdown'>Notational Velocity and MultiMarkdown</a></li>
<li><a href='http://brettterpstra.com/notational-velocity-alternative-multimarkdown-version/' rel='bookmark' title='Notational Velocity alternative MultiMarkdown version'>Notational Velocity alternative MultiMarkdown version</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/multimarkdown-quick-look-with-style/">MultiMarkdown Quick Look with Style</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/multimarkdown-quick-look-with-style/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Introducing Gather, a Cocoa Markdownifier</title>
		<link>http://brettterpstra.com/introducing-gather-a-cocoa-markdownifier/</link>
		<comments>http://brettterpstra.com/introducing-gather-a-cocoa-markdownifier/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 02:43:36 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[markdown]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3619</guid>
		<description><![CDATA[<p>I wrote something a couple of nights ago that I thought I’d share. I’m calling it “Gather,” and it’s basically an “appified” version of my Readability/Markdownify work. A Cocoa version of Marky the Markdownifier, if you will. You can paste in a URL and it will attempt to find the core text of the page, download it and turn it&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/introducing-gather-a-cocoa-markdownifier/">Introducing Gather, a Cocoa Markdownifier</a></p>]]></description>
			<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/02/GatherNew250.png?9d7bd4" alt="" title="GatherNew250" width="250" height="250" class="alignright size-full wp-image-3624" />I wrote something a couple of nights ago that I thought I’d share. I’m calling it “Gather,” and it’s basically an “appified” version of my <a href="http://brettterpstra.com/scripting-readability-markdownify-for-clipping-web-pages/">Readability/Markdownify</a> work. A Cocoa version of <a href="http://markdownrules.com/">Marky the Markdownifier</a>, if you will. You can paste in a URL and it will attempt to find the core text of the page, download it and turn it into Markdown for clean web clipping. It displays the result in a field you can copy from, and it can optionally auto-copy the result to your clipboard.</p>

<p>It’s a little shaky, especially on sites with bad markup. I’d say that right now it has about a 60% success rate. As I have time to work on it I’ll be improving this and adding a bevy of features that may eventually become an App Store submission. We’ll see. This proof-of-concept version<sup id="fnref:icon"><a href="#fn:icon" rel="footnote">1</a></sup>, however, is free to download. I’ll ask nicely that you please not steal the idea and <a href="http://www.youtube.com/watch?v=PyupJo5SRHI&amp;feature=related">beat me to the punch</a>.</p>

<p>This build is Lion-only; it won’t run at all on Snow Leopard. I’m not really taking any feature suggestions right now, as I already have an extensive roadmap for it that will turn it into something highly useful in many situations (and I’m quite aware of what it lacks in this state). I <em>would</em> enjoy hearing from you with your reactions, though.</p>

<h3>Credit due</h3>

<p>This version uses <a href="https://github.com/curthard89/COCOA-Stuff/tree/master/GGReadabilityParser">GGReadability</a> by Curtis Hard. You should definitely check out his work-in-progress app, <a href="http://www.geekygoodness.com/">Caffeinated</a>. It’s an RSS reader with Google Reader support and some serious potential. I’m also using <a href="http://www.aaronsw.com/2002/html2text/">HTML2Text</a> for “markdownifying.”</p>

<p>Enjoy.</p>

<h3>Download</h3>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/Gather0.1.zip?9d7bd4" title="Download Gather (437)"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/downloads/thumbnails/2012/02/GatherNew250.png?9d7bd4" alt="download image for Gather" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/Gather0.1.zip?9d7bd4" title="Download Gather (437)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/Gather0.1.zip?9d7bd4" title="Download Gather (437)">Gather</a> — Turn web pages into clean Markdown for clipping. <a href="http://brettterpstra.com/introducing-gather-a-cocoa-markdownifier">More Info</a></p></div>

<div class="footnotes">
<hr />
<ol>

<li id="fn:icon">
<p>I know the icon is pretty terrible. I liked my <a href="http://cdn2.brettterpstra.com/wp-content/uploads/2012/02/GatheredOriginal.png?9d7bd4">first version</a> when it was in Photoshop, but it looked horrible in the Dock. It’ll get better. <a href="#fnref:icon" rev="footnote">↩</a></p>
</li>

</ol>
</div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/meet-marky-the-markdownifier/' rel='bookmark' title='Meet Marky, the Markdownifier'>Meet Marky, the Markdownifier</a></li>
<li><a href='http://brettterpstra.com/introducing-the-marked-bonus-pack/' rel='bookmark' title='Introducing the Marked Bonus Pack'>Introducing the Marked Bonus Pack</a></li>
<li><a href='http://brettterpstra.com/instapaper-beyond-bugs/' rel='bookmark' title='Instapaper Beyond Bugs (fixed)'>Instapaper Beyond Bugs (fixed)</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/introducing-gather-a-cocoa-markdownifier/">Introducing Gather, a Cocoa Markdownifier</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/introducing-gather-a-cocoa-markdownifier/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Connecting nvALT and Address Book</title>
		<link>http://brettterpstra.com/connecting-nvalt-and-address-book/</link>
		<comments>http://brettterpstra.com/connecting-nvalt-and-address-book/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 03:11:46 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[nvalt]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3615</guid>
		<description><![CDATA[<p>Here’s a quick, simple AppleScript to help you hook Notational Velocity/nvALT into Address Book. I sometimes want to attach a note or list of links to an entry in my address book, but I don’t like using the notes field. I tend to keep all of my notes1 in nvALT, and I prefer not to scatter them too far. All&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/connecting-nvalt-and-address-book/">Connecting nvALT and Address Book</a></p>]]></description>
			<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/02/Johnny-Appleseed.jpg?9d7bd4" alt="" title="Johnny Appleseed" width="300" height="199" class="alignright size-full wp-image-3616" />Here’s a quick, simple AppleScript to help you hook <a href="http://notational.net/">Notational Velocity</a>/<a href="http://brettterpstra.com/project/nvalt/">nvALT</a> into Address Book. I sometimes want to attach a note or list of links to an entry in my address book, but I don’t like using the notes field. I tend to keep <em>all</em> of my notes<sup id="fnref:diff"><a href="#fn:diff" rel="footnote">1</a></sup> in nvALT, and I prefer not to scatter them too far. All I needed was a way to quickly create and link an nvALT note to each address…</p>

<p>As of recent versions, Notational Velocity and nvALT have a URL handler for nv:// (or nvalt://). Using the <code>/find/</code> parameter allows you to initiate a search in NV from a link, e.g. <code>nv://find/abnote%3AJohnny Appleseed</code>. If you use a unique prefix and full name, you can pinpoint a single note without having to create a file or locate the note’s ID. The first time you click the link, it will open a search in NV, and pressing Return will create the note and begin editing. Once the note is there, it will locate it instantly the next time you click the link.</p>

<p>I’m using the prefix “abnote:” on my notes. This AppleScript will create the URL entry automatically from the selected entries’ first and last names, and you can edit the prefix in the script to be anything you like. Just save it as “Add NV Note.scpt” in <code>~/Library/Scripts/Applications/Address Book</code> and it will show up in your script menu<sup id="fnref:menu"><a href="#fn:menu" rel="footnote">2</a></sup> when you’re in Address Book. You can run it on a bunch of entries (it’s not optimized to run on an entire large address book, though), or one at a time as you need it.</p>

<p>I wrote this on Lion. I honestly have no idea if it works on anything earlier. It might<sup id="fnref:might"><a href="#fn:might" rel="footnote">3</a></sup>.</p>

<h2>The script</h2>


<div class="wp_syntax"><div class="code"><pre class="applescript"><span class="kw3">tell</span> <span class="kw1">application</span> <span class="st0">&quot;Address Book&quot;</span>
	<span class="kw3">set</span> thePeople <span class="kw3">to</span> <span class="kw2">the</span> <span class="kw1">selection</span>
	<span class="kw3">repeat</span> <span class="kw3">with</span> thisPerson <span class="kw3">in</span> thePeople
		<span class="kw3">set</span> theName <span class="kw3">to</span> <span class="kw1">name</span> <span class="kw3">of</span> thisPerson <span class="kw2">as</span> <span class="kw1">string</span>
		<span class="kw1">make</span> <span class="kw1">new</span> url at <span class="kw3">end</span> <span class="kw3">of</span> urls <span class="kw3">of</span> thisPerson <span class="kw3">with</span> <span class="kw1">properties</span> <span class="br0">&#123;</span>label:<span class="st0">&quot;NV Note&quot;</span>, value:<span class="st0">&quot;nv://find/abnote%3A&quot;</span> <span class="sy0">&amp;</span> theName<span class="br0">&#125;</span>
	<span class="kw3">end</span> <span class="kw3">repeat</span>
	<span class="kw1">save</span>
<span class="kw3">end</span> <span class="kw3">tell</span></pre></div></div>


<div class="footnotes">
<hr />
<ol>

<li id="fn:diff">
<p>Notes, for me, are different from <a href="http://brettterpstra.com/logging-with-day-one-geek-style/">log entries</a>. I actually <em>like</em> keeping those separate most of the time. <a href="#fnref:diff" rev="footnote">↩</a></p>
</li>

<li id="fn:menu">
<p>Enabled in AppleScript Editor, Preferences-&gt;General-&gt;Show Script menu in menubar. Or better, use <a href="http://www.red-sweater.com/fastscripts/">FastScripts</a>. <a href="#fnref:menu" rev="footnote">↩</a></p>
</li>

<li id="fn:might">
<p>It might not. <a href="#fnref:might" rev="footnote">↩</a></p>
</li>

</ol>
</div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/address-book-search-and-skype-from-the-command-line/' rel='bookmark' title='Address Book search and Skype from the command line'>Address Book search and Skype from the command line</a></li>
<li><a href='http://brettterpstra.com/nvalt-2-1-in-the-wild/' rel='bookmark' title='nvALT 2.1 in the wild'>nvALT 2.1 in the wild</a></li>
<li><a href='http://brettterpstra.com/nvalt-1-0-8-progress/' rel='bookmark' title='nvALT 1.0.8 progress'>nvALT 1.0.8 progress</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/connecting-nvalt-and-address-book/">Connecting nvALT and Address Book</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/connecting-nvalt-and-address-book/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>App Review: CodeRunner</title>
		<link>http://brettterpstra.com/app-review-coderunner/</link>
		<comments>http://brettterpstra.com/app-review-coderunner/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 00:16:48 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[appreview]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/app-review-coderunner/</guid>
		<description><![CDATA[<p>One for the coders: I discovered CodeRunner by Nikolai Krill a few months back, and it’s proven to be very, very useful in the kind of work that I do. It allows you to test blocks of code and see the results quickly and easily. It has syntax highlighting and autocompletion, as well as the ability to handle a wide&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/app-review-coderunner/">App Review: CodeRunner</a></p>]]></description>
			<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2011/10/coderunnerscreenshot.jpg?9d7bd4" alt="CodeRunner Screenshot" height="279" width="300" class="alignright shadow"></p>

<p>One for the coders: I discovered <a href="http://itunes.apple.com/us/app/coderunner/id433335799?mt=12">CodeRunner</a> by Nikolai Krill a few months back, and it’s proven to be very, very useful in the kind of work that I do. It allows you to test blocks of code and see the results quickly and easily. It has syntax highlighting and autocompletion, as well as the ability to handle a wide variety of languages.</p>

<p>CodeRunner handles AppleScript, C, C++, Java, JavaScript (Node.js), Objective-C, Perl, PHP, Python, Ruby and shell scripts. You can add your own languages, compilers/processors and syntaxes, too. The autocomplete libraries for each language are quite good (and very handy), and there are a good number of themes available for syntax highlighting (including my favorite, Twilight). It has auto-pairing and commands for wrapping code in a variety of paired characters, as well as a great set of code-editing tools. You can even pick between indenting with spaces or tabs and set the tab/space width, making it easy to match the code indentation to the settings of the main app you’re coding in.</p>

<p>CodeRunner can also handle code that requires input at runtime, providing a field for passing parameters and input to your functions as needed. In short, it does just about everything I could ask a code-testing application to do.</p>

<p>There are free apps for testing code, but very few that can handle multiple languages and none that I know of which can handle everything that CodeRunner does. If you code in more than one language, CodeRunner is worth every bit of its $4.99 price. <a href="http://itunes.apple.com/us/app/coderunner/id433335799?mt=12">Go get it.</a></p>

<p>Nikolai also has a regular expression testing app in the Mac App Store called <a href="http://itunes.apple.com/us/app/patterns-the-regex-app/id429449079?mt=12">Patterns</a>. I highly recommend it as well. The only issue I have with Patterns is that it doesn’t handle highlighting sub-matches, but for 90% of what I need it to do, it’s excellent.</p>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/app-review-livereload/' rel='bookmark' title='App Review: LiveReload'>App Review: LiveReload</a></li>
<li><a href='http://brettterpstra.com/ios-app-review-reading-list/' rel='bookmark' title='iOS App Review: Reading List'>iOS App Review: Reading List</a></li>
<li><a href='http://brettterpstra.com/ios-review-listary/' rel='bookmark' title='iOS app review: Listary'>iOS app review: Listary</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/app-review-coderunner/">App Review: CodeRunner</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/app-review-coderunner/feed/</wfw:commentRss>
		<slash:comments>4</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 17/84 queries in 0.104 seconds using xcache
Object Caching 2094/2172 objects using xcache
Content Delivery Network via cdn2.brettterpstra.com

Served from: brettterpstra.com @ 2012-05-23 03:51:04 -->
