Enhancing Your Obsidian Experience: Mobile Capture Techniques
Written on
Chapter 1: Introduction to Mobile Note Capture
In my previous post, I explored the iOS shortcuts I currently utilize to capture information into my Obsidian vault effectively.
Today, I will introduce an additional shortcut: Changing Daily Note fields.
My Daily Note Structure
Below is a glimpse of my Daily Note setup:
I aimed to simplify the process of modifying specific fields without needing to access Obsidian directly on my mobile device.
To begin, installing the Actions for Obsidian app is essential. This application introduces valuable shortcut actions for use with Obsidian.
This app effectively integrates the personal knowledge management tool Obsidian with Apple's automation capabilities.
Code Walkthrough
Now, let’s examine the code:
Initially, I check whether the Daily Note exists. If it doesn’t, I create one. Notably, leaving the Note body field empty in the Create Daily Note action will utilize the template set in your daily notes plugin, which, in my instance, is Periodic Notes.
Following that, I present a menu for selecting which field to update.
For the location, I provide another menu to select from predefined options:
I then prepend "Location::" to the chosen value and store it in a variable named Location. This step is repeated for all location options.
Next, I employ an action to search the current daily note using the regex "Location:: (.*)", which captures "Location::" followed by any text, and replaces it with the value in the Location variable.
For other fields, I prompt the user for input, prepend the field name, and store it in a variable. Finally, the action searches the current daily note for the regex "field_name:: (.*)" and substitutes it with the relevant variable's content.
After executing this for each menu option, I open the daily note with the following action: