Obsidian Tip of the Day: Three Templater Snippets for All Your Note Templates in #Obsidian

If you use the Templater community plugin (and you really should) you have three snippets available to you which provide a real asset in creating metadata in your note templates. These dynamic entries allow you to automatically add the creation date, modification date and note name to your new notes. Never again will you have to bear the indignity of a note that decides to call itself Untitled. To add these to your templates, edit them with source mode turned on instead of live preview which is the Obsidian default.

Note Name

This snippet gives you a pop-up when you first create your notes asking you to name it then. You type the name into the resulting dialog box and that’s that taken care of. (Note: This snippet goes at the very top of your note at Line 1. It creates the three tick marks that are the beginning of the code block for your properties.)

<%*  
  let title = tp.file.title  
  if (title.startsWith("Untitled")) {  
	title = await tp.system.prompt("Title");  
	await tp.file.rename(title);  
  }

  
  tR += "---"
%>

Creation Date

This snippet will provide you with the creation date of your new note instead of the creation date of the template itself which is sometimes a problem when using dates in templates. If you use a different date format, replace the format here within the quotation marks.

<% tp.date.now("YYYY-MM-DD") %>

Modification Date

This snippet will provide you with a properties field that will update itself whenever you edit a note. As above, if you use a different date format, replace the format here within the quotation marks.

<% tp.file.last_modified_date("YYYY-MM-DD") %>

See all my Obsidian Tips

Farm pond in winter

Got my first same day Amazon order delivered today. I guess the future has arrived in the form of some USB-C cables.

I posted a shortcut on Routine Hub for capturing entire web pages in #Obsidian, including image links and a link back to the source article. You can create a new note or append to an existing one. Routine Hub | Download Web Pages to Obsidian

From atop Wayah Bald on the #AppalachianTrail in North Carolina

Copy down verbatim quotes, when you feel like it… I’ve shifted away from the dogma that “real” engagement means you must always summarise or restate things in your own words. If copying was good enough for history’s countless keepers of commonplace books, it’s sometimes good enough for me.

The Imperfectionist

I love getting a new #iPhone but I also hate getting a new iPhone. At least I’m going through this in the comfort of my home and not an Apple Store 75 miles away, which is the unattractive alternative. But first, let’s update iOS before we restore your data. Just kill me now.

Tomales Bay, Marin County, California

Worked with Google Gemini today on a python script for an hour that never worked. Meanwhile an anonymous human being on the #Obsidian forum solved my problem with a five-line dataview query.

Central Park, New York, New York

There are exactly three potential outcomes for That Technology Thing You Like:

  1. It will be changed in ways that you don’t like by the person or company that owns or runs it.
  2. It will be sold to someone else and they will change it in ways that you don’t like.
  3. It will be discontinued. There are no other options. Prepare accordingly.

Pete Brown, Exploding Comma

The Outer Banks of #NorthCarolina

Automating Your #Obsidian Backup, Let Me Save You Some Hassle

The current sale underway at Bundlehunt offers over 40 Mac apps for under $5.00 apiece. There are some definite bargains but two I want to point out are Alarm Clock Pro and Lingon X. Both of these utilities offer a feature that comes in handy when setting up an automated backup solution for Obsidian. They can both launch applications according to a set schedule. If you are a Keyboard Maestro user, that can do it too, with the added benefit of also being able to close applications for you.

image1 image2

Sync Folders Pro

Keyboard Maestro launches an $8.99 app I got from from the Mac App Store to run an automated backup of my Obsidian vault every morning at 2:00AM. Sync Folders Pro It perfroms a one-way sync to a folder on my Google Drive, which in turn backs up the files to the cloud, giving me an offsite back up in case of theft or natural disaster. I’m planning to start using Dropbox instead of Google Drive because it offers file versioning. If you are a PC user, you can get Free File Sync which doesn’t offer a scheduler but is easy to set up and you just have to remember to run it manually on a regular schedule.

Screenshot of Sync Folders Pro

Obsidian Git

I also use the Obsidian Git community plugin. If you are a Mac user, save your self some hassle and install Git and Git Credential Manager via the terminal and Homebrew before setting up your backup. Failing to do so may result in annoying permissions errors when attempting to back up.

Install homebrew if you don’t already have it and then run the following command from terminal:

$ brew install git


To install Credential Manager use:
>```
brew install --cask git-credential-manager

Then use Github Desktop for Mac to create a private Git repository based on your Obsidian vault. You’ll need a free Git account to do this. Once you’ve got your repository set up and your initial upload done,install the plugin and you’ll have an automated real time back up of your files - with versioning. Danny Hatcher has a video to help you understand the procedure.

Time Machine

Sandisk Backup Drive

Of course, it’s a best practice to back uo your entire Mac regularly. Thankfully the bulit-in Mac backup utility, Time Machine makes it as easy as plugging in an external hard drive. I use a Sandisk 1TB portable SSD to back up my Macbook every night. See this Apple document for detailed instructions on Time Machine.

See all my Obsidian Tips