Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Is there a key combination I can use to show/hide hidden items in Finder?

share|improve this question
1  
No - it's not a thing Finder wants to do at run time. There are plenty of ways to automate changing the hidden preference and killing finder - launchd will make a new finder which will read the changed settings - but it's more like substituting in a new player in a sports match. –  bmike Jul 25 '11 at 19:44

3 Answers 3

I don't think you can do this by default.

I myself use Hidden Files widget. it's so easy to use.

alt text

share|improve this answer

You can do it with two small shell scripts:

This will reveal the "invisible" files:

#!/bin/sh
# make invisible files visible
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

This will hide the "invisible" files made visible:

#!/bin/sh
# make visible files invisible
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

Save each into an appropriately named file, set their executable bits using chmod, then you can run them to set or unset the visibility.

Alternately, you could use the following code, and toggle back and forth by executing the code repeatedly:

#!/bin/sh

showFiles=`defaults read com.apple.finder AppleShowAllFiles`
if [ "$showFiles" = 1 ]
 then defaults write com.apple.finder AppleShowAllFiles -bool FALSE
 else defaults write com.apple.finder AppleShowAllFiles -bool TRUE
fi

killall Finder
share|improve this answer

I have an AppleScript I use to toggle things like these off and on:

http://www.markdouma.com/developer/ToggleInvisibleFiles.zip

The code:

property showAllFiles : missing value -- missing value is AppleScript equivalent of nil or NULL

try
    set showAllFiles to (do shell script "/usr/bin/defaults read -g AppleShowAllFiles")
on error
    set showAllFiles to "0"
end try

tell application "Finder" to quit

if showAllFiles = "0" then
    do shell script "/usr/bin/defaults write -g AppleShowAllFiles 1"
    say "AppleShowAllFiles 1"
    --say "Now showing invisible files"
else if (showAllFiles = "1") then
    do shell script "/usr/bin/defaults write -g AppleShowAllFiles 0"
    say "AppleShowAllFiles 0"
    --say "Now hiding invisible files"
end if

tell application "Finder" to activate

(Note, you can open up the downloaded AppleScript by dragging it to the icon of AppleScript Editor.app).

I generally prefer to tell applications to quit rather than kill them (though, with the sudden termination feature introduced in 10.6, that can sometimes be the same thing).

Oh, mine differs from Greg's in that I set it for the global preference domain (so that it affects all apps, including the Open and Save dialogs). (Though you can always toggle invisible files off or on in Open or Save panels using Command-Shift-period ).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.