<?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>Jon Knapp &#187; OSX</title>
	<atom:link href="http://www.jonknapp.com/tag/osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonknapp.com</link>
	<description>I&#039;m a fan of &#34;web development&#34; on Facebook.</description>
	<lastBuildDate>Sat, 07 Aug 2010 14:24:25 +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>Toggle hidden file viewing in Mac OS X</title>
		<link>http://www.jonknapp.com/2008/04/toggle-hidden-file-viewing-in-mac-os-x/</link>
		<comments>http://www.jonknapp.com/2008/04/toggle-hidden-file-viewing-in-mac-os-x/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 04:49:30 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Finder]]></category>
		<category><![CDATA[hidden files]]></category>
		<category><![CDATA[hidden folders]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://cupof.coffeeandcode.com/?p=10</guid>
		<description><![CDATA[My one regret with OS X&#8217;s Finder is that I have found no easy way to toggle viewing hidden files and folders. In fact I was so perturbed that I went and wrote a small application to toggle hidden file and folder visibility when ran. There are a couple of sites out there that show [...]]]></description>
			<content:encoded><![CDATA[<p>My one regret with OS X&#8217;s Finder is that I have found no easy way to toggle viewing hidden files and folders.  In fact I was so perturbed that I went and wrote a small application to toggle hidden file and folder visibility when ran.</p>
<p>There are a <a href="http://www.osxfaq.com/DailyTips/02-2005/02-01.ws">couple</a> <a href="http://www.macosxhints.com/article.php?story=20010328120852495">of</a> <a href="http://lifehacker.com/software/command-line/show-hidden-files-in-finder-188892.php">sites</a> out there that show the way to do it, but none are that graceful.  They require the user to force restart Finder (which is not desirable) and they usually call upon the use of Terminal and typing out the full command.</p>
<p>Not satisfied with a simple answer, and trying to avoid actual work, I decided to write up an AppleScript that would toggle the visibility of hidden files and folders from &#8220;on&#8221; to &#8220;off&#8221; every time you clicked it.  I then packaged it up in a pretty little application, and even gave it a custom small icon so you can drag it to the right side of current icons in a Finder window and it looks pretty sharp.  I got the icon idea from <a href="http://lifehacker.com/373507/set-up-better-time-machine-access">here</a>.</p>
<p>Here&#8217;s the <a href="http://www.coffeeandcode.com/products/toggle/toggle.zip">application</a>!  Hope it helps you out like it did for me.</p>
<p>And for those out there that like code:</p>
<pre class="brush: sh">
# Jonathan Knapp
# Caffeinated Solutions
# www.coffeeandcode.com

# This application toggles the visiblity of hidden files and folders in Mac OSX.
set userCancelled to false
try
	# give the user a warning about the negative effects of restarting Finder
	set alertResult to display alert &quot;Warning! Restarting Finder can have bad results on opened files. Are you sure you want to continue?&quot; buttons {&quot;Sure!&quot;, &quot;Not really...&quot;} as warning default button &quot;Not really...&quot; cancel button &quot;Not really...&quot;
on error number -128
	# user hit the cancel button
	set userCancelled to true
end try

# if the user wants to proceed...
if userCancelled is false and button returned of alertResult is &quot;Sure!&quot; then
	try
		# get the current value; an error is thrown if none exists
		set currentValue to do shell script &quot;defaults read com.apple.finder AppleShowAllFiles&quot;
		if currentValue is &quot;TRUE&quot; then
			set currentValue to &quot;FALSE&quot;
		else
			set currentValue to &quot;TRUE&quot;
		end if
	on error
		# there are a couple errors that could catch here if the AppleShowAllFiles has no current value (ran for the first time)
		set currentValue to &quot;TRUE&quot;
	end try

	do shell script &quot;defaults write com.apple.finder AppleShowAllFiles &quot; &amp; currentValue
	do shell script &quot;osascript -e &#039;tell application \&quot;Finder\&quot; to quit&#039;&quot;
	do shell script &quot;osascript -e &#039;tell application \&quot;Finder\&quot; to activate&#039;&quot;
end if
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jonknapp.com/2008/04/toggle-hidden-file-viewing-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
