How to make a script to show/hide hidden files in Mac OS X?

daremigio picture daremigio · Dec 9, 2013 · Viewed 17.3k times · Source

I just got my MBP with Retina and i'm really new to the Mac OS X (using PC before). I noticed that the Mac doesn't have a GUI to show/hide hidden files like Windows. I've researched and saw this site Show Hidden Files on your Mac. And yes, it works.

To show hidden files: (Using Terminal) defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder

To hide hidden files: defaults write com.apple.finder AppleShowAllFiles FALSE killall Finder

What i wanted to do is to make an executable script that will perform the above commands when i double-click it so that i don't have to type commands in Terminal in order for me to show/hide hidden files. I saw Applescript but i'm not very familiar with it. I don't know the commands to perform what i want. But i've read some.

Can someone please help me make an executable script that will show/hide hidden files in my Mac?

Answer

krmanish007 picture krmanish007 · Jan 12, 2017

You don't need script anymore. Open the finder, press + ⇧ Shift + . and it will show/hide your files.