EDIT:
2020-11-15 - Added 2 options for the solution
Problem:
Obsidian daily notes are great. I can drop anything in a daily note without worrying about the structure too much and then link from or to other resources when needed. I keep my daily notes in Daily Notes folder in my vault and the files are named in this format “yyyy-MM-dd”.
The problem I had, when I had a quick idea or learned something new, it took way too many steps to open Obsidian on my laptop, open the daily note and write. I needed something that works from my iPhone, but there is no mobile app for Obsidian.
Solution:
I want to share a super convenient shortcut to add quick note to Obsidian daily notes from your iOS (sorry Android users, maybe something similar exists).
Whenever I have an idea or learn something, I tap on a shortcut icon on my iPhone home-screen, type the note and send it.
Here is how it works:
https://video.twimg.com/ext_tw_video/1327616936507797504/pu/pl/ytghUsCm02v7N-uk.m3u8?tag=10&descending=true
And this is how every single note you add will nicely append to today’s file:
How to make it?
Option 1:
If you want to store notes in a custom folder on your Mac through iCloud. See Option 2 if you are okay using Dropbox.
To build this solution I’ve used Shortcuts and Scriptable apps on iOS. The scriptable app is needed to access local files on iCloud. Using only Shortcuts app you can only save to iCloud/Shortcuts folder. And that’s not where my Obsidian vault is.
Link to the Shortcut:
Scriptable Javascript code:
// A new file manager on iCloud
var fm = FileManager.iCloud()
// Get the file content from Shortcuts
var newContent = args.shortcutParameter
// Get the filename type parameter from Shortcuts
// This is just yyyy-MM-dd.md by default, can be changed in the Shortcuts app
var filename = args.plainTexts[0] + ".md"
// "Daily Notes" is the name of the folder bookmark you created in Scriptable > Settings > File Bookmarks
var path = fm.joinPath(fm.bookmarkedPath("Daily Notes"), filename)
// Check if the file already exists
if (fm.fileExists(path)) {
// Get file contents
var oldContent = fm.readString(path)
// Append new content to the old content in the file
var content = oldContent + "\n" + newContent
} else {
// If the file does not exist, the content is the new content
var content = newContent
}
// Write the file content to iCloud
fm.writeString(path, content)
// Tell Shortcuts that we're done (not strictly necessary)
Script.complete()
Bonus: the way I build the Shortcut, you can also select any text on Web, tap Share button and then tap your Shortcut. This will pre-fill the selected text as a content for a quick note.
Option 2
If you prefer to store notes on Dropbox or “iCloud/Shortcuts” path. But you won’t be able to store notes in a custom folder on your Mac.
In this case you don’t even need the Scriptable app. You only need to use iOS Shortcuts app and use “Append to File” component and select “Dropbox” as a service.
(Source: https://twitter.com/geetstechhabits/status/1325587596869734400?s=21)
Let me know if you found this useful and if you know ways to make it even better!