<?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>plasticular inscriptor &#187; coding</title>
	<atom:link href="http://www.plasticstare.com/plains/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.plasticstare.com/plains</link>
	<description></description>
	<lastBuildDate>Tue, 17 Aug 2010 23:57:21 +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>Flash Text Metrics</title>
		<link>http://www.plasticstare.com/plains/2010/08/17/flash-text-metrics/</link>
		<comments>http://www.plasticstare.com/plains/2010/08/17/flash-text-metrics/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 23:57:21 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2010/08/17/flash-text-metrics/</guid>
		<description><![CDATA[via blog.six4rty.ch I like the article at http://blog.six4rty.ch/2010/07/31/as3-multiline-textfields-and-line-metrics/, mainly because of this graphic. I found it somewhere before long ago (maybe the same place) &#8212; it is a big help when dealing with customized text layout situations in flash where you have to do manual baseline aligment and such. Posted via email from micro-plains]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<div class="posterous_bookmarklet_entry"> <a href='http://posterous.com/getfile/files.posterous.com/plains/ljpuIsrJznGcsDckbFoCAoDzyGmgDwcCxqADhcgpxvuCgChszHglDvEnzIdm/media_httpblogsix4rty_xbzbq.jpg.scaled1000.jpg'><img src="http://posterous.com/getfile/files.posterous.com/plains/ljpuIsrJznGcsDckbFoCAoDzyGmgDwcCxqADhcgpxvuCgChszHglDvEnzIdm/media_httpblogsix4rty_xbzbq.jpg.scaled500.jpg" width="500" height="335"/></a>
<div class="posterous_quote_citation">via <a href="http://blog.six4rty.ch/wp-content/uploads/2010/07/text-metrics.jpg">blog.six4rty.ch</a></div>
<p>I like the article at <a href="http://blog.six4rty.ch/2010/07/31/as3-multiline-textfields-and-line-metrics/">http://blog.six4rty.ch/2010/07/31/as3-multiline-textfields-and-line-metrics/</a>, mainly because of this graphic. I found it somewhere before long ago (maybe the same place) &#8212; it is a big help when dealing with customized text layout situations in flash where you have to do manual baseline aligment and such.</p>
</div>
<p style="font-size: 10px;"> <a href="http://posterous.com">Posted via email</a>  from <a href="http://plains.posterous.com/flash-text-metrics">micro-plains</a> </p>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2010/08/17/flash-text-metrics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix the Focus Rect for fl.controls.TextInput in AS3</title>
		<link>http://www.plasticstare.com/plains/2009/05/28/fix-the-focus-rect-for-flcontrolstextinput-in-as3/</link>
		<comments>http://www.plasticstare.com/plains/2009/05/28/fix-the-focus-rect-for-flcontrolstextinput-in-as3/#comments</comments>
		<pubDate>Thu, 28 May 2009 22:35:04 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash as3 component textinput]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=288</guid>
		<description><![CDATA[The AS3 components in CS4 allow for visually showing that the component is focused, using a code generated or libary asset sprite as the focusRect. This can be changed using the focusRect property or through the #setStyle method inherited by all UIComponent's. The outlying size of the focusRect can also be altered by setting the [...]]]></description>
			<content:encoded><![CDATA[<p>The AS3 components in CS4 allow for visually showing that the component is focused, using a code generated or libary asset sprite as the focusRect. This can be changed using the focusRect property or through the #setStyle method inherited by all UIComponent's. The outlying size of the focusRect can also be altered by setting the focusRectPadding style, which designates the number of pixels outside the size of the component that the focusRect sits. Unfortunately, if you are using TextInput, and likely TextArea, setting this padding to 0 results in hiding the focusRect behind the component skin (the grey outline for the TextInput). This is a result of the fact that the UIComponent#drawFocus sets the childIndex of the focusRect sprite to 0, essentially placing it behind the TextInput border. I wanted to create a subclass of TextInput for which I didn't need to reset several defaults every time I used it, so I created the class below, which also fixes the 0 padding focusRect issue.<br />
<span id="more-288"></span></p>
<pre class="brush: as3;">
package {

	import fl.controls.TextInput;
	import fl.managers.IFocusManagerComponent;

	/**
	 * Extends the TextInput component in order to set the default width and
	 * height, and sets the focusRectPadding to 0 (so the focus rectangle lies
	 * directly on top of the grey text input border skin.
	 */
	public class TextInput2 extends TextInput implements IFocusManagerComponent {

		/**
		 * @constructor
		 */
		public function TextInput2() {
			super();
			textField.width = 1;
			textField.height = 1;
			width = 64;
			height = 18;
			setStyle(&quot;focusRectPadding&quot;, 0);
		}

		/**
		 * The UIComponent class, when the component is in focus, creates the
		 * uiFocusRect and sets it at childIndex 0. Unfortunately, the text input
		 * skin is then above the focus rect, and so the focus rect disappears
		 * when the focusRectPadding is 0. This calls the parent implementation,
		 * then ensures that the focus rect is visible by changing its
		 * child index.
		 */
		override public function drawFocus(draw:Boolean):void {
			super.drawFocus(draw);

			if (uiFocusRect != null) {
				setChildIndex(uiFocusRect, numChildren - 1);
			}
		}
	}
}
</pre>
<p>UPDATE: I updated the above script to set the size of the TextField in the TextInput component to be 1x1. This also fixes the problem that the TextField is created as 100x100 pixels when it is first created (as are all dynamically generated text fields). This matters if you wish to use any customized layout (such as the Yahoo astra layout managers), and don't want to have to call drawNow() or wait a frame to finalize layout settings in a UI.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2009/05/28/fix-the-focus-rect-for-flcontrolstextinput-in-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Line-width on Shapes in Flash, and scale9Grid Results</title>
		<link>http://www.plasticstare.com/plains/2009/05/20/line-width-on-shapes-in-flash/</link>
		<comments>http://www.plasticstare.com/plains/2009/05/20/line-width-on-shapes-in-flash/#comments</comments>
		<pubDate>Wed, 20 May 2009 22:18:42 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[linewidth]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[scale9Grid]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=275</guid>
		<description><![CDATA[A quick note regarding something I've been meaning to post a short note about for a while, for those that might be running into problems resulting from shapes drawn in flash with an outline. I ran into this recently again, so I thought I'd post for any concerned parties out there. Regardless of whether or [...]]]></description>
			<content:encoded><![CDATA[<p>A quick note regarding something I've been meaning to post a short note about for a while, for those that might be running into problems resulting from shapes drawn in flash with an outline. I ran into this recently again, so I thought I'd post for any concerned parties out there.</p>
<p>Regardless of whether or not a shape, such as a rectangle, is drawn in Flash with a hairline border line, or a borderline of 1, the result on an unscaled shape is essentially the same. The crisp outline of the shape is drawn with a pixel width of 1. The downside of this occurs when trying to create pixel perfect UI's, and especially those using shapes with a scalenine grid assigned to them.<br />
<span id="more-275"></span><br />
Using the AS3 drawing API, you can create a rectangle that has a lineStyle with a width of 1, and some fill, which would look something like this:</p>
<pre class="brush: as3; light: true;">var sh:Shape = new Shape();
sh.graphics.lineStyle(1, 0xFF0000);
sh.graphics.beginFill(0xFF6600);
sh.graphics.drawRect(0, 0, 100, 100);
sh.graphics.endFill();
addChild(sh);
trace(&quot;Size: &quot; + sh.width + &quot; x &quot; + sh.height);</pre>
<p>The code above so draws an orange rectangle with a red border that is <em>201</em> pixels wide and <em>101</em> pixels tall. If you don't know why, the reason is because flash draws the line <em>on</em> the pixel width and height of the rectangle with a line size of 1. This makes your shape 201 x 101; thankfully, Flash <em>will</em> report the width and height correctly as 201 x 101.</p>
<p>This gets stickier if you have a shape that is used as a component skin, and has a scale9Grid applied to it. In this case you will likely be working with a component that you <em>expect</em> to take up 200x100 pixels on the stage when you tell it to be that size. However, if the skin used features "line" outlines at its borders, your component will get drawn on the stage with extra pixels. If you dig into the Flash component skins, you will notice that most of the skins use <em>fills</em> for any borders on the shapes (even 1 pixel wide borders) so that the scale9Grid enabled shapes will scale correctly to the pixel. That being said, the proper way to draw the simple skin shape in this case, programmatically, would be:</p>
<pre class="brush: as3; light: true;">
var sh2:Shape = new Shape();
sh2.graphics.beginFill(0xFF0000);
sh2.graphics.drawRect(0, 0, 200, 100);
sh2.graphics.beginFill(0xFF6600);
sh2.graphics.drawRect(1, 1, 198, 98);
sh2.graphics.endFill();
addChild(sh2);
trace(&quot;Size: &quot; + sh2.width + &quot; x &quot; + sh2.height);
</pre>
<p>Incidentally, this also often cleans up some anti-aliasing at the corners of rectangular shapes which I believe is cause by some weirdness in the way the "caps" are drawn on the shapes. (but don't quote me on that...)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2009/05/20/line-width-on-shapes-in-flash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS3 ComboBox close error.</title>
		<link>http://www.plasticstare.com/plains/2009/04/13/as3-combobox-close-error/</link>
		<comments>http://www.plasticstare.com/plains/2009/04/13/as3-combobox-close-error/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 17:45:38 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[combobox]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=271</guid>
		<description><![CDATA[Just a quick note for those possibly searching for ComboBox AS3 and "Cannot access a property or method of a null object reference." When using the AS3 ComboBox, the above error will be thrown when the ComboBox loses focus, if the ComboBox is in its open state and it has lost reference to the stage. [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note for those possibly searching for ComboBox AS3 and "Cannot access a property or method of a null object reference." When using the AS3 ComboBox, the above error will be thrown when the ComboBox loses focus, if the ComboBox is in its open state and it has lost reference to the stage. In other words, if you have a UI pane that contains the ComboBox, and you are removing the pane, make sure to first call #close() on all instances of the ComboBox, then remove the container from its parent container. (This can be replicated by clicking open the ComboBox, then clicking on the stage.) Unfortunately, the isOpen property for the ComboBox is not publicly accessible, but the #close() method is a NOOP if it is already closed, so just making sure to close it is no big deal. I ran into this error because I was listening for a stage focus event which triggered the immediate removal of the container pane in question, but I didn't find any relevant references in a quick web search, so I thought I'd make a quick post with the solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2009/04/13/as3-combobox-close-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Liven up Livedocs: Search from Quicksilver</title>
		<link>http://www.plasticstare.com/plains/2009/04/01/liven-up-livedocs-search-from-quicksilver/</link>
		<comments>http://www.plasticstare.com/plains/2009/04/01/liven-up-livedocs-search-from-quicksilver/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 20:10:07 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[quicksilver]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[livedocs]]></category>
		<category><![CDATA[techtip]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=263</guid>
		<description><![CDATA[Several months ago I jumped back into AS3 development for flash and I once again, therefore, jumped back into using the actionscript livedocs. LiveDocs are great, but I've always found navigating to them to be a big chore, even from a bookmark in a browser. In addition, the search functionality for LiveDocs to often be [...]]]></description>
			<content:encoded><![CDATA[<p>Several months ago I jumped back into AS3 development for flash and I once again, therefore, jumped back into using the actionscript livedocs. LiveDocs are great, but I've always found navigating to them to be a big chore, even from a bookmark in a browser. In addition, the search functionality for LiveDocs to often be frustrating. The other day it occurred to me, however, that the same search capability used to trigger <a href="http://www.google.com/url?sa=U&amp;start=1&amp;q=http://yubnub.org/&amp;ei=SsbTSbeiMZ-WswOypJ2tCg&amp;sig2=xoz9DuLQzGYPXqMUyfD-9Q&amp;usg=AFQjCNHPiIwr8PXYpzOAd3YbVRqRtPbtuA">yubnub</a> commands from Quicksilver could be implemented to search LiveDocs as well. Check out this tutorial at <a href="http://www.lifeclever.com/quicksilver-yubnub-rapid-web-searches-and-more/">lifeclever</a> to find out how to access yubnub from Quicksilver. The same principle can be used for searching live docs (and for searching the adobe help docs for flash 10 player AS3. Instead of using using the search URL <code>"qss-http://www.yubnub.org/parser/parse?command=***", use the following query URLs in a </code><code>quicksilver </code><code>web search trigger:</code></p>
<p>Flash 9 LiveDocs:  <code>qss-http://www.google.com/search?&amp;btnI&amp;q=site%3Ahttp%3A%2F%2Flivedocs.adobe.com%2Fflash%2F9.0%2FActionScriptLangRefV3%2F+***</code></p>
<p>Flash 10 Help Docs:  <code>qss-http://www.google.com/search?&amp;btnI&amp;q=site%3Ahttp%3A%2F%2Fhelp.adobe.com%2Fen_US%2FAS3LCR%2FFlash_10.0%2F+***</code></p>
<p>Basically, since there is no convenient way I found to use the search mechanisms on the Adobe site, these queries are running a google lucky search on the wildcard applied search term, while restricting the search to the site pertinent to the docs of interest. Running the assigned key command will trigger the Quicksilver text entry box; simply enter the term, such as "vector" for Flash 10, and the google lucky search will be performed. Since the lucky search is restricted to the livedocs and the help docs, the first search result returned will be the frameless html page in the docs for the search term. When searching for the docs for a specific actionscript term, this cuts the search time for a term down to a couple of seconds, which is highly convenient...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2009/04/01/liven-up-livedocs-search-from-quicksilver/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quicksilver Adium Message Script</title>
		<link>http://www.plasticstare.com/plains/2008/08/07/quicksilver-adium-message-script/</link>
		<comments>http://www.plasticstare.com/plains/2008/08/07/quicksilver-adium-message-script/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 03:59:18 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[applescript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[quicksilver]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=247</guid>
		<description><![CDATA[The Adium plug-in for Quicksilver has been kaput for quite a while now, and I have found myself as of late with folks at work I need to contact who keep themselves in the invisible state in their messenger (like my manager . I have come to loath having to go to Adium and go [...]]]></description>
			<content:encoded><![CDATA[<p>The Adium plug-in for Quicksilver has been kaput for quite a while now, and I have found myself as of late with folks at work I need to contact who keep themselves in the invisible state in their messenger (like my manager <img src='http://www.plasticstare.com/plains/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . I have come to loath having to go to Adium and go to the menu bar with the mouse and select "show offline contacts" and then find the person I want to IM and click their name, then "hide offline contacts" again. I also don't care about having to use the contact list interface anyway, really, if I didn't have to, so I wrote this applescript to use in Quicksilver.</p>
<p>To install, uncompress this script and put it in your ~/Library/Application Support/Quicksilver/Actions directory, and restart Quicksilver.</p>
<p>To use, invoke Quicksilver and type "." to enter text mode. Type all or part of the name of the person you wish to IM. Hit <Tab> and type "Adium" (or "Ad" or "Adi") and select "AdiumContactor" with the arrow keys and hit <Return>.</p>
<p>The script will search for any instance of the text you enter in your contacts, both in their IM names, as well as their display names. If one match is found, it will open an IM window for that contact. If multiple contacts are found, a window will open allowing you to select the one you want, using whatever account it belongs to. (in other words, if you search "bil", you will be able to choose from "Bill Todd", bileInMyStomach@gmail.com, actionscriptAbility@hotmail.com, etc.) Careful using some search terms, such as "com", as it will return all your MSN messenger accounts (whose screennames are defined by the contact's email address)</p>
<p><span class="downloadable"><em>PlasticWare Downloadable ::</em><br />
AdiumContactor for Quicksilver (Aug. 07, 2008)<br />
Download (~10,000 bytes) :: <a href="http://www.plasticstare.com/plasticware/applescript/AdiumContactor.zip">AdiumContactor.zip</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/08/07/quicksilver-adium-message-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>quicksilver, curl, applescript, proxy-config, twitter</title>
		<link>http://www.plasticstare.com/plains/2008/08/05/quicksilver-curl-applescript-proxy-config-twitter/</link>
		<comments>http://www.plasticstare.com/plains/2008/08/05/quicksilver-curl-applescript-proxy-config-twitter/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 02:11:23 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[applescript]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[quicksilver]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=238</guid>
		<description><![CDATA[This explains how to use Quicksilver to send posts to Twitter from within a firewall. I made this my little lunch project today. First, let's start with the basics. If you set up your work proxy server in your network config, there is not really any way to easily retrieve those settings. Let's say you [...]]]></description>
			<content:encoded><![CDATA[<p>This explains how to use Quicksilver to send posts to Twitter from within a firewall. I made this my little lunch project today. First, let's start with the basics. If you set up your work proxy server in your network config, there is not really any way to easily retrieve those settings. Let's say you are using http://proxy.myco.com:3128 for your http proxy settings. In the Terminal, you have not actually set your http_proxy environment variable. <a href="http://www.cs.usyd.edu.au/%7Emassad/project-proxy-config.html">Mark Assad has proxy-config</a> available for download. You can grab that, put it in one of your path directories, and then in your .bashrc or .zshrc file the following:</p>
<pre class="brush: plain; light: true;">export http_proxy=`proxy-config -h`
export https_proxy=`proxy-config -s`
export ftp_proxy=`proxy-config -f`</pre>
<p>This will set your environment proxy variables to whatever they are currently set to in your Network Preferences. I got part of this also from <a href="http://tomayko.com/writings/os-x-network-location-support-from-the-command-line">Ryan Tomayko's blog</a>.This is important if you are inside a firewall at work.</p>
<p>The simplest way to post a tweet to twitter from the command line would be to do so using cURL. If you don't have cURL installed, you will need to install it. If you aren't familiar with cURL, it is basically a command-line tool for grabbing html documents (or whatever else). See <a href="http://www.plasticstare.com/plains/2008/03/20/copy-and-continue-copying-large-files-over-file-sharing/">this post</a> for another use. I got this idea, as well as the applescript for using it with Quicksilver, from <a href="http://blog.codahale.com/2007/01/15/tweet-twitter-quicksilver/">Coda Hale's blog</a>. Read that post for a full explanation of using Quicksilver and an applescript for posting to twitter from Quicksilver -- it has a pretty thorough explanation.</p>
<p>If you are inside a firewall, however, this will likely fail because the cURL command requires that the proxy settings be provided. So, I took the script from Coda's post, combined it with the comment on his post from Daan Kortenbach, and then enabled that for use with the system's proxy settings. The new script follows:</p>
<pre class="brush: plain;">
using terms from application &quot;GrowlHelperApp&quot;
	-- Register Growl
	on growlRegister()
		tell application &quot;GrowlHelperApp&quot;
			register as application &quot;Tweet&quot; all notifications {&quot;Alert&quot;} default notifications {&quot;Alert&quot;} icon of application &quot;Quicksilver.app&quot;
		end tell
	end growlRegister

	-- Notify using Growl
	-- Example: growlNotify(&quot;This is an Alert&quot;,&quot;This is a test of the Growl Alert System&quot;)
	on growlNotify(grrTitle, grrDescription)
		tell application &quot;GrowlHelperApp&quot;
			notify with name &quot;Alert&quot; title grrTitle description grrDescription application name &quot;Tweet&quot;
		end tell
	end growlNotify
end using terms from

using terms from application &quot;Quicksilver&quot;
	on process text tweet
		tell application &quot;Keychain Scripting&quot;
			set twitter_key to first Internet key of current keychain whose server is &quot;twitter.com&quot;
			set twitter_login to quoted form of (account of twitter_key &amp; &quot;:&quot; &amp; password of twitter_key)
		end tell
		set twitter_status to quoted form of (&quot;status=&quot; &amp; tweet)

                -- I have proxy-config in a directory &quot;~/bin&quot;
		set the_proxy to do shell script &quot;~/bin/proxy-config -h&quot;

		try
			if (the_proxy = &quot;&quot;) then
				set results to do shell script &quot;curl --user &quot; &amp; twitter_login &amp; &quot; --data-binary &quot; &amp; twitter_status &amp; &quot; http://twitter.com/statuses/update.json&quot;
			else
				set results to do shell script &quot;curl --proxy &quot; &amp; the_proxy &amp; &quot; --user &quot; &amp; twitter_login &amp; &quot; --data-binary &quot; &amp; twitter_status &amp; &quot; http://twitter.com/statuses/update.json&quot;
			end if
			growlRegister()
			growlNotify(&quot;Tweet Sent&quot;, tweet)
		on error
			(* In case curl fails for some reason,  alert us *)
			growlRegister()
			growlNotify(&quot;Error&quot;, &quot;There was an error sending your tweet.&quot;)
		end try

	end process text
end using terms from
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/08/05/quicksilver-curl-applescript-proxy-config-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Breakaway Saves My Ears</title>
		<link>http://www.plasticstare.com/plains/2008/07/30/breakaway-saves-my-ears/</link>
		<comments>http://www.plasticstare.com/plains/2008/07/30/breakaway-saves-my-ears/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 18:15:23 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=235</guid>
		<description><![CDATA[I wrote a post a while back about the pesky habit of my MacBook Pro trying to make me go deaf. I plug my laptop into a stereo via the headphone jack at home and listen to music. In order to get the sound levels right at home, I increase the volume to full volume [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a post a while back about the pesky habit of my MacBook Pro trying to make me go deaf. I plug my laptop into a stereo via the headphone jack at home and listen to music. In order to get the sound levels right at home, I increase the volume to full volume (otherwise I have to turn up the stereo and I get lots of noise and hum). When I leave in the morning, I unplug my laptop and the MacBook resets its volume to the pre-headphone jack volume. Fine. Unfortunately, when I get to work, I plug-in my headphones, start checking email, hit my keyboard command for iTunes play, and proceed to deafen myself with full volume, as the machine automatically resets the system volume to the previous headphone jack volume level.</p>
<p>Today I deafened myself, but upon searching, discovered <a href="http://balthamos.awardspace.com/applications/">Alloc Init</a>, which features a nice little app called <a href="http://www.macupdate.com/info.php/id/23361">Breakaway</a>. The main feature of this app is to pause iTunes or launch the screensaver when the headphone jack status is changed (plugged in or out). However, the nicer thing about the app is that it also allows the user to trigger an applescript on the same events. I created the following script called setVolumeTo20of100:</p>
<p><code>tell application "Finder"<br />
	set volume output volume 20<br />
end tell</code></p>
<p>After creating a custom trigger in Breakaway, my system volume will always be reset to 20 when I plug in something to the headphone jack. Since I don't care about having to increase the volume at home automatically, this is fine for now, since I will most importantly not deafen myself in the morning at work. I will perhaps post an update later that checks the the network preferences for the current location for setting the volume automatically based on location, which will automate things a little more. Meanwhile, I highly recommend this nice little app. (Note: the interface for creating custom triggers is a little clunky, so you may have to play with it a little first, but it does work -- just be patient.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/07/30/breakaway-saves-my-ears/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>resurfacing_2008_r0.2*</title>
		<link>http://www.plasticstare.com/plains/2008/07/13/resurfacing_2008_r02/</link>
		<comments>http://www.plasticstare.com/plains/2008/07/13/resurfacing_2008_r02/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 11:05:52 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[resurface]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=227</guid>
		<description><![CDATA[The second stage of resurfacing the site is "finished." The theme is still based on Sandbox, but I have modified some of the files so far to add some styling content that wasn't possible with the theme as it was. I had considered adding a second theme layer on top of Sandbox and then utilize [...]]]></description>
			<content:encoded><![CDATA[<p>The second stage of resurfacing the site is "finished." The theme is still based on Sandbox, but I have modified some of the files so far to add some styling content that wasn't possible with the theme as it was. I had considered adding a second theme layer on top of Sandbox and then utilize a thin CSS-only styling theme on top of that, but it seemed like overkill. My intent was to try to get as much future code updates from Sandbox for free, but if the theme in progress gets wonky, then it will just be time to rework the site again. At this point, the only files that have really changed are style.css, header.php, footer.php, and sidebar.php. The styling is still incomplete. The next step is to finish flushing out and refining the generic styles, as well as flush out some of the other pieces that need styling, such as the Twitter and Flickr feeds. At that point, it will be time to add in a couple of other things as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/07/13/resurfacing_2008_r02/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>resurfacing_2008_r0.1*</title>
		<link>http://www.plasticstare.com/plains/2008/07/11/resurfacing_2008_r01/</link>
		<comments>http://www.plasticstare.com/plains/2008/07/11/resurfacing_2008_r01/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 08:44:14 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[resurface]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/?p=226</guid>
		<description><![CDATA[The shame: I realized the other day that the "design" that was current on this site until today had been there for a really long time. Since I have been working on other things and just posting here and there, I had also neglected the fact that there were some massive breakages that just looked [...]]]></description>
			<content:encoded><![CDATA[<p>The shame: I realized the other day that the "design" that was current on this site until today had been there for a <em>really</em> long time. Since I have been working on other things and just posting here and there, I had also neglected the fact that there were some massive breakages that just looked really bad, as if something had been attempted and had failed.</p>
<p>The solution: I decided it was finally time to resurface the site, but do so quickly so as to actually get things working again. So, the current state you see here is the result. Not finished, but at least not entirely broken. I did a little research, and decided that I would try out the <a href="http://www.plaintxt.org/themes/sandbox/">Sandbox theme</a>. I appreciated what they are trying to do, and I also decided that I should go ahead and start basically from scratch with a foundation that has some nice semantic markup to build on.</p>
<p>The project: What you see here in progress is actually a new theme that I am building on top of Sandbox, tentatively called Plastic Laminate, utilizing pretty much just new CSS on top of the existing Sandbox for now, and then I may actually do some reskinning or plugin building as well, to cover any areas missing content I want. That being said, if things look a bit wonky or like a blog with little design effort applied at the moment, that's because its still in transition...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/07/11/resurfacing_2008_r01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scraping Source in Safari</title>
		<link>http://www.plasticstare.com/plains/2008/03/30/scraping-source-in-safari/</link>
		<comments>http://www.plasticstare.com/plains/2008/03/30/scraping-source-in-safari/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 01:19:22 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[downloadable]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2008/03/30/scraping-source-in-safari/</guid>
		<description><![CDATA[Here is an applescript solution for grabbing the html code from a page online. This is particularly handy if you are trying to grab the code from a page that you need to login to. I am sure there is a much better solution out there, but this one seems to work for me ok. [...]]]></description>
			<content:encoded><![CDATA[<p>Here is an applescript solution for grabbing the html code from a page online. This is particularly handy if you are trying to grab the code from a page that you need to login to. I am sure there is a much better solution out there, but this one seems to work for me ok.</p>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showCodeTxt('code-2'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-- Define the page to save the document and the url</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">set the pageFile to <span style="color:#CC0000;">"/Users/yourUserNameHere/Desktop/safariSource.html"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">set the pageUrl to <span style="color:#CC0000;">"http://www.plasticstare.com/"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-- define the applescript to run</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">tell application <span style="color:#CC0000;">"Safari"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;activate</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;make new document at end of documents</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;set URL of document <span style="color:#800000;color:#800000;">1</span> to pageUrl</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">end tell</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">set web_page_is_loaded to false</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">--check if page has loaded</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">repeat</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;delay <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">5</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;tell application <span style="color:#CC0000;">"System Events"</span> to tell application process <span style="color:#CC0000;">"Safari"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#40;</span>name of static text <span style="color:#800000;color:#800000;">1</span> of group <span style="color:#800000;color:#800000;">1</span> of window <span style="color:#800000;color:#800000;">1</span> as text<span style="color:#006600; font-weight:bold;">&#41;</span> begins with <span style="color:#CC0000;">"Contacting"</span> or <span style="color:#006600; font-weight:bold;">&#40;</span>name of static text <span style="color:#800000;color:#800000;">1</span> of group <span style="color:#800000;color:#800000;">1</span> of window <span style="color:#800000;color:#800000;">1</span> as text<span style="color:#006600; font-weight:bold;">&#41;</span> begins with <span style="color:#CC0000;">"Loading"</span> then</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-- do nothing</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; else</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit repeat</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; end if</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;end tell</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">end repeat</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">tell application <span style="color:#CC0000;">"Safari"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;set siteSource to the source of document <span style="color:#800000;color:#800000;">1</span> as text</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;set theFile to open for access <span style="color:#006600; font-weight:bold;">&#40;</span>pageFile<span style="color:#006600; font-weight:bold;">&#41;</span> as POSIX file with write permission</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;set eof of theFile to <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;write siteSource to theFile</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;close access theFile</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">end tell </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/03/30/scraping-source-in-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delicious for WordPress</title>
		<link>http://www.plasticstare.com/plains/2008/03/30/delicious-for-wordpress/</link>
		<comments>http://www.plasticstare.com/plains/2008/03/30/delicious-for-wordpress/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 23:50:06 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[downloadable]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2008/03/30/delicious-for-wordpress/</guid>
		<description><![CDATA[Props to Rick for this simple way for adding recent delicious bookmark postings to your wordpress sidebar. Download Delicious for WordPress here: http://rick.jinlabs.com/code/delicious/ It was the simplest way I could find to do this. It isn't customizable, other than editing the code yourself, but it does a great job out of the box, and does [...]]]></description>
			<content:encoded><![CDATA[<p>Props to <a href="http://rick.jinlabs.com/code/delicious/" title="delicious for wordpress" target="_blank">Rick</a> for this simple way for adding recent delicious bookmark postings to your wordpress sidebar. Download Delicious for WordPress here: <a href="http://rick.jinlabs.com/code/delicious/" title="delicious for wordpress" target="_blank">http://rick.jinlabs.com/code/delicious/</a></p>
<p>It was the simplest way I could find to do this. It isn't customizable, other than editing the code yourself, but it does a great job out of the box, and does pretty much what you would want it to do anyway, which is post things to your blog that you found interesting, without having to actually write a post about it...hooray for industrious laziness!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/03/30/delicious-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy and continue copying large files over file sharing</title>
		<link>http://www.plasticstare.com/plains/2008/03/20/copy-and-continue-copying-large-files-over-file-sharing/</link>
		<comments>http://www.plasticstare.com/plains/2008/03/20/copy-and-continue-copying-large-files-over-file-sharing/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 18:05:02 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2008/03/20/copy-and-continue-copying-large-files-over-file-sharing/</guid>
		<description><![CDATA[In my experience, there is often a flaky slow server at work that contains vital files on it. This is fine when you need to retrieve files that are small, but what happens when you need to copy a large file? Most of the time these servers don't support ftp protocol and if you are [...]]]></description>
			<content:encoded><![CDATA[<p>In my experience, there is often a flaky slow server at work that contains vital files on it. This is fine when you need to retrieve files that are small, but what happens when you need to copy a large file? Most of the time these servers don't support ftp protocol and if you are on a Mac, you have to connect via smb (Samba) to the share and start copying and hope you don't have to stop, because if you stop the copy, the file disappears from your machine and you can't resume it.</p>
<p>However, I stumbled on this gem the other day:</p>
<blockquote><p><code>curl -C - -O file:///Volumes/samba_share/file/path/here.txt</code></p></blockquote>
<p>Basically, curl allows you to copy a file with url syntax in the terminal. The capital "O" tells curl to copy the file to your desktop with the same name as the file on your server, and the capital "C" tells it to continue where it may have left off. You can monitor the download in the terminal window. If you need to leave work and finish the copy the next day, simply enter the command again in the terminal and it will pick up the copy where it left off.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/03/20/copy-and-continue-copying-large-files-over-file-sharing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Applescript Show Track in Finder</title>
		<link>http://www.plasticstare.com/plains/2008/03/11/applescript-show-track-in-finder/</link>
		<comments>http://www.plasticstare.com/plains/2008/03/11/applescript-show-track-in-finder/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 20:44:13 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[applescript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[downloadable]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[plasticware]]></category>
		<category><![CDATA[quicksilver]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2008/03/11/applescript-show-track-in-finder/</guid>
		<description><![CDATA[Space has been tight lately on my laptop and I've been too lazy to thoroughly go through and clean up. I keep regular backups, however, so I wrote this script so that when I hear a track that I don't care so much about in iTunes on random, I can go to the folder and [...]]]></description>
			<content:encoded><![CDATA[<p>Space has been tight lately on my laptop and I've been too lazy to thoroughly go through and clean up. I keep regular backups, however, so I wrote this script so that when I hear a track that I don't care so much about in iTunes on random, I can go to the folder and kill the track or the album, or heck, all tracks by that artist, quickly. You can put this file in your iTunes scripts folder and trigger it from Quicksilver as well for easy access.</p>
<p><span class="downloadable"><em>PlasticWare Downloadable ::</em><br />
Show Track in Finder (Mar. 11, 2008)<br />
Download (~3,146 bytes) :: <a href="http://www.plasticstare.com/plasticware/applescript/ShowTrackInFinder.zip">ShowTrackInFinder.zip</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/03/11/applescript-show-track-in-finder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chumby Widget 002 &#8211; Japanese Alphabet!</title>
		<link>http://www.plasticstare.com/plains/2008/01/27/chumby-widget-002-japanese-alphabet/</link>
		<comments>http://www.plasticstare.com/plains/2008/01/27/chumby-widget-002-japanese-alphabet/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 11:09:24 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[chumby]]></category>
		<category><![CDATA[hiragana]]></category>
		<category><![CDATA[japanese]]></category>
		<category><![CDATA[katakana]]></category>
		<category><![CDATA[nihongo]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2008/01/27/chumby-widget-002-japanese-alphabet/</guid>
		<description><![CDATA[Just finished up version 1.0 of the Japanese Syllabary Flash Card for the Chumby. It was approved in its version 0.1 stage last week, but unfortunately, when you update a widget, it has to be approved again for public viewing. Perhaps after the big official Chumby launch there will be different tier developer permissions, some [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/intafon/2222156175/" title="20080126120743_w810i.jpg by ⌫ uɐλɹ, on Flickr"><img src="http://farm3.static.flickr.com/2181/2222156175_1df05c45d8_m.jpg" alt="20080126120743_w810i.jpg" align="left" height="180" width="240" /></a>Just finished up version 1.0 of the Japanese Syllabary Flash Card for the Chumby. It was approved in its version 0.1 stage last week, but unfortunately, when you update a widget, it has to be approved again for public viewing. Perhaps after the big official Chumby launch there will be different tier developer permissions, some of which would allow for updating already approved widgets without further approval. I guess we shall see about that. So, I expect this one to go public again on Monday. I'll post the link for the Chumby site page for it once it is up again. In the meantime, you can view a non-configurable version on my site at  <a href="http://www.plasticstare.com/nihongo/syllabaryflashcard.html" title="Syllabary Flash Card" target="_blank">http://www.plasticstare.com/nihongo/syllabaryflashcard.html.</a> The photo is of a slightly earlier version than the current one, but it looks pretty much the same. The Chumby widget allows you to view Hiragana or Katakana (or random), allows you to choose which of the Romaji and symbol to view first, and allows you choose which character sets you wish to view (and defaults to a,i,u,e,o,ka,ki,ku,ke,ko, and ga,gi,gu,ge,go).</p>
<p>Update: the chumby widget can be found at <a href="http://www.chumby.com/guide/widget/Japanese%20Syllabary%20Flash%20Card" title="japanese syllabary flash card" target="_blank">http://www.chumby.com/guide/widget/Japanese Syllabary Flash Card</a>. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/01/27/chumby-widget-002-japanese-alphabet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bizarre Clipboard Problem</title>
		<link>http://www.plasticstare.com/plains/2008/01/09/bizarre-clipboard-problem/</link>
		<comments>http://www.plasticstare.com/plains/2008/01/09/bizarre-clipboard-problem/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 18:47:05 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[clipboard]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2008/01/09/bizarre-clipboard-problem/</guid>
		<description><![CDATA[This has happened to me a couple of times using TextMate (probably has occurred elsewhere without consequences that I noticed). Every once in a long while, I will not be able to copy text into TextMate. I do this on a regular basis to analyze XML and JSON responses from the server for the application [...]]]></description>
			<content:encoded><![CDATA[<p>This has happened to me a couple of times using TextMate (probably has occurred<br />
elsewhere without consequences that I noticed). Every once in a long while, I will not be able to copy text into TextMate. I do this on a regular basis to analyze XML and JSON responses from the server for the application I work on at VmWare, copying FireBug response data into TextMate running either the XML tidy or a script I set up to tidy up the JSON data, so copying into TextMate is very important to me. Sometimes, however, it just doesn't work. I can copy/paste in TextMate, but not from another application to it. As it turns out, this has to do with the system pasteboard server. Essentially, you can fix the problem by restarting this service. See: <a href="http://wiki.macromates.com/Troubleshooting/CantPaste" title="CantPaste" target="_blank">http://wiki.macromates.com/Troubleshooting/CantPaste</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/01/09/bizarre-clipboard-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Anomolies</title>
		<link>http://www.plasticstare.com/plains/2008/01/04/data-anomolies/</link>
		<comments>http://www.plasticstare.com/plains/2008/01/04/data-anomolies/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 05:51:41 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[flock]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2008/01/04/data-anomolies/</guid>
		<description><![CDATA[I've been poking around lately working on getting some design ideas together and investigating some technical possibilities, as well as backing up some old data. Erasing some of that old data resulted in the crazy progress bar pictured above. I've also discovered a really frustrating problem while investigating pulling Flickr streams. It seems that you [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm3.static.flickr.com/2206/2166199603_86ea7b7966.jpg?v=0" onload="show_notes_initially();" class="reflect" height="89" width="399" /> I've been poking around lately working on getting some design ideas together and investigating some technical possibilities, as well as backing up some old data. Erasing some of that old data resulted in the crazy progress bar pictured above. I've also discovered a really frustrating problem while investigating pulling Flickr streams.</p>
<p>It seems that you can do a few nice little searches that aren't well publicized, so that you can, for instance, get an RSS stream featuring the union of two different Flickr tags in your stream (in other words, an OR search). The feed URL looks something like this (for the tags blue and green):</p>
<p>feed://api.flickr.com/services/feeds/photos_public.gne?<wbr></wbr>id=74517463@N00&amp;<wbr></wbr>tags=blue,green&amp;<wbr></wbr>tagmode=any&amp;<wbr></wbr>lang=en-us&amp;<wbr></wbr>format=rss_200</p>
<p>Replace the "tagmode" parameter with all, and you get an AND style search (only photos featuring all the specified tags). The problem is that the RSS feed provided by Flickr only allows you to grab 20 photos. If you perform the same search, you get a large amount of paged data, if there is more than one page. So, basically, this means that if you want to see ALL the photos of your children in your own home-grown chumby, OSX, or other widget, you are sadly stuck at seeing only 20.</p>
<p>"What about using something like Pipes?", you say. Well, I checked out using Yahoo pipes to create a custom RSS feed. Unfortunately, from what I can tell, you are really limited to what you can get via the Flickr API. You can get more than 20 photos in 1 person's photostream this way using the <a href="http://www.flickr.com/services/api/flickr.people.getPublicPhotos.html">flickr.people.getPublicPhotos</a> method, but that method does not provide the capability of filtering by tag.</p>
<p>I'd just about given up (well I still have for now) until I realized that you can do just this in the media bar in Flock, so there must be a way to do it that I am missing. In Flock, you can view your photostream and *fliter* by tags, and even use AND and OR for multiple tags. Not sure how they are doing this, because you can see way more than 20. I sent them an email to see what they are doing today. Anyone else have any idea?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2008/01/04/data-anomolies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Teach iTunes to Growl on Command</title>
		<link>http://www.plasticstare.com/plains/2007/10/21/teach-itunes-to-growl-on-command/</link>
		<comments>http://www.plasticstare.com/plains/2007/10/21/teach-itunes-to-growl-on-command/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 03:41:38 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[quicksilver]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2007/02/05/teach-itunes-to-growl-on-command/</guid>
		<description><![CDATA[Update: Changed the script to make the formatting better and include the album art of the track. Thanks to Freek in the comments below for a couple of ideas. The track info is copied directly from his comments, and I didn't yet get a chance to reformat that -- maybe soon... Haven't posted anything useful [...]]]></description>
			<content:encoded><![CDATA[<p>Update: Changed the script to make the formatting better and include the album art of the track. Thanks to Freek in the comments below for a couple of ideas. The track info is copied directly from his comments, and I didn't yet get a chance to reformat that -- maybe soon...</p>
<p>Haven't posted anything useful here for a while so I thought I'd put something together today and post it -- something that I've wanted for a while. Occasionally when I want to zone out at work I just put iTunes in random, hide it, and go. Unfortunately, I end up wasting time flipping iTunes open and then hiding it again when I can't remember a track name or artist or album. I've been meaning to put together something to use in Quicksilver to enable being able to take a peek at what is playing, namely using the OSX system extension Growl. Download this:</p>
<p><span class="downloadable"><em>PlasticWare Downloadable ::</em><br />
Growl Track Info (Oct. 21, 2007)<br />
Download (~3,645 bytes) :: <a href="http://www.plasticstare.com/plasticware/applescript/growl_track_info.zip">growl_track_info.zip</a></span></p>
<p>I can't remember why I have Growl on my system, that is, what application or system version first installed it, so if you don't have Growl, you can find it here: <a href="http://growl.info/">http://growl.info/</a>. Basically, if you aren't familiar with it, Growl allows for (sometimes annoying) pop-up bubbles that can notify you of things going on with applications that are currently not in the foreground (for example, when an upload completes in Transmit, or when you get an incoming message in Adium or iChat).Once you've installed Growl (or check to see if it exists in your System Prefs), download the script linked above, unzip it, and place it in your iTunes scripts folder (/Users/~YourUserName/Library/iTunes/Scripts). Now, if you restart iTunes, the script should show up in your iTunes applescript menu, and you can choose the script and see that it triggers the Growl pop-up -- which really isn't terribly interesting since you are already staring at iTunes anyway.</p>
<p>Now, assuming that you have Quicksilver installed on your system, you can add a custom trigger as seen below.<br />
<img src="/plasticware/applescript/growl_track_info.png" /><br clear="all" /><br />
To add the trigger, open Quicksilver and go to Catalog. Select Modules and make sure that you have the iTunes module showing there. If not, you need to enable the iTunes module. Click the circle arrow thing on the bottom right to rescan your catalog - you may notice that the count for the iTunes applescripts increases by 1. Next, select Triggers, and then select Custom Triggers. Find the little plus sign button at the middle bottom and choose HotKey. This will slide open a Quicksilver selector thing, whatever it's called. You can now type part of "growl track info" the same way as you would normally using Quicksilver, and select the Applescript "Growl Track Info.scpt" where it shows up in the list; it will default to Run as the action, which is fine. Now double click the line in the Trigger column on the right and set up your hotkey for On Press (my friends make fun of me for choosing something like Control-Option-Command-Shift-I so I can just mash the bottom left of the keyboard and one other letter and not interfere with other application keystrokes, but if you do that I won't make fun of you). You should now be able to hide iTunes and use the Quicksilver trigger to see whats playing in iTunes, as well as control iTunes with the rest of the iTunes module available for Quicksilver, and free up whatever corner of your screen you were keeping the mini player before.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2007/10/21/teach-itunes-to-growl-on-command/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Textmate: Run Command in Terminal</title>
		<link>http://www.plasticstare.com/plains/2006/12/12/textmate-run-command-in-terminal/</link>
		<comments>http://www.plasticstare.com/plains/2006/12/12/textmate-run-command-in-terminal/#comments</comments>
		<pubDate>Wed, 13 Dec 2006 07:55:04 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/12/12/textmate-run-command-in-terminal/</guid>
		<description><![CDATA[Maybe this exists already - I couldn't find it, so I just wrote it. Of course, I am putting this here as code, but one day I'll publish a new bundle of TextMate commands which includes this and some of the other ones I've put together. I was looking around today for some commands that [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe this exists already - I couldn't find it, so I just wrote it. Of course, I am putting this here as code, but one day I'll publish a new bundle of TextMate commands which includes this and some of the other ones I've put together. I was looking around today for some commands that I might use to augment the Perforce bundle -- specifically, I needed a dialog. What I found was some references to the use of CocoaDialog, which is pretty handy. Another use I had envisioned for dialogs in a TextMate command was to be able to run terminal commands *in* the Terminal. After all, sometimes you would like to have something run and dump its output right there in the Terminal, rather than in a new TextMate document or something like that. The Apple Terminal is pretty nice for what it is, and its much better than the Linux KDE terminal, the Windows terminal, and the poor bastard Windows Cygwin terminal.<br />
To set up this in TextMate, open the Bundle Editor and create a new Command. Set the command to Save "Nothing", Input "None", and Output "Discard". Give it a key command if you like, and leave the Scope Selector blank. In the Command(s) field, paste the following:</p>
<div class="igBar"><span id="lcode-4"><a href="#" onclick="javascript:showCodeTxt('code-4'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-4">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#!/bin/bash</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># First use CocoaDialog to pop a dialog to get</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># the command you would like to run.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">res</span>=$<span style="color:#006600; font-weight:bold;">&#40;</span>CocoaDialog inputbox --title <span style="color:#CC0000;">"Run Command in Terminal Window"</span> --informative-text <span style="color:#CC0000;">"Enter the command here:"</span> --button1 <span style="color:#CC0000;">"Okay"</span> --button2 <span style="color:#CC0000;">"Cancel"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># if the cancel button was pressed then exit</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $<span style="color:#006600; font-weight:bold;">&#40;</span>head -n1 &lt;&lt;&lt;<span style="color:#CC0000;">"$res"</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#CC0000;">"2"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span> &amp;&amp; exit_discard</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># set the command string to what was entered</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">command=$<span style="color:#006600; font-weight:bold;">&#40;</span>tail -n1 &lt;&lt;&lt;<span style="color:#CC0000;">"$res"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># create our applescript which will launch a</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># new Terminal window if there is not one running</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># and otherwise run the command we want in the</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># current running Terminal window</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">aplscr=<span style="color:#CC0000;">"tell application <span style="color:#000099; font-weight:bold;">\"</span>System Events<span style="color:#000099; font-weight:bold;">\"</span> to set terminalRunning to (exists process <span style="color:#000099; font-weight:bold;">\"</span>Terminal<span style="color:#000099; font-weight:bold;">\"</span>)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">if (not terminalRunning) then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">tell application <span style="color:#000099; font-weight:bold;">\"</span>Terminal<span style="color:#000099; font-weight:bold;">\"</span> to activate</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">tell application <span style="color:#000099; font-weight:bold;">\"</span>Terminal<span style="color:#000099; font-weight:bold;">\"</span> to do script <span style="color:#000099; font-weight:bold;">\"</span>$command<span style="color:#000099; font-weight:bold;">\"</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">tell application <span style="color:#000099; font-weight:bold;">\"</span>Terminal<span style="color:#000099; font-weight:bold;">\"</span> to activate</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">tell application <span style="color:#000099; font-weight:bold;">\"</span>Terminal<span style="color:#000099; font-weight:bold;">\"</span> to do script <span style="color:#000099; font-weight:bold;">\"</span>$command<span style="color:#000099; font-weight:bold;">\"</span> in front window</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">end if"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># execute the applescript</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">osascript -e <span style="color:#CC0000;">"$aplscr"</span> &amp;&gt;/dev/null &amp; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In a nutshell, as the comments indicate, we capture the contents of the field in the dialog that is opened, and stick them into the applescript that we want to run. The applescript part checks to see if there is already a Terminal session window open, and  will run the command in the Terminal. If Terminal isn't open, then it launches it. You (or maybe me in the future) could fancy this up a bit if you wanted by having the Terminal change directory to the directory in which the file you are working on exists. Not sure that is always desirable though for my purposes.</p>
<p>Enjoy it. (if you're a total geek you probably will, at least in principle)</p>
<p>Additional work needed:<br />
1. Escape quotes (you have to do that manually now).<br />
2. Have Terminal spawn a new window if it is already running but has no open windows. (need to check for window count in addition to process running)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/12/12/textmate-run-command-in-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jslint in TextMate</title>
		<link>http://www.plasticstare.com/plains/2006/11/15/jslint-in-textmate/</link>
		<comments>http://www.plasticstare.com/plains/2006/11/15/jslint-in-textmate/#comments</comments>
		<pubDate>Thu, 16 Nov 2006 06:31:54 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/11/15/jslint-in-textmate/</guid>
		<description><![CDATA[The previous post detailed a way to simply run JsLint from TextMate. I put together this shell script that can be run as a command on the selected files in the project drawer and on the current document not in a project window, which is more robust than the previous script. I will try to [...]]]></description>
			<content:encoded><![CDATA[<p>The previous post detailed a way to simply run JsLint from TextMate. I put together this shell script that can be run as a command on the selected files in the project drawer and on the current document not in a project window, which is more robust than the previous script. I will try to upload a bundle for this later, but for now, you can create the command in the bundle editor yourself. Make sure that the input is none and that the output is set to the HTML option. Also, *very important*, make sure that you add the unix path to jsl to your shell variables in TextMate using the variable name "JSLINT".</p>
<div class="igBar"><span id="lcode-6"><a href="#" onclick="javascript:showCodeTxt('code-6'); return false;">View as Plain Text<img class="poparrow" src="http://www.plasticstare.com/plains/wp-content/plugins/ig_syntax_hilite/img/poparrow.gif"/></a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-6">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> -n <span style="color:#CC0000;">"$TM_SELECTED_FILES"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">then</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;# THIS WILL RUN JSLINT ON THE SELECTED</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;# FILES IN THE PROJECT DRAWER</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;eval arr=<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"$TM_SELECTED_FILES"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;for <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span> i = <span style="color:#800000;color:#800000;">0</span>; i &lt;$<span style="color:#006600; font-weight:bold;">&#123;</span>#arr<span style="color:#006600; font-weight:bold;">&#91;</span>@<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span>; i++ <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; do</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; filePath=$<span style="color:#006600; font-weight:bold;">&#123;</span>arr<span style="color:#006600; font-weight:bold;">&#91;</span>$i<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; pathLen=$<span style="color:#006600; font-weight:bold;">&#123;</span>#filePath<span style="color:#006600; font-weight:bold;">&#125;</span>-<span style="color:#800000;color:#800000;">3</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; pathEnd=$<span style="color:#006600; font-weight:bold;">&#123;</span>filePath:$pathLen:<span style="color:#800000;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#91;</span> $pathEnd == <span style="color:#CC0000;">".js"</span> <span style="color:#006600; font-weight:bold;">&#93;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;then </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outputFormat=<span style="color:#CC0000;">'&lt;br/&gt;&lt;a href=&quot;txmt://open?url=file://__FILE__&amp;line=__LINE__&quot;&gt;__FILE__&lt;/a&gt; (Line __LINE__):&lt;br/&gt;__ERROR__&lt;br/&gt;'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $JSLINT -process <span style="color:#CC0000;">"$filePath"</span> -output-format <span style="color:#CC0000;">"$outputFormat"</span> -context -nologo</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outputFormat=<span style="color:#CC0000;">'&lt;a href=&quot;txmt://open?url=file://__FILE__&amp;line=__LINE__&quot;&gt;__FILE__&lt;/a&gt; (Line __LINE__):&lt;br/&gt;__ERROR__&lt;br/&gt;&lt;br/&gt;'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $JSLINT -process <span style="color:#CC0000;">"$filePath/*"</span> -output-format <span style="color:#CC0000;">"$outputFormat"</span> +recurse -context -nofilelisting -nologo </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; fi</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; echo <span style="color:#CC0000;">"&lt;br/&gt;&lt;br/&gt;"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;done</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;# THIS RUNS JSLINT ON THE CURRENT FILE</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;filePath=$TM_FILEPATH</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;outputFormat=<span style="color:#CC0000;">'&lt;br/&gt;&lt;a href=&quot;txmt://open?url=file://__FILE__&amp;line=__LINE__&quot;&gt;__FILE__&lt;/a&gt; (Line __LINE__):&lt;br/&gt;__ERROR__&lt;br/&gt;'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;$JSLINT -process <span style="color:#CC0000;">"$filePath"</span> -output-format <span style="color:#CC0000;">"$outputFormat"</span> -context -nologo</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">fi </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If you would like to see which files were skipped due to no error or warning, you can remove the "-nofilelisting" portion of the else statement in the for loop. I especially like the way that you can specify a URL in the html output in TextMate that will allow you to link back to documents that can be opened in TextMate, even down to the line. I'm not sure where that is referenced specifically, but its a pretty cool trick; I found that litte tidbit somewhere out there - I lost it in my browser. Anyway, the above script dumps your jslint output in the HTML output window, and clicking the links for the errors will take you to the document and line where the error was found.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/11/15/jslint-in-textmate/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Jslint OSX</title>
		<link>http://www.plasticstare.com/plains/2006/11/15/jslint-osx/</link>
		<comments>http://www.plasticstare.com/plains/2006/11/15/jslint-osx/#comments</comments>
		<pubDate>Thu, 16 Nov 2006 04:27:13 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/11/15/jslint-osx/</guid>
		<description><![CDATA[So for some reason before I had looked for jslint for doing error checking for javascript and found the one at jslint.com, which requires the installation of Rhino (which is actually also handy for other things); this version for some reason didn't work out so well for me and was throwing some errors that weren't [...]]]></description>
			<content:encoded><![CDATA[<p>So for some reason before I had looked for jslint for doing error checking for javascript and found the one at jslint.com, which requires the installation of Rhino (which is actually also handy for other things); this version for some reason didn't work out so well for me and was throwing some errors that weren't really errors. Today I looked again and realized that <a href="http://www.javascriptlint.com/">http://www.javascriptlint.com/</a> actually has an OSX executable version of jslint. In terms of ease of use, I would recommend this version since it requires no installation. Of course, this also means that I had to start working on integrating it into TextMate. I just gave it a first run, so this is still completely limited, and only works with the selected *files* in the project drawer:</p>
<pre>eval arr=("$TM_SELECTED_FILES")
for (( i = 0; i < ${#arr[@]}; i++ )); do
    $JSLINT -process ${arr[$i]}
    echo "&lt;br/&gt;&lt;br/&gt;"
done
</pre>
<p>The variable $JSLINT I have defined in the TextMate preferences in the "Shell Variables" tab of the "Advanced" preferences. Right now, all this does is run jslint on the selected files and adds a blank line in between the output for the different files. Hopefully I can put together something a bit smarter. Ideally, it would be great to be able to click a link that takes you to the document and specific line where the error is found.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/11/15/jslint-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX Terminal Hack &#8211; .DS_Store files</title>
		<link>http://www.plasticstare.com/plains/2006/11/07/osx-terminal-hack-ds_store-files/</link>
		<comments>http://www.plasticstare.com/plains/2006/11/07/osx-terminal-hack-ds_store-files/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 17:33:57 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/11/07/osx-terminal-hack-ds_store-files/</guid>
		<description><![CDATA[This only prevents .DS_Store files from being written on network shares, but nonetheless, quite handy. In the terminal, enter the following: defaults write com.apple.desktopservices DSDontWriteNetworkStores true]]></description>
			<content:encoded><![CDATA[<p>This only prevents .DS_Store files from being written on network shares, but nonetheless, quite handy. In the terminal, enter the following:</p>
<pre>defaults write com.apple.desktopservices DSDontWriteNetworkStores true</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/11/07/osx-terminal-hack-ds_store-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alias adds to OSX Terminal</title>
		<link>http://www.plasticstare.com/plains/2006/11/06/alias-adds-to-osx-terminal/</link>
		<comments>http://www.plasticstare.com/plains/2006/11/06/alias-adds-to-osx-terminal/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 06:18:50 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/11/06/alias-adds-to-osx-terminal/</guid>
		<description><![CDATA[Since my latest job has gotten me using the Terminal in OSX much moreso than I used to, I've had to bone up on my unix (and linux) commands. Unfortunately, when OSX sets up your user account, there is no .bashrc file (that I could find) for doing things like setting up handy command aliases. [...]]]></description>
			<content:encoded><![CDATA[<p>Since my latest job has gotten me using the Terminal in OSX much moreso than I used to, I've had to bone up on my unix (and linux) commands. Unfortunately, when OSX sets up your user account, there is no .bashrc file (that I could find) for doing things like setting up handy command aliases. For example, by default, typing "ls ~" in the terminal will give you a listing of your home directory, but will not list any "invisible" files (those that start with "."). So, it would be nice to have "ls" actually call "ls -a" every time.</p>
<p>So, to accomplish this, you need to create 2 files, ".bashrc" and ".bash_profile" in your user directory. The contents of the .bash_profile file need to be as such for starters:</p>
<pre>. ~/.bashrc
ENV=$HOME/.bashrc
export ENV</pre>
<p>Then, the contents of .bashrc need to be something like this:</p>
<pre>PATH=$PATH:$HOME/bin:/usr/local/bin
alias ls="ls -a"
SHELL=/bin/bash</pre>
<p>This will get you started. If you have any questions beyond that, do some online searches for .bashrc and shell configuration. (I'm no expert, I just figure out what I need to do to get stuff done...)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/11/06/alias-adds-to-osx-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Textmate Open to New Project Window</title>
		<link>http://www.plasticstare.com/plains/2006/11/02/textmate-open-to-new-project-window/</link>
		<comments>http://www.plasticstare.com/plains/2006/11/02/textmate-open-to-new-project-window/#comments</comments>
		<pubDate>Fri, 03 Nov 2006 02:46:04 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[applescript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/11/02/textmate-open-to-new-project-window/</guid>
		<description><![CDATA[Something that has bothered me for a while in TextMate is that in the project drawer you can open a single file in a new window. Often, I like to open a new scratch project window to edit certain files that may also be in the project itself. A simple solution to this is to [...]]]></description>
			<content:encoded><![CDATA[<p>Something that has bothered me for a while in TextMate is that in the project drawer you can open a single file in a new window. Often, I like to open a new scratch project window to edit certain files that may also be in the project itself. A simple solution to this is to create a new TextMate command (I called it "Open from Drawer" since it allows you to simply open a single file, even though it opens in the same project window). Set the Save to "Nothing", and the Input and Output to "None" and "Discard". In the Commands field, enter the following:</p>
<pre>&#35;&#33;&#47;bin&#47;sh
osascript -e "tell application \"TextMate\" to open POSIX file \"$TM_SELECTED_FILE\""
</pre>
<p>You can set a Key Equivalent if you like. When done, select a folder in your project drawer. If the folder is a file system folder (rather than a group), the script will spawn a new project window containing all the files in that folder. Selecting a "group" folder will do nothing (may work on that one later...).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/11/02/textmate-open-to-new-project-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TextMate Window Arrangement &#8211; Tiling</title>
		<link>http://www.plasticstare.com/plains/2006/11/02/textmate-window-arrangement-tiling/</link>
		<comments>http://www.plasticstare.com/plains/2006/11/02/textmate-window-arrangement-tiling/#comments</comments>
		<pubDate>Thu, 02 Nov 2006 08:35:40 +0000</pubDate>
		<dc:creator>plains</dc:creator>
				<category><![CDATA[applescript]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://www.plasticstare.com/plains/2006/11/02/textmate-window-arrangement-tiling/</guid>
		<description><![CDATA[PlasticWare Downloadable :: Tile Windows Version 1.0 (Nov. 1, 2006) Download (~4k) :: TMBundle.zip So I spent a few minutes looking about today for something that would allow me to tile my open windows in TextMate. I couldn't find anything except for people wishing that TextMate could arrange windows like BBEdit, so I mocked up [...]]]></description>
			<content:encoded><![CDATA[<p><span class="downloadable"><em>PlasticWare Downloadable ::</em><br />
Tile Windows Version 1.0 (Nov. 1, 2006)<br />
Download (~4k) :: <a href="http://www.plasticstare.com/plasticware/textmate/TMBundle.zip">TMBundle.zip</a></span></p>
<p>So I spent a few minutes looking about today for something that would allow me to tile my open windows in TextMate. I couldn't find anything except for people wishing that TextMate could arrange windows like BBEdit, so I mocked up a little applescript application and then copied it over into a TextMate command in the bundle editor wrapped in an osascript call. Its by far not perfect, but here is what it does in a nutshell. </p>
<p>The script gets all the TextMate windows and, for now, grabs only the ones that are both zoomable and visible. I didn't yet filter out some of the possible windows that would be caught by this that you wouldn't want, such as the Bundle Editor window, but I wanted to get something working. It then runs through the windows and does a little math to determine which of the windows is closest to where the new positions should be, and moves them. This algorithm isn't perfect, but it does ok. The default minimum window width is 700px. The default setting for the key command is control-option-command-shift-T (didn't want to overwrite something else <img src='http://www.plasticstare.com/plains/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).</p>
<p>You should be able to unzip and install the bundle as you would any other TextMate bundle. Enjoy it, and if you have any thoughts, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plasticstare.com/plains/2006/11/02/textmate-window-arrangement-tiling/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
