Edit: After half day, my wife’s Mac started having the same problem. I have then applied the solution that I found in the Apple
How To Toggle between Hidden Files
While you may use Finder to locate even hidden files if you know the right path, this style of locating hidden files can be tedious especially when you have too many hidden files to work on and there is a need to keep hiding them after use.
To solve this problem, the best solution is to use Automator, which uses shell scripts and OS X’s Service menu within the Finder. Let’s have a look at how the script works.
First launch the Automator. Move on to the templates and choose Service. Now drag the Run AppleScript action from the library and place it on the work area. Move to the top right and select Finder.app from the drop down box. Select No Input from the drop down: Service Receives.
Now copy the mentioned code. Move on to the Run AppleScript box and paste the code there. Paste the code between the lines beginning from run and return input.
The code: if (do shell script “defaults read com.apple.finder AppleShowAllFiles”) is equal to “0” then
do shell script “defaults write com.apple.finder AppleShowAllFiles 1″
do shell script “defaults write com.apple.finder AppleShowAllFiles 0″
tell application “Finder” to quit
tell application “Finder” to activate
While copy pasting the code, ensure that the quotes and apostrophes come as plain text. For this use Mac Notepad and kill the legacy that you will otherwise find when you copy the code from the website.
Once pasted, Save the Service and exit Automator. You are ready to roll now.
Now whenever you want to toggle between hidden files, simply go to Finder>>Services. Then select Toggle Hidden Files. This script, once launched, toggles the hidden files.
Alternatively you can also try AppleScript Editor. Simply paste the code there and save it as an application. Now anytime you want to use it, go to the Dock and launch it from there. Scripts work in mostly all versions of OS X. you can also try this in Tiger and Leopard.