Creating a Finder Smart Folder of your RStudio Project files to enable super fast project launching

Screenshot of macOS Finder window showing the saved Smart Folder of RStudio project files.

Introduction

When I’m switching projects I naturally start with Finder. I’m sure if I became a Terminal warrior there are faster ways of searching for files (e.g. the Television fuzzy finder TUI). And I know there are other ways to avoid using Finder, e.g., using Spotlight, Alfred, or Raycast; and indeed I do have this fantastic tip that allows Alfred to find RStudio project files setup. But something to do with how I learnt to use a computer just naturally means I’m wedded to Finder, but navigating through my mess of nested directories wastes time and energy.

I realised that Finder on macOS has a helpful feature called Smart Folders. We can use this to setup a saved search of RStudio Project .Rproj files (and/or VSCode/Positron .code-workspace files) to allow us to see all the .Rproj files on our computer. This makes finding and opening projects from within Finder fast and convenient.

Setting up a Smart Folder of your RStudio project files

In Finder;

  • navigate to the folder you want your search to start in, either your home folder or your Documents folder are obvious candidates
  • click File | New Smart Folder
Screenshot of creating a new Smart Folder in macOS Finder.
  • near the top right corner click the plus button next to the Save button.
Screenshot of creating a new condition as part for a new Smart Folder in macOS Finder.
  • we need to add the File extension attribute to the choices, click Name near the top left, then Other…
Screenshot of adding a new attribute as part for a new Smart Folder in macOS Finder.
  • Then search for File extension and check the box on the right handside
Screenshot of adding the file extension attribute as part for a new Smart Folder in macOS Finder.
  • enter Rproj in the box (it doesn’t seem to matter if you include the . first)
Screenshot of adding the file extension condition as part for a new Smart Folder in macOS Finder.
  • click Save (near top right corner) and give it a sensible name, e.g., Rproj.savedSearch
Screenshot of saving the new Smart Folder in macOS Finder.

And you’ll see the new virtual folder appear on the left Finder sidebar - see the screenshot at the top of this post.

You can create additional Smart Folders for other useful file extensions, for example, VSCode/Positron project files (.code-workspace files).

On Windows, I don’t believe that there is an exact equivalent of a Smart Folder. I think that the closest you can get is to save a search in File Explorer. However, I find that in recent years File Explorer on Windows 11 has become incredibly slow and regularly crashes. Searching in Files or File Pilot is now much faster and more reliable.

Summary

I have shown how to create a Smart Folder of your RStudio Project files for fast and convenient project launching on macOS.

Tom Palmer
Tom Palmer
Senior Lecturer in Biostatistics applied to Genetics

My research interests include statistical methods for epidemiology.

Related