• Home
  • WordPress
    • How To
    • Plugins
    • Themes
      • Genesis
      • Themify
      • Mysite myway
    • Security
    • Developer
    • Teaching
    • Conference
    • Chat
  • Blog
  • About
  • Freelance
    • Plugins
    • Teaching
    • Need help?
    • CV og ref.
  • Contact

Easy Web Design Tutorials

WordPress Tutorials and more

  • Home
  • WordPress
    • How To
    • Plugins
    • Themes
      • Genesis
      • Themify
      • Mysite myway
    • Security
    • Developer
    • Teaching
    • Conference
    • Chat
  • Blog
  • About
  • Freelance
    • Plugins
    • Teaching
    • Need help?
    • CV og ref.
  • Contact

21 December - 2015 By Paal Joachim 2 Comments
Last updated on: April 2, 2020

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.

New file in Automator select - Service

New file in Automator select – Service

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 Library -> Utilities Run Shell Script Service receives: no input 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

 

Share this:

  • Email

Categories: Web Design

Paal Joachim Romdahl

I enjoy teaching and creating tutorials. As well creating web sites.
I help people gain WordPress knowledge through my easy to follow tutorials and specialized training. Contact me for more information on how I can improve your WordPress skills and to help get your web site quickly up and running.

Comments

  1. George Smith says

    30 October - 2020

    I am not sure where you are getting your info, however good topic. I must spend a while studying much more or understanding more.

    Reply
  2. Hannah Flack says

    27 January - 2020

    “This website was… how do I say it? Relevant!! Finally I’ve
    found something that helped me. Appreciate it!”

    Reply

Leave a Comment Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2021 · By Easy Web Design Tutorials · Built on the Genesis Framework · WordPress · Log in · ⇪

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.