.htaccess is one of the files that you might need to access when dev websites locally. The thing is, any file that begins with a period (.) are hidden. This is good because accidentally editing these core files can cause you massive headaches.
However there is a way to add a ‘Toggle Hidden Files’ shortcut to the ‘Services’ option in the menubar, and this is available no matter which program you happen to have selected at the time.
1 Fire up Automator in your Apps folder.
2 Select Utilities from the library. Choose ‘Run Shell Script’ and double click.
3 In the text box paste the following command:
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
4 Change the ‘Service Receives’ dropdown box to ‘no input’ and then save (⌘S) the workflow as ‘Toggle Hidden Files’.
5 Done! Now when you need to see hidden files click your shiny new menu option and click it again to hide them once more.