<?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>flickerbulb &#187; productivity</title>
	<atom:link href="http://flickerbulb.com/category/productivity/feed/" rel="self" type="application/rss+xml" />
	<link>http://flickerbulb.com</link>
	<description>soho zombie, slave to the man, code monkey, lover &#38; hater, and, one downright good looking bastard.</description>
	<lastBuildDate>Tue, 27 Apr 2010 03:09:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>post netnewswire item to delicious bookmarks applescript</title>
		<link>http://flickerbulb.com/2008/12/05/post-netnewswire-item-to-delicious-bookmarks-applescript/</link>
		<comments>http://flickerbulb.com/2008/12/05/post-netnewswire-item-to-delicious-bookmarks-applescript/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 13:00:56 +0000</pubDate>
		<dc:creator>chris corwin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[netnewswire]]></category>
		<category><![CDATA[quicksilver]]></category>

		<guid isPermaLink="false">http://flickerbulb.com/?p=1256</guid>
		<description><![CDATA[for blog reading i use the amazing (and free!) software from newsgator called NetNewsWire. i discovered an applescript for posting post currently being read to my delicious bookmarks. this was pretty good as it was, but, but i wanted a bit more, so i modified it to prompt for additional tags. i have also added [...]]]></description>
			<content:encoded><![CDATA[<p>for blog reading i use the amazing (and free!) software from <a href="http://www.newsgator.com/">newsgator</a> called <a href="http://www.newsgator.com/Individuals/NetNewsWire/">NetNewsWire</a>.</p>
<p>i discovered an <a href="http://futuremacblog.blogspot.com/2008/03/improved-netnewswire-to-delicious.html">applescript for posting post currently being read</a> to my <a href="http://delicious.com/BerberCarpet/">delicious bookmarks</a>.</p>
<p>this was pretty good as it was, but, but i wanted a bit more, so i modified it to prompt for additional tags.</p>
<p>i have also added support for growl notifications, if growl is running.</p>
<p>when you run the script for the first time, it prompts you enter your username, password, and default tags.</p>
<p>you only need to enter that stuff once: after that it just runs.</p>
<p>additionally, i set up a <a href="http://docs.blacktree.com/quicksilver/what_is_quicksilver">quickilver</a> trigger to run when i push &#8220;control + d&#8221;, scoped only to NNW.</p>
<p>so, now every time i wish to save whatever it is i am reading in NNW, i just hit &#8220;control + d&#8221; and it prompts for tags, then runs in the background.</p>
<p>its <strong>fast</strong> and works great.</p>
<p>to use it yourself, copy the script below and open the Script Editor (included in mac os x).</p>
<p>paste it in, and save it to:</p>
<p><code>~/Library/Scripts/Applications/NetNewsWire/to read in delicious.scpt</code></p>

<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;">&nbsp;
<span style="color: #b1b100;">property</span> usernamePasswordString : <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #b1b100;">property</span> tagsString : <span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #b1b100;">on</span> <span style="color: #000066;">run</span>
	checkUsernameAndPassword<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	postToDelicious<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #b1b100;">end</span> <span style="color: #000066;">run</span>
&nbsp;
<span style="color: #b1b100;">on</span> postToDelicious<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #b1b100;">tell</span> application <span style="color: #ff0000;">&quot;NetNewsWire&quot;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #000066;">exists</span> selectedHeadline <span style="color: #b1b100;">then</span>
&nbsp;
			<span style="color: #b1b100;">set</span> theResults <span style="color: #b1b100;">to</span> display dialog <span style="color: #ff0000;">&quot;Enter tags for this item&quot;</span> default answer <span style="color: #ff0000;">&quot;&quot;</span>
			<span style="color: #b1b100;">if</span> button returned <span style="color: #b1b100;">of</span> theResults <span style="color: #b1b100;">is</span> <span style="color: #ff0000;">&quot;OK&quot;</span> <span style="color: #b1b100;">then</span>
				<span style="color: #b1b100;">set</span> myTags <span style="color: #b1b100;">to</span> text returned <span style="color: #b1b100;">of</span> theResults
			<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">if</span>
&nbsp;
			<span style="color: #b1b100;">set</span> thisHeadline <span style="color: #b1b100;">to</span> <span style="color: #66cc66;">&#40;</span>title <span style="color: #b1b100;">of</span> selectedHeadline<span style="color: #66cc66;">&#41;</span>
&nbsp;
			<span style="color: #b1b100;">set</span> u <span style="color: #b1b100;">to</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>?&amp;url=&quot;</span> <span style="color: #66cc66;">&amp;</span> <span style="color: #66cc66;">&#40;</span>URL <span style="color: #b1b100;">of</span> selectedHeadline<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> Â¬
				<span style="color: #ff0000;">&quot;&amp;description=&quot;</span> <span style="color: #66cc66;">&amp;</span> <span style="color: #66cc66;">&#40;</span>title <span style="color: #b1b100;">of</span> selectedHeadline<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> Â¬
				<span style="color: #ff0000;">&quot;&amp;tags=&quot;</span> <span style="color: #66cc66;">&amp;</span> tagsString <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #66cc66;">&amp;</span> myTags <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
			<span style="color: #b1b100;">set</span> curlStatement <span style="color: #b1b100;">to</span> <span style="color: #ff0000;">&quot;/usr/bin/curl -u &quot;</span> <span style="color: #66cc66;">&amp;</span> usernamePasswordString <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot; -d &quot;</span> <span style="color: #66cc66;">&amp;</span> u <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot; https://api.del.icio.us/v1/posts/add&quot;</span>
			<span style="color: #b1b100;">set</span> retValue <span style="color: #b1b100;">to</span> do shell <span style="color: #b1b100;">script</span> curlStatement
			<span style="color: #b1b100;">if</span> retValue <span style="color: #000066;">contains</span> <span style="color: #ff0000;">&quot;wrong&quot;</span> <span style="color: #b1b100;">then</span>
				display dialog <span style="color: #ff0000;">&quot;Headline did not post to Delicious. Something went wrong.&quot;</span>
			<span style="color: #b1b100;">else</span>
&nbsp;
&nbsp;
&nbsp;
				<span style="color: #b1b100;">set</span> <span style="color: #000000; font-weight: bold;">the</span> enabledNotificationsList <span style="color: #b1b100;">to</span> Â¬
					<span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">&quot;Item Posted to Delicious&quot;</span><span style="color: #66cc66;">&#125;</span>
&nbsp;
				<span style="color: #b1b100;">tell</span> application <span style="color: #ff0000;">&quot;System Events&quot;</span>
					<span style="color: #b1b100;">set</span> growlRunning <span style="color: #b1b100;">to</span> Â¬
						<span style="color: #66cc66;">&#40;</span><span style="color: #000066;">count</span> <span style="color: #b1b100;">of</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">every</span> process <span style="color: #000000; font-weight: bold;">whose</span> name <span style="color: #b1b100;">is</span> <span style="color: #ff0000;">&quot;GrowlHelperApp&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> &gt; <span style="color: #cc66cc;">0</span>
				<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">tell</span>
&nbsp;
				<span style="color: #b1b100;">if</span> growlRunning <span style="color: #b1b100;">then</span>
					<span style="color: #b1b100;">tell</span> application <span style="color: #ff0000;">&quot;GrowlHelperApp&quot;</span>
&nbsp;
						register <span style="color: #000066;">as</span> application Â¬
							<span style="color: #ff0000;">&quot;scriptNetNewsWire&quot;</span> all notifications enabledNotificationsList Â¬
							default notifications enabledNotificationsList Â¬
							icon <span style="color: #b1b100;">of</span> application <span style="color: #ff0000;">&quot;NetNewsWire&quot;</span>
&nbsp;
						notify <span style="color: #b1b100;">with</span> name Â¬
							<span style="color: #ff0000;">&quot;Item Posted to Delicious&quot;</span> title thisHeadline description <span style="color: #ff0000;">&quot;Posted to Delicious with tags: <span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #66cc66;">&amp;</span> myTags <span style="color: #66cc66;">&amp;</span> Â¬
							<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> application name <span style="color: #ff0000;">&quot;scriptNetNewsWire&quot;</span> icon <span style="color: #b1b100;">of</span> application <span style="color: #ff0000;">&quot;NetNewsWire&quot;</span>
					<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">tell</span>
				<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">if</span>
&nbsp;
			<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">if</span>
		<span style="color: #b1b100;">else</span>
			display dialog <span style="color: #ff0000;">&quot;Please select a headline to post to del.icio.us&quot;</span>
		<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">if</span>
	<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">tell</span>
<span style="color: #b1b100;">end</span> postToDelicious
&nbsp;
<span style="color: #b1b100;">on</span> checkUsernameAndPassword<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #808080; font-style: italic;">-- Check to see if the file where our username and password are stored exists</span>
	<span style="color: #b1b100;">try</span>
		do shell <span style="color: #b1b100;">script</span> <span style="color: #ff0000;">&quot;cd &quot;</span> <span style="color: #66cc66;">&amp;</span> POSIX path <span style="color: #b1b100;">of</span> <span style="color: #66cc66;">&#40;</span>path <span style="color: #b1b100;">to</span> preferences <span style="color: #000066;">as</span> text<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot;; ls | grep com.flickerbulb.toread.txt&quot;</span>
		<span style="color: #b1b100;">try</span>
			<span style="color: #b1b100;">set</span> prefFile <span style="color: #b1b100;">to</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>path <span style="color: #b1b100;">to</span> preferences <span style="color: #000066;">as</span> text<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot;com.flickerbulb.toread.txt&quot;</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #000066;">open</span> for access file prefFile <span style="color: #b1b100;">with</span> write permission
			<span style="color: #b1b100;">set</span> prefs <span style="color: #b1b100;">to</span> read file prefFile using delimiter <span style="color: #66cc66;">&#123;</span><span style="color: #b1b100;">return</span><span style="color: #66cc66;">&#125;</span>
			<span style="color: #000066;">close</span> access file prefFile
			<span style="color: #b1b100;">set</span> usernamePasswordString <span style="color: #b1b100;">to</span> item <span style="color: #cc66cc;">1</span> <span style="color: #b1b100;">of</span> prefs
			<span style="color: #b1b100;">set</span> tagsString <span style="color: #b1b100;">to</span> item <span style="color: #cc66cc;">2</span> <span style="color: #b1b100;">of</span> prefs
		<span style="color: #b1b100;">on</span> <span style="color: #b1b100;">error</span> e
			<span style="color: #000066;">close</span> access file prefFile
		<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">try</span>
	<span style="color: #b1b100;">on</span> <span style="color: #b1b100;">error</span>
		<span style="color: #b1b100;">set</span> username <span style="color: #b1b100;">to</span> text returned <span style="color: #b1b100;">of</span> <span style="color: #66cc66;">&#40;</span>display dialog <span style="color: #ff0000;">&quot;Please enter your Delicious username&quot;</span> default answer <span style="color: #ff0000;">&quot;username&quot;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #b1b100;">set</span> pass <span style="color: #b1b100;">to</span> text returned <span style="color: #b1b100;">of</span> <span style="color: #66cc66;">&#40;</span>display dialog <span style="color: #ff0000;">&quot;Please enter your Delicious password&quot;</span> default answer <span style="color: #ff0000;">&quot;password&quot;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #b1b100;">set</span> tags <span style="color: #b1b100;">to</span> text returned <span style="color: #b1b100;">of</span> <span style="color: #66cc66;">&#40;</span>display dialog <span style="color: #ff0000;">&quot;Please enter any desired default tags&quot;</span> default answer <span style="color: #ff0000;">&quot;toread &quot;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #b1b100;">try</span>
			<span style="color: #b1b100;">set</span> prefFile <span style="color: #b1b100;">to</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>path <span style="color: #b1b100;">to</span> preferences <span style="color: #000066;">as</span> text<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot;com.flickerbulb.toread.txt&quot;</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #000066;">open</span> for access file prefFile <span style="color: #b1b100;">with</span> write permission
			<span style="color: #b1b100;">set</span> eof <span style="color: #b1b100;">of</span> file prefFile <span style="color: #b1b100;">to</span> <span style="color: #cc66cc;">0</span>
			write username <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #66cc66;">&amp;</span> pass <span style="color: #66cc66;">&amp;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #b1b100;">return</span><span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&amp;</span> tags <span style="color: #b1b100;">to</span> file prefFile
			<span style="color: #000066;">close</span> access file prefFile
		<span style="color: #b1b100;">on</span> <span style="color: #b1b100;">error</span> e
			<span style="color: #000066;">close</span> access file prefFile
		<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">try</span>
		<span style="color: #b1b100;">set</span> usernamePasswordString <span style="color: #b1b100;">to</span> username <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #66cc66;">&amp;</span> pass
		<span style="color: #b1b100;">set</span> tagsString <span style="color: #b1b100;">to</span> tags <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot; &quot;</span>
	<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">try</span>
<span style="color: #b1b100;">end</span> checkUsernameAndPassword</pre></div></div>

<h3>Possibly Related</h3>
<ul class="related_post">
<li>March 2, 2009 &#8212; <a href="http://flickerbulb.com/2009/03/02/object-oriented-css-grids-on-github/" title="Object Oriented CSS, Grids on Github">Object Oriented CSS, Grids on Github</a></li>
<li>October 1, 2008 &#8212; <a href="http://flickerbulb.com/2008/10/01/tyler-durden%e2%80%99s-8-rules-of-innovation/" title="Tyler Durdenâ€™s 8 Rules of Innovation ">Tyler Durdenâ€™s 8 Rules of Innovation </a></li>
<li>September 27, 2007 &#8212; <a href="http://flickerbulb.com/2007/09/27/lots-of-unread-items/" title="lots of unread items">lots of unread items</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://flickerbulb.com/2008/12/05/post-netnewswire-item-to-delicious-bookmarks-applescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

