Get AI summaries of any video or article — Sign up free
Automatically catalog all recent files in Obsidian thumbnail

Automatically catalog all recent files in Obsidian

Productivity Guru·
4 min read

Based on Productivity Guru's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

Verify Ruby is installed by running `ruby -v` before attempting to execute the script.

Briefing

A lightweight Ruby script can automatically generate a “recent” catalog inside Obsidian by listing every file created or last updated within the past seven days—similar in spirit to Obsidian’s research-style daily-note timeline. The payoff is practical: instead of manually hunting through notes, users get a rolling index they can consult to see what changed recently, and they can optionally turn each entry into a clickable link that jumps straight to the relevant daily note.

Getting it running starts with two prerequisites: Ruby must be installed (verified by running `ruby -v` in a command prompt), and the script source must be downloaded from a GitHub repository as a ZIP file. After unzipping, the user opens `recent.rb` in a preferred editor and edits the `nodes_path` (named `nodes_path` in the transcript) to point to the Obsidian vault folder—specifically adding a Dropbox-based path ending with a trailing slash. That trailing slash matters; without it, the script won’t behave as expected.

Once configured, the script is executed from the folder containing `recent.rb` using `ruby recent.rb`. The output is a catalog file (shown as “recent file changed” in the transcript) that enumerates all notes whose timestamps fall within the last week, capturing both newly created files and files that were modified.

The script also supports customization of how results are presented. One improvement described is adding clickable headers that link to the daily note for each date. This is done by editing the line that formats the file name in the output (around line 24), inserting Obsidian-style wiki links using double square brackets around the date/file header. After saving the change and rerunning the script, the generated catalog entries become navigable—clicking them takes the user to the corresponding daily note.

Beyond the working baseline, the transcript shifts to two planned enhancements. First, the user wants to change the date format used in the catalog; attempts to modify the `strftime` option reportedly caused errors, suggesting the formatting logic is sensitive. Second—and more consequential—the user wants the script to append the list of recently changed files directly into the original daily notes file. The goal is to make the recent activity immediately visible in each day’s note, so it can be surfaced via Obsidian’s backlinks pane across related notes.

In short: the script provides an automated weekly “what changed” index for Obsidian, with an optional clickable-link interface to daily notes. The remaining work is tailoring date formatting and integrating the recent list into daily notes automatically for smoother cross-referencing through backlinks.

Cornell Notes

A Ruby script can automatically build a “recent” catalog for an Obsidian vault, listing every file created or last updated in the past 7 days. After confirming Ruby is installed (`ruby -v`), users download `recent.rb`, set `nodes_path` to the vault location (including a trailing slash), and run `ruby recent.rb` from the script’s folder. The catalog can be enhanced with clickable headers by adding Obsidian-style wiki links (`[[...]]`) around the date/file header, letting users jump to the corresponding daily note. Future customization goals include changing the date format (attempts via `strftime` caused errors) and appending the recent list into each day’s original daily note so backlinks can surface the activity.

What are the minimum steps needed to generate a weekly “recent files” catalog in Obsidian?

Install Ruby and verify it with `ruby -v`. Download the GitHub repository ZIP, unzip it, open `recent.rb`, and set `nodes_path` to the Obsidian vault folder path (the transcript emphasizes adding a trailing slash). Then run the script from its folder using `ruby recent.rb`, which outputs a list of files created or modified within the last week.

Why does the `nodes_path` setting require a trailing slash?

The transcript notes that omitting the trailing slash causes the script to fail “as expected.” The path is edited in the editor around the `nodes_path` line (shown as `nodes_path` in the transcript), and the user explicitly adds the slash at the end to ensure the script resolves the vault directory correctly.

How can the catalog entries be made clickable so they jump to daily notes?

Edit the output formatting near the line handling the header (around line 24 in the transcript). Insert Obsidian wiki-link syntax by adding `[[` before and `]]` after the `file_name`/header placeholder (the transcript describes adding two square brackets in front and behind). After saving and rerunning `ruby recent.rb`, the headers become clickable and navigate to the daily note for that date.

What customization attempts are mentioned, and what went wrong?

The user wants to change the date format and tried modifying the `strftime` option, but that produced errors. The transcript doesn’t provide the exact error, only that changing `strftime` caused failures, indicating the date formatting portion is not straightforward to adjust.

What is the desired “next feature” beyond a standalone catalog file?

Instead of generating a separate recent list, the user wants the script to append the recently changed file list directly into the original daily notes file. That would make the information immediately accessible and more useful via Obsidian’s backlinks pane across notes. If Ruby changes can’t achieve this, the user considers writing a Python alternative.

Review Questions

  1. What two conditions must be satisfied before running `recent.rb`, and how do you verify them?
  2. How do you modify the script so that date headers become clickable links to daily notes?
  3. What two future enhancements are proposed, and which one is currently blocked by errors?

Key Points

  1. 1

    Verify Ruby is installed by running `ruby -v` before attempting to execute the script.

  2. 2

    Download and unzip `recent.rb` from the referenced GitHub repository, then edit it in a text editor.

  3. 3

    Set `nodes_path` to the Obsidian vault directory and include a trailing slash; missing it breaks expected behavior.

  4. 4

    Run the script with `ruby recent.rb` from the folder containing the file to generate the weekly recent-files catalog.

  5. 5

    Add clickable headers by wrapping the header placeholder with Obsidian wiki-link syntax `[[...]]` in the formatting line.

  6. 6

    Planned improvements include changing the date format (currently error-prone when editing `strftime`) and appending recent entries into daily notes for backlink-friendly navigation.

Highlights

A single command—`ruby recent.rb`—produces a rolling list of notes created or updated in the last 7 days.
Clickable daily-note navigation is enabled by adding wiki-link brackets (`[[` and `]]`) around the date/file header placeholder.
The script’s path configuration is sensitive: the vault path must end with a trailing slash.
Date-format customization via `strftime` is mentioned as a stumbling point due to errors.
The most valuable next step would be appending recent entries into each daily note so backlinks can surface the activity automatically.

Topics

  • Obsidian automation
  • Ruby scripting
  • Recent files index
  • Daily note linking
  • Backlinks integration