9

There are several ways how to toggle hidden files - via a shell command, or AppleScript, or Automator action, or even a Dashboard widget. All of them close and reopen Finder windows, which is quite annoying.

On the other hand, for the Open File dialog one can easily toggle hidden files by pressing Command+Shift+Period.

Is it possible to avoid relaunching Finder?


Conclusion

It is better to use Path Finder instead, which allows not only to toggle hidden files without a perversion, but many other nice things. Really awesome app.

3
  • 2
    The "theoretical" part of the question kind of made this argumentative (and hence subject to be closed), unless some Apple engineer happens to be reading this. I like the rest of the question though, so I removed those words. I guess the answer is currently "no", as probably Finder reads this setting when it's started. But that's an argumentative answer, so let's hope for an answer that says "yes, ..."
    – Arjan
    May 8, 2010 at 16:01
  • 1
    Too bad. Accepting the "no" also ensures the Community user will never poke this question, to bump it onto the front page every now and then...
    – Arjan
    May 9, 2010 at 15:11
  • Ok, good point. Let's leave some hope
    – Andy
    May 9, 2010 at 15:27

3 Answers 3

3

There is a solution now.

The latest release of TotalFinder (0.9.1) can toggle show/hide hidden files without Finder restart. Tested it, it works well, and removes this long-lived annoyance of the Finder. TotalFinder is free for now as it is prerelease software, but will be around $10 or $15 when it hits final.

1

No, you cannot, because there is no way to notify the Finder (or any process for that matter) that its preferences file has been modified behind its back.

3
  • That assumes the only way to make Finder show hidden files is by hacking its preferences. (Which probably is true indeed.)
    – Arjan
    May 9, 2010 at 15:09
  • There's no need for assumption when the facts are right there. May 9, 2010 at 19:14
  • 1
    Then point us to those facts, please...
    – Arjan
    May 9, 2010 at 21:06
0

I found a similar question here: Apple Script - Reopen Closed Finder Windows

The posted script by adayzdone may be what your looking for. It still has to relaunch Finder but when it relaunches, it returns the the same windows in the same directory you were in when they closed.

tell application "Finder"
   set windowTargets to target of Finder windows
    quit
end tell

set OnOff to do shell script "defaults read com.apple.finder AppleShowAllFiles"
    if OnOff = "NO" or OnOff = "OFF" then
        set OnOffCommand to "defaults write com.apple.finder AppleShowAllFiles ON"
    else
        set OnOffCommand to "defaults write com.apple.finder AppleShowAllFiles OFF"
    end if
    do shell script OnOffCommand
    delay 1

tell application "Finder" to launch
    tell application "Finder"
    repeat with aTarget in windowTargets
        make new Finder window at aTarget
    end repeat
end tell

copied from referenced question

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .