From 25f5029ad3ffb93e7e4634b96c538262bd2e4c58 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Thu, 23 Jul 2026 15:04:31 -0500 Subject: [PATCH] Add Set Default Search Directory For Finder as a Mac TIL --- README.md | 3 +- ...set-default-search-directory-for-finder.md | 41 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 mac/set-default-search-directory-for-finder.md diff --git a/README.md b/README.md index 998a19b..aba2401 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/mac/set-default-search-directory-for-finder.md b/mac/set-default-search-directory-for-finder.md new file mode 100644 index 0000000..dd73add --- /dev/null +++ b/mac/set-default-search-directory-for-finder.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_.