Fix Hidden Files Shortcut

Adrachin:

I want to fix an issue. The option:

Click the Finder icon in your dock to open Finder.
Navigate to the folder where you want to find hidden files.
Press Command + Shift + . (the period key). This will show hidden files in the folder.
To hide the files again, press Command + Shift + . again.

Does not function any more. Any idea where to start fixing this?

LiquidGPT:

If the Command + Shift + . shortcut to toggle hidden files in Finder is not working on your Mac, here are a few steps you can try to resolve the issue:

  1. Check Keyboard Settings:

    • Ensure that your keyboard is functioning correctly and that the keys themselves aren’t physically damaged or stuck.
    • Verify that the keyboard layout hasn’t been changed accidentally. You can check this in System PreferencesKeyboardInput Sources.
  2. Restart Finder:

    • Sometimes, restarting the Finder can resolve minor glitches. You can do this by right-clicking on the Finder icon in the dock, holding the Option key, and selecting Relaunch.
  3. Safe Mode:

    • Boot your Mac into Safe Mode (hold Shift during startup) to check if the issue persists. This mode loads only essential system processes. If the shortcut works in Safe Mode, it might indicate a conflict with another app or service.
  4. Check for Software Conflicts:

    • Consider if you’ve recently installed new software that could be interfering with keyboard shortcuts. Sometimes, applications can override or conflict with global keyboard shortcuts.
  5. Reset NVRAM:

    • Resetting the NVRAM (non-volatile random-access memory) can solve issues related to settings stored in memory. To reset NVRAM, shut down your Mac, then turn it on and immediately press and hold Option + Command + P + R for about 20 seconds.
  6. Update macOS:

    • Ensure your macOS is up to date, as updates can fix bugs and improve system stability. Check for updates in System PreferencesSoftware Update.

Try these steps one by one to see if they help in restoring the functionality of the hidden files shortcut. Would you like more detailed guidance on any of these steps?

Adrachin:

I want to check the function in terminal.

LiquidGPT:

To check if the function to toggle hidden files is working from the Terminal, you can try a different approach using terminal commands. This can also help you understand if the issue is specifically with the Finder shortcut or a broader system issue. Here’s how you can do it:

  1. Open Terminal:

    • Open the Terminal application from your Applications folder, specifically within Utilities, or use Spotlight search (Command + Space) to search for “Terminal.”
  2. Check Current Settings:

    • First, check the current setting for hidden files. Type the following command and press Enter:
      defaults read com.apple.finder AppleShowAllFiles

      If the setting is enabled, it should return TRUE or 1. If it’s disabled, it should return FALSE or 0.

  3. Toggle Hidden Files:

    • To manually toggle the visibility of hidden files, use the following command:
      defaults write com.apple.finder AppleShowAllFiles -bool true

      This command sets the visibility of hidden files to true, meaning it should show hidden files.

    • After running the command, you need to restart Finder for the changes to take effect. You can do this by typing:
      killall Finder
    • To hide the files again, repeat the command with false instead of true:
      defaults write com.apple.finder AppleShowAllFiles -bool false

      And then restart Finder again with killall Finder.

These steps will help you manually toggle hidden files from the Terminal and check if the functionality is still intact. If this method works, but the shortcut does not, it likely indicates an issue with the shortcut keys or a system preference not behaving as expected. If you need more detailed information or further assistance, please let me know!

Adrachin:

2024-04-28 08:47:48.272 defaults[4346:133628]
The domain/default pair of (com.apple.finder, AppleShowAllFiles) does not exist

LiquidGPT:

The error message you’re seeing, “The domain/default pair of (com.apple.finder, AppleShowAllFiles) does not exist,” indicates that the setting to show hidden files (AppleShowAllFiles) is not currently set in the Finder preferences. This is common if the setting has never been toggled before through Terminal or if a system update or change has reset this particular preference.

Here’s how you can address this:

  1. Set the Preference Manually:

    • You can manually set this preference by specifying either true or false in the Terminal command. This will create the preference if it doesn’t already exist:
      defaults write com.apple.finder AppleShowAllFiles -bool true
    • After entering this command, restart Finder to apply the change:
      killall Finder
    • This should now make the hidden files visible in Finder. To reverse it (hide the files again), you can switch true to false in the command:
      defaults write com.apple.finder AppleShowAllFiles -bool false
    • And again, restart Finder:
      killall Finder
  2. Verify the Change:

    • To check if the setting has been successfully written, you can read it back:
      defaults read com.apple.finder AppleShowAllFiles
    • This command should now return 1 or TRUE if hidden files are set to be visible, and 0 or FALSE if not.
  3. Try the Shortcut Again:

    • Once you’ve manually set this preference, try using the Command + Shift + . shortcut again to see if it toggles the visibility as expected.

This approach should ensure the setting is active in your system preferences, and it can help verify whether the issue is resolved. If the shortcut still doesn’t work after setting this preference, it might indicate a more specific issue with the keyboard shortcuts or system configuration. Let me know if you need further assistance or details!

Adrachin:

defaults write com.apple.finder AppleShowAllFiles -bool false

➜ ~ killall Finder

➜ ~ defaults read com.apple.finder AppleShowAllFiles

0

LiquidGPT:

Great, it looks like the defaults write and killall Finder commands are working properly, and the setting AppleShowAllFiles is correctly reporting its status with defaults read. Now that you’ve confirmed the setting is correctly being manipulated and acknowledged by the system, you can test the shortcut again in Finder.

Here’s what to do next:

  1. Test the Shortcut:

    • Open a Finder window.
    • Press Command + Shift + . (the period key) to see if it toggles the visibility of hidden files.
    • Since you have just set AppleShowAllFiles to false, initially, no hidden files should be visible.
    • Pressing the shortcut should make hidden files appear, and pressing it again should hide them.
  2. Confirm Functionality:

    • If pressing Command + Shift + . successfully toggles the visibility of hidden files, then the shortcut is working correctly.
    • If the shortcut still does not work, this might indicate an issue with the keyboard (like a faulty key), a conflict with another shortcut, or an issue with macOS settings.
  3. Check Keyboard Shortcuts and System Preferences:

    • Go to System PreferencesKeyboardShortcuts and browse through the list to ensure that no other assigned shortcuts conflict with Command + Shift + .
    • Additionally, check if there are any accessibility settings or third-party applications that might be intercepting or disabling this shortcut.

If after these steps the shortcut still isn’t working, considering your system and settings seem otherwise correct, there may be deeper system issues or conflicts at play. In such a case, you might consider reaching out to Apple Support or seeking the assistance of a professional technician to look into the issue.

If you need further assistance or another test, feel free to let me know!