10 Replies Latest reply: Dec 9, 2008 3:23 AM by bpbpbp
Dennis_S Level 1 (5 points)
When I am on my home network and logged into my other machines (one oc and one other mac) I get to see all the hidden files and it becomes quite confusing. I know its a simple toggle in Windows to show or hide hidden files. Is there a way to do this easily in Mac

Mac 24, Mac OS X (10.5.1)
  • Kappy Level 10 (263,335 points)

    Open the Terminal application in your Utilities folder and enter or paste the following command lines, then press RETURN after each.

    defaults write com.apple.finder AppleShowAllFiles FALSE
    killall Finder

    To show hidden files simply substitute TRUE for FALSE in the first command line.
  • KJK555 Level 4 (2,895 points)
    This is really handy when you create it as a shell script, wrap it an Automator plugin for Finder and can then access it from the context menu.

    Now I can right click, access the Automator submenu and select “Show Hidden Files” (the name I gave to the plugin). To invert, I select my “Hide Hidden Files” plugin.

  • Dennis_S Level 1 (5 points)
    defaults write com.apple.finder AppleShowAllFiles FALSE
    killall Finder

    I was reading your entry about my problem and wondered if you can help me with automator to do the same as what you have done
  • Kappy Level 10 (263,335 points)
    Automator has a Do Shell Script function. You can use that. Of course you will need to provide some additional code to be able to toggle back and forth between TRUE and FALSE.

    Alternatively, put it in an AppleScript along with the additional script code to do a toggle.

    Or you can download the freeware utility - ShowHideInvisibleFiles - from VersionTracker or MacUpdate.
  • Dennis_S Level 1 (5 points)
    Actually I am new to Mac and have no clue of this. Is there somewhere I cold go to get instructions how to use automator and how to do tasks like this?
  • Kappy Level 10 (263,335 points)
    Sure. Open Automator and start playing with it. Use Automator Help from the Help menu for things you don't know how to do. Go to Apples website and watch the tutorials. Google "automator" and "applescript" for more information. Go to the bookstore and buy some books that provide information on how to use Automator and AppleScript. Visit the library (Public, that is.)
  • KJK555 Level 4 (2,895 points)
    It's very easy.
    1. Open Automator.app
    2. It will open with a drop down menu.
    In the drop down menu select >custom > choose
    3. In the variables list choose "Run Shell Script", double click it,
    a command box will open.
    4. type in (the first line) defaults write com.apple.finder AppleShowAllFiles FALSE
    5. press return
    6. type in (the 2nd line) killall Finder
    should see this in the box:

    defaults write com.apple.finder AppleShowAllFiles FALSE
    killall Finder

    7. At the top left of your screen select > file > save as plugin
    8. A box will open > Save Plug-in as:
    9. Give it a name like "Show Hidden Files" (without the quotes).
    10. Make sure "Plug-in for: finder" (second line) is selected also. Click Save.

    You are almost done.
    Repeat the process substituting:

    defaults write com.apple.finder AppleShowAllFiles TRUE
    killall Finder

    In step 6 and

    "Hide Hidden Files"

    in step 9.

    Now both commands are placed on the finder context menu.
    You can Access them using Control + Click or setting up a secondary mouse button.

  • GFIVE Level 1 (0 points)
    Thank you so much 'KJ' for the step by step procedure. Just one thing I'd like to clear up...
    It looks like the TRUE and FALSE mentions are reversed in your tutorial. The first script should be saved "Hide Hidden Files", and the second "Show Hidden Files".

    Hide for fALSE & Show for TRUE.

  • Portlandian Level 1 (0 points)
    The other fella is correct about the true false mix up, I thought about that when I was entering the code, but decided to give it a shot anyway having no apple code experience myself(easy enough to fix.)
    Perfect walk through though! This was EXACTLY what I was looking for. Thank you!
  • bpbpbp Level 2 (205 points)
    Hi, Thanks for the geat information but when I opened Automator the following was showing in the Run Shell Script dialogue box....In the text box it has the word 'CAT' - I assume that this should be deleted before adding the text you recommend. Also, the Shell drop down box shows /bin/bash and the Pass Input drop down box shows 'stdin' - should either of these boxes be changed before saving the script?