Skip to content
Actions for Obsidian icon Home Actions for Obsidian 2024.2.3 › Actions

Actions for Obsidian › Actions › Get New File Folder Path

Returns the file system path to the folder for new notes in a given vault, as configured in Obsidian' Settings under Files & LinksDefault location for new notes.

This is a macOS-only action.

Parameters

Vault

The vault to work in.

Type: Vault reference

Omit home folder prefix

By default, the result of the action is the absolute file path starting from your Home folder. If you need the full absolute file path, i.e. starting from the root of the volume, uncheck this box. Example:

  • checked: /Documents/Obsidian Vaults/Workbench
  • unchecked: /Users/YourUserName/Documents/Obsidian Vaults/Workbench

Type: Boolean (YES/NO)

Return Value

Text

Examples

I want to copy a file to the folder in my Obsidian vault I've set as the default folder for new notes (the folder is named "Inbox"), so I'd use this action to get the its file system path. I keep the "Omit home folder prefix" toggle enabled, because for this example only the absolute path from my macOS Home folder is needed.

Next, I specify or select a file. This file could be anything, but for the sake of this example, I use a fixed file on my desktop, named Borger.md.

Finally, I use Shortcuts's built-in "Save File" action, passing the aforementioned file as the first argument (the source) and my Home folder as destination (by clicking the parameter and selecting it in the file dialog). I'll disable the "Ask Where To Save" option which allows me to enter a subpath — and here I use the output of the "Get 'New File' Folder Path" action.

Screenshot of the workflow

When run, the "Save File" action will use the file name of the passed-in file, and save it under the following path: {Home folder}/{Vault attachment folder path}/{file name}. In this example, this means:

  • Home folder: /Users/czottmann
  • "New File" Folder Path: /Documents/Obsidian Vaults/Testbed/Inbox
  • File name: Borger.md

… so the file is saved in /Users/czottmann/Documents/Obsidian Vaults/Testbed/Inbox/Borger.md, i.e. in the "New File" folder of my vault "Testbed".