Show/hide hidden files in Finders GUI

Just found this little Applescript to hide/show hidden files in Finder. Quite usefull for people who need to acces those fast once in a while.

display dialog "Set the visibility of hidden files..." buttons {"Cancel", "Visible", "Invisible"} default button 1
copy the result as list to {buttonpressed}
if the buttonpressed is "Invisible" then
      try
		tell application "Finder" to quit
		do shell script "defaults write com.apple.finder AppleShowAllFiles OFF"
		delay 1
		tell application "Finder" to activate
	end try
else if the buttonpressed is "Visible" then
	try
		tell application "Finder" to quit
		do shell script "defaults write com.apple.finder AppleShowAllFiles ON"
		delay 1
		tell application "Finder" to activate
	end try
end if

Found it here:  macworld

Category: Tips & Tricks