Add Set Default Search Directory For Finder as a Mac TIL

This commit is contained in:
jbranchaud
2026-07-23 15:04:31 -05:00
parent 7128f99da2
commit 25f5029ad3
2 changed files with 43 additions and 1 deletions
+2 -1
View File
@@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/).
For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter).
_1832 TILs and counting..._
_1833 TILs and counting..._
See some of the other learning resources I work on:
@@ -769,6 +769,7 @@ If you've learned something here, support my efforts writing daily TILs by
- [Run A Hardware Check](mac/run-a-hardware-check.md)
- [Run AppleScript Commands Inline In The Terminal](mac/run-applescript-commands-inline-in-the-terminal.md)
- [Set A Window To Its Default Zoom Level](mac/set-a-window-to-its-default-zoom-level.md)
- [Set Default Search Directory For Finder](mac/set-default-search-directory-for-finder.md)
- [Specify App When Opening From Command Line](mac/specify-app-when-opening-from-command-line.md)
- [Start Amphetamine Session With AppleScript](mac/start-amphetamine-session-with-applescript.md)
- [Uninstall LogiTech G Hub From Mac](mac/uninstall-logitech-g-hub-from-mac.md)
@@ -0,0 +1,41 @@
# Set Default Search Directory For Finder
In MacOS's Finder.app, when I click the Search (magnifying glass) icon and type
something in, it performs the search across all of "This Mac". This has always
really bugged me because I'm usually already in the directory that I want to be
specifically searching in.
A small quality-of-life improvement for me was to update the setting that
controls this to search in the current directory instead.
This can be done via the Finder.app menu at the bottom of the _Advanced_ section
in the _Settings_. The three setting options are:
- Search This Mac
- Search the Current Folder
- Search the Previous Search Scope
This can also be controlled from the command line using the `defaults write`
command. The specific setting is called `FXDefaultSearchScope` and the above
three settings translate to:
- `SCev` (Search This Mac)
- `SCcf` (Search the Current Folder)
- `SCsp` (Search the Previous Search Scope)
I can see the current default setting with `defaults read`:
```bash
defaults read com.apple.finder FXDefaultSearchScope
SCev
```
I can then change it to the _Search the Current Folder_ option like so:
```bash
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
```
All the open Finder windows still hold the original setting. I need to do a
`killall Finder` to effectively reload them. Now if I try doing a search, it
should default to the current directory instead of _This Mac_.