<?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>hasseg.org &#187; Miscallaneous</title>
	<atom:link href="http://hasseg.org/blog/post/category/misc/feed/" rel="self" type="application/rss+xml" />
	<link>http://hasseg.org/blog</link>
	<description></description>
	<lastBuildDate>Sun, 29 Apr 2012 09:35:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to Display Events or Tasks on Your Desktop With icalBuddy</title>
		<link>http://hasseg.org/blog/post/503/how-to-display-events-or-tasks-on-your-desktop-with-icalbuddy/</link>
		<comments>http://hasseg.org/blog/post/503/how-to-display-events-or-tasks-on-your-desktop-with-icalbuddy/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 23:30:38 +0000</pubDate>
		<dc:creator>Ali Rantakari</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Miscallaneous]]></category>

		<guid isPermaLink="false">http://hasseg.org/blog/?p=503</guid>
		<description><![CDATA[I don&#8217;t really have any statistics about this but I&#8217;m quite sure that an overwhelming majority of the users of my icalBuddy program are using it to display calendar data on their desktop via GeekTool. Several tutorials on how to get this done have been written by different people, mainly for relatively non-technical users, which [...]]]></description>
			<content:encoded><![CDATA[<p>
<img src="http://hasseg.org/blog/wp-content/uploaded/2010/07/all-together.png" alt="icalBuddy, GeekTool, NerdTool icons" title="" width="129" height="131" align="right" /> I don&#8217;t really have any statistics about this but I&#8217;m quite sure that an overwhelming majority of the users of my <a href="/icalBuddy">icalBuddy</a> program are using it to <strong>display calendar data on their desktop</strong> via <a href="http://projects.tynsoe.org/en/geektool/">GeekTool</a>. Several tutorials on how to get this done have been written by different people, mainly for relatively non-technical users, which I think is great. The problem seems to be that many people don&#8217;t know how to configure icalBuddy to give them the kind of output they&#8217;d like and end up copy-pasting the commands from these blogs (some of these blog posts also contain <em>outdated</em> information about a bunch of things). Hopefully this short tutorial (and the <a href="/icalBuddy/examples.html">usage examples page</a>) will offer an easy way to make a more informed decision about how to get this done.
</p>
<p><span id="more-503"></span></p>
<h3>Choose Between GeekTool and NerdTool</h3>
<p>
<a href="http://projects.tynsoe.org/en/geektool/">GeekTool</a> and <a href="http://mutablecode.com/apps/nerdtool">NerdTool</a> are two programs that do the same thing: display stuff on your desktop. The choice between which one to use is up to you but allow me to give a few suggestions:
</p>
<ul>
<li><strong>If you want to change the text colors used in the display</strong>, choose NerdTool <em>(as far as I know, GeekTool can only change the default text color but not the actual colors used for &#8220;red&#8221;, &#8220;blue background&#8221;, &#8220;bright green&#8221; etc.)</em></li>
<li><strong>If you want to hack on the program yourself</strong>, choose NerdTool <em>(it&#8217;s open source)</em>.</li>
<li><strong>If you don&#8217;t care about any of the above</strong>, choose GeekTool.</li>
</ul>
<h3>Install the Apps</h3>
<p>
When you&#8217;ve chosen which one you&#8217;d like to use, <strong>download and install it</strong>. <a href="http://projects.tynsoe.org/en/geektool/">GeekTool</a> is a <em>preference pane</em> so it lives in your System Preferences, while <a href="http://mutablecode.com/apps/nerdtool">NerdTool</a> is a regular application which you drag into your Applications folder.
</p>
<p>
In order to install icalBuddy, <a href="/icalBuddy">download</a> the latest version and unzip the package by double-clicking on it. Open the unzipped folder, <strong>double-click on install.command</strong> and follow the instructions (you&#8217;ll have to press return, input your password and icalBuddy will be installed).
</p>
<h3>Figure out Your icalBuddy Configuration</h3>
<p>
So now you need to figure out what to put into the <em>command</em> field in Geek-/NerdTool. <strong>First you need to go to the <a href="/icalBuddy/examples.html">icalBuddy Usage Examples</a> page and browse through it</strong> &#8212; you might find the kind of output you&#8217;re looking for right there, in which case <strong>you can just get the command you see there</strong> <em>(note that some of the examples require you to <a href="http://hasseg.org/icalBuddy/examples.html#Getting+Started+With+Custom+Output+Formatting">add something to the configuration file</a>)</em>.
</p>
<p>
If you&#8217;d like to take some of the examples and modify the output a bit, you can fire up your Terminal.app and start experimenting with <a href="/icalBuddy/man.html">different arguments</a>. In this case the <a href="/icalBuddy/#documentation">documentation links</a> will come in handy.
</p>
<h3>Add Your icalBuddy Command into GeekTool/NerdTool</h3>
<p>
Once you have your command, you can put it into the app by creating a new &#8220;shell&#8221; entry:</p>
<ul>
<li><strong>GeekTool:</strong> Drag the &#8220;Shell&#8221; geeklet icon (see below) onto your desktop. The properties window for this entry should appear.</li>
<p><img src="http://hasseg.org/blog/wp-content/uploaded/2010/07/geektool-shell.png" alt="" title="" width="400" height="263" /></p>
<li><strong>NerdTool:</strong> Click the &#8220;plus&#8221; button (see below) and select &#8220;Shell&#8221; from the popup. A new entry is created into the list above.</li>
<p><img src="http://hasseg.org/blog/wp-content/uploaded/2010/07/nerdtool-add.png" alt="" title="" width="400" height="382" />
</ul>
</p>
<p>
You can then <strong>insert your icalBuddy command into the command field</strong> in whichever app you&#8217;re using (and set the refresh interval in order to specify how often the command should be run):
</p>
<p><img src="http://hasseg.org/blog/wp-content/uploaded/2010/07/geektool-and-nerdtool-command-fields.png" alt="" title="" width="470" height="334" /></p>
<p>
That&#8217;s it. You can then delve into the settings that both GeekTool and NerdTool offer you, like changing the colors and fonts used for the output.</p>
]]></content:encoded>
			<wfw:commentRss>http://hasseg.org/blog/post/503/how-to-display-events-or-tasks-on-your-desktop-with-icalbuddy/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Getting a List of Installed Fonts with Flash and Javascript</title>
		<link>http://hasseg.org/blog/post/526/getting-a-list-of-installed-fonts-with-flash-and-javascript/</link>
		<comments>http://hasseg.org/blog/post/526/getting-a-list-of-installed-fonts-with-flash-and-javascript/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 23:18:05 +0000</pubDate>
		<dc:creator>Ali Rantakari</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Miscallaneous]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hasseg.org/blog/?p=526</guid>
		<description><![CDATA[When implementing the feature in the icalBuddy examples page where the font used for the output examples could be changed interactively I needed to get a list of all the fonts installed on the current user&#8217;s computer. This blog post from 2006 explains how to do it, but it refers to the deprecated ActionScript 2 [...]]]></description>
			<content:encoded><![CDATA[<p>
<img src="http://hasseg.org/blog/wp-content/uploaded/2010/07/flash-fonts.png" alt="" title="" width="90" height="104" align="right" /> When implementing the feature in the <a href="/icalBuddy/examples.html">icalBuddy examples page</a> where the font used for the output examples could be changed interactively I needed to <strong>get a list of all the fonts installed on the current user&#8217;s computer</strong>. <a href="http://www.maratz.com/blog/archives/2006/08/18/detect-visitors-fonts-with-flash/">This blog post from 2006</a> explains how to do it, but it refers to the deprecated ActionScript 2 API so I had to figure out how to do it with AS3.
</p>
<p><span id="more-526"></span></p>
<h3>Demo</h3>
<p>
Here&#8217;s a small demo where you can see the feature at work: <a href="/stuff/fontList/example.html">Font List Example</a>. The sources shown below are used in this demo.
</p>
<h3>Implementation</h3>
<p>
We need <strong>a small Flash app and some Javascript</strong>. Below is the source code for the Flash app.
</p>
<p>
<em>Note that you don&#8217;t need the Flash authoring app from Adobe in order to compile this; you can simply use the <span style="font-family:monospace;">mxmlc</span> compiler in the <a href="http://opensource.adobe.com/wiki/display/flexsdk/">Flex SDK</a> (which is open source).</em>
</p>
<div class="codecolorer-container actionscript mac-classic codecolorer-customstyle" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">// FontList.as</span><br />
package <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">Font</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #006600;">FontType</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #006600;">FontStyle</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">external</span>.<span style="color: #006600;">ExternalInterface</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FontList <span style="color: #0066CC;">extends</span> Sprite<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> FontList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'populateFontList'</span>, getDeviceFonts<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getDeviceFonts<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Array</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> embeddedAndDeviceFonts:<span style="color: #0066CC;">Array</span> = <span style="color: #0066CC;">Font</span>.<span style="color: #006600;">enumerateFonts</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> deviceFontNames:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">font</span>:<span style="color: #0066CC;">Font</span> <span style="color: #b1b100;">in</span> embeddedAndDeviceFonts<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">font</span>.<span style="color: #006600;">fontType</span> == FontType.<span style="color: #006600;">EMBEDDED</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">||</span> <span style="color: #0066CC;">font</span>.<span style="color: #006600;">fontStyle</span> <span style="color: #66cc66;">!</span>= FontStyle.<span style="color: #006600;">REGULAR</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">continue</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; deviceFontNames.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">font</span>.<span style="color: #006600;">fontName</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; deviceFontNames.<span style="color: #0066CC;">sort</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> deviceFontNames;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div></div>
<p>
Notice how the Flash app calls a Javascript function <span style="font-family:monospace;">populateFontList()</span> via the ExternalInterface. Now we just need to implement that function in the page where we embed the Flash object:
</p>
<div class="codecolorer-container javascript mac-classic codecolorer-customstyle" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> populateFontList<span style="color: #009900;">&#40;</span>fontArr<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> key <span style="color: #000066; font-weight: bold;">in</span> fontArr<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> fontName <span style="color: #339933;">=</span> fontArr<span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// trim</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; fontName <span style="color: #339933;">=</span> fontName.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\s\s*/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\s\s*$/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>fontName.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/[_\-\s]Italic$/</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">||</span> fontName.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/[_\-\s](Demi)?[Bb]old$/</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">||</span> fontName.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/[_\-\s]Medium$/</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">||</span> fontName.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/[_\-\s](Ultra)?[Ll]ight$/</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">||</span> fontName.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/[_\-\s]Condensed$/</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// font is &quot;non-regular&quot; (i.e. bold, italic etc.)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// (do something here with fontName)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// font is &quot;regular&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// (do something here with fontName)</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://hasseg.org/blog/post/526/getting-a-list-of-installed-fonts-with-flash-and-javascript/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Prevent iTunes websites from opening the iTunes app using GlimmerBlocker</title>
		<link>http://hasseg.org/blog/post/441/prevent-itunes-websites-from-opening-the-itunes-app-using-glimmerblocker/</link>
		<comments>http://hasseg.org/blog/post/441/prevent-itunes-websites-from-opening-the-itunes-app-using-glimmerblocker/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 21:41:57 +0000</pubDate>
		<dc:creator>Ali Rantakari</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Miscallaneous]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://hasseg.org/blog/?p=441</guid>
		<description><![CDATA[A few minutes ago I clicked on an iTunes store link on a website and had to again completely lose it because of the iTunes app popping up without me asking it to. This is a common annoyance that people have found a bunch of different ways to combat, ranging from messing with the system&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>
<img align="right" src="http://hasseg.org/blog/wp-content/uploaded/2010/04/itunes-kickass.png" alt="" width="115" height="96" /> A few minutes ago I clicked on an iTunes store link on a website and had to again completely <em>lose it</em> because of the iTunes app popping up without me asking it to. This is a common annoyance that people have found a bunch of different ways to combat, ranging from messing with the system&#8217;s (or the browser&#8217;s) mapping of URL protocol handlers to rewriting parts of web pages via a browser plugin (e.g. GreaseMonkey) or a localhost web proxy (e.g. GlimmerBlocker).
</p>
<p><span id="more-441"></span></p>
<div class="note">
<strong>Note (Aug &#8217;10):</strong> Now that Safari 5 has support for extensions, installing the <a href="http://einserver.de/nomoreitunes">NoMoreiTunes extension</a> is probably a better way to do this.
</div>
<p>
I read somewhere that Safari (or the OS? or iTunes?) sometimes decides to &#8220;fix&#8221; the mappings of iTunes URL protocol handlers, forcing you to &#8220;play cat and mouse&#8221; if you decide to prevent iTunes from automagically opening up by removing it as the itms: protocol handler, so I decided that it would be best to try and fix this problem by messing with the iTunes website source via GlimmerBlocker, which I already was using for ad blocking.
</p>
<p>
I couldn&#8217;t find any straightforward directions on how to do this with GlimmerBlocker so I decided to post it here myself once I figured out how to do it. So this is how I prevented iTunes from automatically opening up whenever I open up a store link in my browser:
</p>
<ul>
<li>Open the GlimmerBlocker &#8220;filters&#8221; tab and <strong>add a new filter</strong>, as well as <strong>a new rule</strong> for this filter.</li>
<li>Select <strong>Whitelist URL, optionally modifying content</strong> as the action</li>
<li>For the <em>Host</em> section, select <strong>is</strong> as the predicate and type in <strong>itunes.apple.com</strong></li>
<li>Select <strong>ignored</strong> for both <em>Path</em> and <em>Query</em></li>
<li>Switch to the <strong>transform</strong> tab and type in the following:</li>
<div class="codecolorer-container javascript mac-classic codecolorer-customstyle" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">replace<span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/detectAndOpenItunes\(\);/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&lt;!-- detectAndOpenItunes() zapped --&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<li>Make sure the <em>Only for content-type</em> selection in the bottom-right corner of the dialog sheet is <strong>html</strong></li>
<li>Save</li>
</ul>
<p>
This seems to correctly prevent the iTunes app from opening up whenever a store website is opened, but it still allows for opening the viewed product in the stand-alone app via the <em>&#8220;View in iTunes&#8221;</em> link on the page.</p>
]]></content:encoded>
			<wfw:commentRss>http://hasseg.org/blog/post/441/prevent-itunes-websites-from-opening-the-itunes-app-using-glimmerblocker/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quick File Tagging in OS X with Punakea (&amp; Tagger)</title>
		<link>http://hasseg.org/blog/post/146/quick-file-tagging-in-os-x-with-punakea-tagger/</link>
		<comments>http://hasseg.org/blog/post/146/quick-file-tagging-in-os-x-with-punakea-tagger/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 22:10:35 +0000</pubDate>
		<dc:creator>Ali Rantakari</dc:creator>
				<category><![CDATA[Miscallaneous]]></category>

		<guid isPermaLink="false">http://hasseg.org/blog/?p=146</guid>
		<description><![CDATA[Even though I am a little pedantic in some ways (like most engineers are, I suppose,) I always seem to have trouble organizing the files on my computer(s) with any kind of reasonable folder structure or naming convention. I often find myself desperately trying to find a specific file that I know I have somewhere [...]]]></description>
			<content:encoded><![CDATA[<p>
<img src="/tagger/appIcon.png" align="right" /> <img src="http://hasseg.org/blog/wp-content/uploaded/2008/06/punakea-icon.jpg" alt="" title="punakea-icon" width="87" height="87" align="right" /> Even though I am a little pedantic in some ways (like most engineers are, I suppose,) I always seem to have trouble organizing the files on my computer(s) with any kind of reasonable folder structure or naming convention. I often find myself desperately trying to find a specific file that I know I have somewhere but I&#8217;m not sure where, and sometimes I just want to find a bunch of files that are somehow related but not actually saved into the same folder. These are problems that <a href="http://en.wikipedia.org/wiki/Tag_(metadata)">tagging</a> is trying to solve (and doing a reasonably good job at it, I might add.)
</p>
<p><span id="more-146"></span></p>
<p>
There are <a href="http://lifehacker.com/tag/tagging/">many solutions for tagging files</a> for OS X and other platforms, but I&#8217;ve tried to be judicious about adopting any method or solution that would somehow seem like too much of a hack and not something that makes an effort to integrate into the OS. The file metadata system in OS X is something that I believe can be used to solve this issue, and <a href="http://www.nudgenudge.eu/punakea">Punakea</a>, which is a tagging application that saves tags you add for files into their &#8220;Spotlight comments&#8221; metadata fields, was the first thing that seemed like something I should try. Well, I did try it, and quite liked it, so I started researching ways to make tagging files with it as quick and effortless as possible.
</p>
<p>
I wanted to be able to simply select a file in Finder, hit a keyboard shortcut to go into &#8220;tagging mode&#8221;, type in some tags, and hit another keyboard shortcut to save the tags into the file and leave the &#8220;tagging mode&#8221;. People have found quite effective <a href="http://www.nudgenudge.eu/support/finder-hotkey">ways to do this</a>, most notably (in my opinion) by invoking Punakea&#8217;s tagger window via assigning a Finder shortcut for its &#8220;Tag File&#8221; service. This worked quite well, but I had a pet peeve about the fact that the tags field in Punakea&#8217;s tagger window was fully selected by default, which meant an extra &#8220;right arrow&#8221; key press to move the insertion point to the end of the list before starting to type in any extra tags. This, combined with the fact that I was eager to learn some more Objective-C, prompted me to write <a href="/tagger/">Tagger</a>.
</p>
<p>
Tagger is a simple application that takes one file as an argument when it launches and allows you to edit its tags. Here&#8217;s a screenshot of what it looks like:
</p>
<p><img src="http://hasseg.org/blog/wp-content/uploaded/2008/06/tagger-screenshot.jpg" alt="" title="tagger-screenshot" width="400" height="187" class="aligncenter size-full wp-image-147" /></p>
<p>
Thanks to the lovely fact that Nudge:Nudge, the makers of Punakea, have released the <a href="http://www.nudgenudge.eu/taggingframework">tagging framework</a> they use in Punakea as open source, I was able to just use that in Tagger as the basis for working with the tags. This fact also makes Tagger and Punakea (and also any other applications that use the same framework) inherently compatible. In future versions of Tagger I&#8217;ll probably try to work on adding alternative tag storage methods (a custom format for tags saved into Spotlight Comments is probably first on the list.)
</p>
<p>
I have set up <a href="/tagger/">a separate page</a> on this site for Tagger, where you can find more info on how to use it, the changelogs for different versions, and of course the download links.</p>
]]></content:encoded>
			<wfw:commentRss>http://hasseg.org/blog/post/146/quick-file-tagging-in-os-x-with-punakea-tagger/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Fixing the Nokia N82 iSync Plug-In</title>
		<link>http://hasseg.org/blog/post/126/fixing-the-nokia-n82-isync-plug-in/</link>
		<comments>http://hasseg.org/blog/post/126/fixing-the-nokia-n82-isync-plug-in/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 18:25:39 +0000</pubDate>
		<dc:creator>Ali Rantakari</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Miscallaneous]]></category>

		<guid isPermaLink="false">http://hasseg.org/blog/?p=126</guid>
		<description><![CDATA[I Recently updated my cell phone to a Nokia N82. The most positive points about it are the relative snappiness of the user interface (most Symbian S60 devices are dog slow in that department) and the quite exhaustive feature list. The build quality feels alright and the camera takes excellent pictures for a phone. One [...]]]></description>
			<content:encoded><![CDATA[<p>
<img align="right" src='http://hasseg.org/blog/wp-content/uploaded/2008/03/n82_isync_buddies.png' alt='N82 and iSync buddy picture' /> I Recently updated my cell phone to a <a href="http://www.forum.nokia.com/devices/N82">Nokia N82</a>. The most positive points about it are the relative snappiness of the user interface (most Symbian S60 devices are dog slow in that department) and the quite exhaustive feature list. The build quality feels alright and the camera takes excellent pictures for a phone. One of the biggest things that I enjoyed with my previous phone (a <a href="http://www.forum.nokia.com/devices/3230">Nokia 3230</a>) was the nicely working synchronization with Apple&#8217;s iSync, so naturally I made sure that this would also work with the N82. Apple has included built-in support for syncing the 3230 in the iSync that ships with Leopard (it was in the Tiger version as well,) so I didn&#8217;t need to install anything extra to get it to work. The N82, on the other hand, is not supported out of the box, so I needed to get <a href="http://europe.nokia.com/A4299040">an iSync plug-in for it</a> from Nokia.
</p>
<p><div class="note">
<em><strong>Update (Jan 30, 09):</strong> A little birdie told me that the issue detailed in this post has been fixed in the latest version of <a href="http://europe.nokia.com/A4299040">the official plugin from Nokia</a>.</em>
</div>
</p>
<p><span id="more-126"></span></p>
<h3>The Problem</h3>
<p>
The N82 iSync plug-in implements syncing features through the <a href="http://en.wikipedia.org/wiki/SyncML">SyncML protocol</a> that Nokia has been supporting in its phones for a while now, as opposed to the built-in support for the 3230, which was implemented via a piece of &#8220;sync agent&#8221; software that had to be installed on the phone. The installation of the plug-in went well, and I was quickly on my way to synchronizing my contacts and calendars onto the phone from my MacBook. When I looked at the results, though, I soon found out that all-day events from iCal were synchronized to the phone as <em>meetings</em> starting at 00:00 and ending at 23:59, instead of <em>memos</em>, which is how the phone calendar handles the concept of an &#8220;all-day event&#8221;. Additionally, when I tried to edit one of these all-day events (ones that were created in iCal, that is) on the phone and sync the changes back to the Mac, I got an error message from iSync saying that changing all-day events on the phone is not allowed. This was not the case with the 3230, which interpreted all-day events created in iCal properly and allowed for changing them on the phone as well (thanks to Apple&#8217;s sync agent software, I guess.) This would not fly.
</p>
<p><img src='http://hasseg.org/blog/wp-content/uploaded/2008/03/n82-alldayevents-and-warning.png' alt='N82 calendar screenshot with default settings + iSync error message about editing all day events on the phone' /></p>
<h3>Research</h3>
<p>
I Started to research the issue with my BFF <a href="http://www.google.co.jp">Google</a>, and found out that this was a pretty common problem with recent S60 phones and their iSync plug-ins. Some <a href="http://forums.sbsh.net/index.php?s=91a46c8d812879028c3a6bc7e34fb62d&#038;showtopic=12838">suggested workarounds for other S60 phones</a> included mentions of the <em>MetaClasses.plist</em> file in the iSync plug-in bundle (and some keys therein,) so this is what I started to look at next. Apparently the iSync plug-ins that Nokia offers are created with the <em>&#8220;iSync Plug-in Maker&#8221;</em> software that Apple ships with OS X (it&#8217;s in the Developer Tools package that you have to install manually,) so I fired that up to investigate further. In the &#8220;Advanced options&#8221; section of that software I found an interesting option called <em>&#8220;All-day event format&#8221;</em> that seems to correspond with the <em>AllDayEventFormat</em> key in the MetaClasses property list.
</p>
<p><img src='http://hasseg.org/blog/wp-content/uploaded/2008/03/isync-plugin-maker.png' alt='iSync Plug-in Maker' /></p>
<p>
The description for that key in iSync Plug-in Maker offers two example values. By browsing the web and going through the MetaClasses.plist files of other (built-in) iSync plug-ins for S60 phones I collected a couple more possible values:</p>
<ul>
<li>AllDayEventMidnight (this is the default value in the N82 plug-in)</li>
<li>AllDayEventWithoutTime</li>
<li>AllDayEventCategoriesAndMidnight</li>
<li>AllDayEventCategories</li>
</ul>
<h3>Some Testing, More Research and a Revelation</h3>
<p>
I then started testing each of these. After each time I saved a new value in the property list for this key, I added all-day events for the current date in both iCal and the phone calendar, and then synced. This produced some initial results, but I also wanted to test editing the events, so I proceeded to edit the event made on the phone in iCal, and the event made in iCal on the phone, syncing again afterwards.
</p>
<p>
The results were varying, but none of the values I tried solved the problem completely. The most promising was <em>AllDayEventCategoriesAndMidnight</em>, which kept the original behaviour but allowed for editing the events created in iCal on the phone. This was not enough for me, of course, so I started googling a bit more to find some other things to try out with this property list. Then I managed to stumble upon <a href="http://www.omenamehu.org/index.php?PHPSESSID=e3a285e5f038b924bfa929834dca54d9&#038;topic=13617.msg554071#msg554071">this post</a> on a Finnish Mac-themed message board (sorry, it&#8217;s in finnish.) It seemed &#8220;juksu&#8221; had fixed this same problem for his Nokia N90 by merging some of the key/value pairs from the Apple-provided Nokia N73 iSync plug-in&#8217;s MetaClasses.plist onto the corresponding file in his phone&#8217;s plug-in bundle.
</p>
<p>
I took a look at some of the property list keys juksu mentioned in his post, and started copying the ones that seemed to somehow make sense (with regard to the issue) into the N82 plug-in&#8217;s plist. After some trial and error I managed to find the keys and values I had to use in order to get the thing to work.
</p>
<h3>The Conclusion</h3>
<p>
It seems I have the problem solved now: all-day events created in iCal show up on the phone as memos and editing them on the phone doesn&#8217;t result in an error message anymore:
</p>
<p><img src='http://hasseg.org/blog/wp-content/uploaded/2008/03/working-calendar-all-day-events.png' alt='Working N82 iSync plugin screenshots' /></p>
<p>
Otherwise the thing seems to function as usual (as in: I haven&#8217;t found this hack to result in any sort of collateral damage,) although I haven&#8217;t really been using the calendars properly after doing this. I will report here if I notice any weird behaviour, though. Below I&#8217;ve summarized the steps needed to apply this hack to the plug-in:
</p>
<ol>
<li>Install the N82 iSync plug-in</li>
<li>Make a backup copy of the MetaClasses.plist file somewhere (you can find it in <em>/Library/PhonePlugins/Nokia_N82_1v1.phoneplugin/Contents/Resources/MetaClasses.plist</em>)</li>
<li>Open the original file in a text editor</li>
<li>Make the following edits under &#8220;com.apple.pimsync.parser.vCal&#8221;:</li>
<ul>
<li>Change the value of the &#8220;AllDayEventFormat&#8221; key to &#8220;AllDayEventCategoriesAndMidnight&#8221;</li>
<li>Add the following below the &#8220;AllDayEventFormat&#8221; key/value combo:</li>
<div class="codecolorer-container xml mac-classic codecolorer-customstyle" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>PropertyNameMapping<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>CATEGORIES<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>X-EPOCAGENDAENTRYTYPE<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AllDayCategories<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>EVENT<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ANNIVERSARY<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>TimedCategories<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>APPOINTMENT<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
</ul>
<li>Save the file</li>
<li>Open iSync, purge the calendar data on your phone and then sync</li>
</ol>
<p>
You can also just download the <em>MetaClasses.plist</em> file that I&#8217;ve been using: <a href="/stuff/N82iSyncPluginFix/N82iSyncPluginFix-MetaClasses.plist.zip">N82iSyncPluginFix-MetaClasses.plist.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hasseg.org/blog/post/126/fixing-the-nokia-n82-isync-plug-in/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
	</channel>
</rss>

