# Obsidian Quick Capture Shortcut
> [!info] This post uses the Apple ecosystem as an example, but it will work the same on Linux/Android/Windows. You just need to find the equivalent workflow apps.
## Intro
Do you feel like you sometimes need to write down something quickly, but it takes a while to open the app and create a new note?
In the past, I used Google Keep, Apple Notes, and OneNote, but nothing was perfect. When I consolidated my personal wiki from DokuWiki to Obsidian, I decided to figure out how to handle this workflow.
After multiple iterations, I converged on this workflow.
## The Workflow
The ultimate goal of this workflow is to be as frictionless as possible.
There is a folder named `Scratch Files 🚧` at the root of the vault. Its goal is to be the place for quickly captured notes.
The naming convention of files that are generated in the Scratch Notes folder is `Scratch File YYYY-MM-DD.md`. These files are generated automatically, but only on demand.
There are 3 ways to trigger this workflow:
1. QuickAdd command (from within the Obsidian app)
2. Apple Shortcuts (via URI[^1] scheme)
3. Lock Screen[^2] (executes Apple Shortcut)
All quick captures for the day should end up in the same daily `Scratch Note YYYY-MM-DD.md` file. But they shouldn't stay there indefinitely. It should be something like the working/staging area in [[DevOps 🐧/Git|Git]]. The Scratch Notes folder should be regularly cleaned up and eventually be empty. The useful parts of the captures can be moved to other permanent notes, and the rest discarded.
## The Workflow on Apple devices
### iOS, iPadOS
On iOS or iPadOS, I use [Shortcut widget](https://support.apple.com/guide/shortcuts/run-shortcuts-from-the-home-screen-widget-apd029b36d05/ios) on default screen for quick access.
![[IMG_2517.jpeg|iOS Shortcuts widget with the workflow|200x200]]
#### Create the Scratch File
![[shortcut-widget-new-scratch-file-obsidian.mov|300]]
#### Open the Scratch File
![[shortcut-widget-open-scratch-file-obsidian.mov]]
#### Create/Open the Scratch File from lock screen
![[ScreenRecording_09-19-2024 06-35-36_1.mov]]
### macOS
It should be able to run the Apple Shortcut with a keyboard combination, but the Apple implementation is quite buggy. It can also be run from the menu bar:
![[Pasted image 20240908074937.png|macOS Shortcut in a menu bar]]
Most often, I trigger it by running the QuickAdd command from within the Obsidian window.
## Setup
Unfortunately, the core Obsidian plugin Template doesn't have all the functionality that is needed for this workflow, so we need to install the [QuickAdd plugin](https://obsidian.md/plugins?id=quickadd).
![[obsidian-quickadd-scratch-file-settings.png|QuickAdd settings|300]]
### Create Scratch File URI
Below is the full Obsidian URI[^3] scheme for the *new* Scratch File (it's just for showcase; it's not valid syntax because it contains invalid characters for URI – spaces, newlines, unicode emoji…).
```text
obsidian://new?vault=Obsidian&file=Scratch Files 🚧/Scratch File YYYY-MM-DD&content=---
tags: [scratch-files]
---
# Scratch File YYYY-MM-DD
```
> [!info]
> The URI parameters explained:
> - `vault=…` (Vault name)
> - `file=…` (File path, parent folders have to already exist)
> - `content=…` (The content of newly created file)
To get valid URI we need to encode all query values (&key=**value**). So after [encoding](https://www.urlencoder.org/) it should look like this:
```text
obsidian://new?vault=Obsidian&file=Scratch%20Files%20%F0%9F%9A%A7/Scratch%20File%20YYYY-MM-DD&content=---%0Atags%3A%0A%20%20-%20scratch-files%0A---%0A%23%20Scratch%20File%20YYYY-MM-DD
```
### Open Scratch File URI
The same procedure applies to the URI scheme to *open* a Scratch File:
```text
obsidian://open?vault=Obsidian&file=Scratch Files 🚧/Scratch File YYYY-MM-DD
```
After encoding:
```text
obsidian://open?vault=Obsidian&file=Scratch%20Files%20%F0%9F%9A%A7/Scratch%20File%20YYYY-MM-DD
```
### Shortcuts workflow
https://www.icloud.com/shortcuts/c38e9f8aec9e4f549f64e782ab277bce
### Executing from the script
Both of the URIs can be opened from the command line/script:
```shell
open "obsidian://new?vault=Obsidian&file=Scratch%20Files%20%F0%9F%9A%A7/Scratch%20File%20YYYY-MM-DD&content=---%0Atags%3A%0A%20%20-%20scratch-files%0A---%0A%23%20Scratch%20File%20YYYY-MM-DD"
```
```shell
open "obsidian://open?vault=Obsidian&file=Scratch%20Files%20%F0%9F%9A%A7/Scratch%20File%202024-09-08"
```
> [!info] On Linux, you should use `xdg-open`. On Windows, use `start`.
## Conclusion
I am very satisfied with it. One more plugin I advise using to improve loading time (especially on mobile) is the [Lazy Plugin Loader](https://obsidian.md/plugins?id=lazy-plugins).
Obsidian has some quick capture feature in [the roadmap](https://obsidian.md/roadmap/), but nothing in the time of writing this. Hopefully, it will be even quicker than this method.
[^1]: URL specifies the location of a resource on the internet, while URI can be used to identify any type of resource. Like in this case operating systems can locate the application registered for `obsidian://` scheme and open it.
[^2]: iOS/iPadOS 18 required
[^3]: Complete obsidian URI documentation: https://help.obsidian.md/Extending+Obsidian/Obsidian+URI