Toggling hidden files on Finder

Open automator, choose “run shell script” under “utilities” then use the following code.
Save it.

STATUS=`defaults read com.apple.finder AppleShowAllFiles`
if [ $STATUS == YES ]; 
then
    defaults write com.apple.finder AppleShowAllFiles NO
else
    defaults write com.apple.finder AppleShowAllFiles YES
fi
killall Finder

You can assign a short cut to the above script like: shift+cmd+.

Screen Shot 2014-01-09 at 08.40.14