Your Alfred settings generally look okay, but here are some things to check and adjust:
1. Rebuild macOS Spotlight Index
Since Alfred relies on macOS Spotlight for file indexing, the first thing to do is rebuild the Spotlight index. Open Terminal and run:
sudo mdutil -E /
This will erase and rebuild the Spotlight index, which Alfred uses for searching files. It can take a while to complete.After rebuilding, test searching in Spotlight (Cmd + Space) first. If Spotlight finds files, Alfred should be able to as well.
2. Check Alfred’s Search Scope
Go to Alfred Preferences → Features → Default Results and make sure:
• ✅ Folders and Documents are enabled under “Extras”.
• Check that Search Scope includes the directories where your files are stored.
• Try removing unnecessary folders that could be slowing things down.
3. Check File Visibility
Some files might not be indexed by Spotlight. Run this in Terminal:
mdfind -name "filename"
If it returns no results, that means Spotlight isn’t indexing the file. If that’s the case, check whether the file is inside a folder excluded from indexing.You can also reset Spotlight indexing on a specific folder by running:
sudo mdutil -i on /Users/your-username/Documents
4. Enable “Quick File Search Mode”From your File Search settings, you already have Quick File Search Mode enabled, which is good. Try searching using:
• open filename → Opens the file.
• find filename → Reveals the file in Finder.
This forces Alfred to specifically look for files instead of web searches.
Adding Your Python Script as an Alfred Workflow
Yes! You can create an Alfred workflow to execute your Python script.
Steps to Add a Python Script to Alfred
1. Go to Alfred Preferences → Workflows.
2. Click the ”+” (bottom left) and select “Blank Workflow”.
3. Name it something like "Run My Python Script".
4. Click the ”+” in the workflow editor and choose:
• Triggers → Hotkey (assign a shortcut like ⌘ + ⇧ + P)
• Actions → Run Script
5. Set Script Language to /usr/bin/python3 and add your script path:
/usr/bin/python3 /path/to/your/script.py
6. Click Save and try running it with your assigned shortcut.If your script requires Python packages that aren’t available system-wide, you might need to run it within a virtual environment.
Does Spotlight/Alfred Search External Drives?
By default:
• Spotlight can index external drives, but only if indexing is enabled for that drive.
• Alfred relies on Spotlight’s index, so if Spotlight isn’t working on external drives, Alfred won’t find anything either.
Check If Spotlight Is Indexing Your External Drive
To check if Spotlight is indexing an external drive, open Terminal and run:
mdutil -s /Volumes/YourDriveName
If it says “Indexing Disabled”, that means Spotlight is not searching that drive.To enable indexing on an external drive, run:
sudo mdutil -i on /Volumes/YourDriveName
If it was disabled and you turned it on, let the drive index for a while before testing.Make Sure Your External Drive Isn’t in Spotlight’s Privacy List
1. Open System Settings → Siri & Spotlight (or System Preferences → Spotlight on older macOS versions).
2. Click Spotlight Privacy.
3. If your external drive is listed there, remove it by clicking “-”.
Force Spotlight to Reindex the External Drive
If the drive still isn’t searchable, force Spotlight to reindex it:
sudo mdutil -E /Volumes/YourDriveName
This will erase and rebuild the index for that drive.How to Search External Drives with Alfred
1. Check Alfred’s Search Scope
In Alfred Preferences → Features → Default Results, make sure:
• ✅ “Folders in Home” is enabled.
• ✅ Add /Volumes/YourDriveName to the search scope.
2. Use “Find” Instead of Default Search
If Alfred’s normal search isn’t working, try forcing file search with:
find filename
This explicitly tells Alfred to search for a file.What If Spotlight Still Doesn’t Work?
Since Alfred depends on Spotlight, if Spotlight search is broken:
1. Run This to Fully Reset Spotlight Indexing:
sudo mdutil -a -i off
sudo mdutil -a -E
sudo mdutil -a -i on
This turns indexing off, erases all indexes, and then turns it back on.2. Wait for Reindexing to Complete
It might take a few hours for Spotlight to rebuild the index, especially if you have large drives.
Alternative: Search External Drives Without Spotlight
If Spotlight still doesn’t work, use Terminal:
find /Volumes/YourDriveName -name "filename"
This will search for a file directly on the external drive, bypassing Spotlight.Final Thoughts
• Alfred doesn’t search external drives unless Spotlight is indexing them.
• If Spotlight isn’t working, fix it first before expecting Alfred to work.
• Running sudo mdutil -E / and re-enabling indexing usually fixes it.
• If your external drive is not indexed, manually turn it on using sudo mdutil -i on /Volumes/YourDriveName.