Show or hide hidden files using a service made in Automator.
Update 2 april 2020. NB! An easier method is using a shortcut:
“…press Command + Shift + . to show hidden files. If you want to hide those files again, you can press this shortcut again. This method applies to macOS Sierra or higher.”
Resource: https://www.minitool.com/news/show-hidden-files-mac.html
Using Automator
Instead of opening the terminal one can instead make an Automator script to turn on or off hidden files on the Mac. I will then show how to create a shortcut in the Finder -> Services menu.
NB! Do also look below the video at my written instructions.
Go to applications and open the Automator.
Select Service. Then click the Choose button.
From the left:
Under Library -> Select Utilities
To the right of Utilities: select Run Shell Script and also drag it to the empty window on the right.
Below the record button top right:
Service receives drop down select no input (bottom of drop down list) and select in the next drop down in Finder.

Automator. Select: Library -> Utilities. Then select: Run Shell Script. Then select: Service receives: no input in Finder
The Run Shell Script section is seen the window on the right add the following code into it.
status=`defaults read com.apple.finder AppleShowAllFiles`
if [ $status == true ];
then
defaults write com.apple.finder AppleShowAllFiles false
else
defaults write com.apple.finder AppleShowAllFiles true
fi
killall Finder
Save the file. I called min Show Hide hidden files.
To use the script click the desktop and go to the Finder menu -> select Services -> name of show-hide file.
Finder will refresh and show the hidden files. Turn on or off hidden files by selecting the Services and show-hide file.
NB! If you get an error with the above code. Use the following code instead:
osascript -e ‘tell application “Finder” to quit’
SHOWHIDDEN=`defaults read com.apple.finder AppleShowAllFiles`
if [ $SHOWHIDDEN -eq 1 ]; then
defaults write com.apple.finder AppleShowAllFiles -bool FALSE
else
defaults write com.apple.finder AppleShowAllFiles -bool TRUE
fi
osascript -e ‘tell application “Finder” to activate’
Automator Services script location
The Automator script we just created is located in:
Go to your hard drive -> user name -> Library -> Services -> and there you will see the Services Automator script.
NB! You might not see the Library folder. So go to the top Mac menu and select Go and hold down the alt key to make the Library folder seen in the Go menu. While holding down the alt/option key select Library in the Go menu. In The Library folder look for the Services folder and there you will see the Services Automator script. Double click to open the script in Automator.
Creating a shortcut
Go to System Preferences -> Keyboard -> Shortcuts -> Services and find the Services you made showing hidden files. There might be a shortcut there if so test it out. If there is not shortcut there then add shift+cmd+. (period) as the shortcut.
To show hidden files use the shortcut: shift+cmd+. (period).
To hide the files use the same shortcut again.
Using terminal to show or hide hidden files
The classic way to show and hide hidden files is to open terminal.
Applications -> Utilities -> Terminal
Then write:
defaults write com.apple.finder AppleShowAllFiles TRUE
To hide:
defaults write com.apple.finder AppleShowAllFiles FALSE
Resources:
manishluintel.com.np/hide-unhide/
discussions.apple.com/message/29357134#29357134
How to delete Automator services.
Youtube video
tekrevue.com/tip/show-hidden-files-on-mac-os-x/
Software to show or hide hidden files.
nektony.com/products/funter
I am not sure where you are getting your info, however good topic. I must spend a while studying much more or understanding more.
“This website was… how do I say it? Relevant!! Finally I’ve
found something that helped me. Appreciate it!”