What Tools Have You Built?

I’m curious what outside scripts, tools and other creative endeavors you’ve all created to further your usage and enjoyment of Obsidian, or Markdown in general.

Earlier this year I wrote a wrapper for pandoc to automate replicating large directory structures of Markdown to HTML, and recently I’ve added the ability to schedule the publishing and unpublishing of time-sensitive documents by way of YAML data. I’ve tinkered with publishing changing daily photos, RSS feeds with items that expire automatically, documents created by email, publishing via iOS shortcuts and Siri, and of course my own personal log and projects.

I’ll admit, I don’t take many notes, but I love Markdown.

What have you done?

1 Like
  • I have written (amongst others) a Python script which runs through all the Markdown notes in a Vault listing the TOP-10 (you can choose) words used in that note.
    At the end of the report a TOP-150 list is given for all the documents together./
    That’s a great start when you want to start some thinking starting from all the knowledge you gathered in a vault.
    I want to extend this with Natural Language Lexical Analysis later but for that I need to study the docs of the NLTK-module more.
  • Furthermore I script all th - [ ] occurence to make a general todo list
  • I also made a Python script to scan a GMail address and convert the Inbox of that address to separate MarkDown files. Mostly the start of some new notes which I than flesh out in my own language. I use the share-option on my iPhone in Feedly, Instagram, Podcast App,… whatever to directly post to my “Obsidian Inbox”.
2 Likes

I’ve written a couple useful Python and Bash scripts to improve my life:

  • One I just showed here
  • I keep my notes in an encrypted volume using VeraCrypt and keep the password in 1Password - so I’ve got a simple script to get the password, mount the volume and open Obsidian.
  • Another useful script just does a bunch of backing up, logging the growth of notes, pushing to GitHub, etc.
  • What I use the most is a simple Python script to create a range of different templates with frontmatter and the filenames all set up for me. Here’s an example of it:

Lots ;-).

Preface: I am big on templates, so have built a large repertoire of template text files with special keywords to denote what needs to be filled in and where the data goes. I then use iOS shortcuts (for mobile) and python scripts (Win/Mac) to load these templates and ask questions on what content to fill in (many of what are automated).
Nomenclature: I call my zettels/notes “cards”

iOS Shortcuts

  • Create Daily Log - this fills in date, time, weather, quotes and words of the day, auto generates links to yesterday and tomorrow, and then creates a section in which all other shortcuts and scripts can log to (I.e. so when I run New Card, it will automatically log a link to that new card in my daily log). I also do gratitude journaling, so it includes questions for that. I also assign a single theme word for each day, and have a spot for a picture of the day - which can be inserted with another shortcut with just a quick share on the photo.
  • New Card - this asks a user what type of new zettel to create based on any one of some 30 templates I have, then prompts the users to fill or dictate entries for different insertion points for that template. You can ignore any insertions you want.
  • Quick idea - a fast shortcut to type or dictate a fleeting idea
  • Convert Idea to Thought - a shortcut to take a fleeting idea and convert it into a more standardized thought file with metadata
  • Share to new card - allows you to share an image, pdf, text, markdown text, html, url etc. to a new card using one of the template files. It also supports importing an excerpted quote that you copy to the clipboard before sharing to the card. If it is text, it inserts the text into the card directly. If it is a pdf or image or doc, it transfers the file into the vault and then inserts a link to the file into the new card.
  • Share email to card - takes an email that you share to the shortcut and saves it to a new zettel, extracting fields from the standard email header entries. It also will extract any quotes from the clipboard.
  • Add photo to card - takes a photo, resizes it down and converts it to jpg and then copies it into the vault, then inserts the correct markdown code to embed the image into a chosen zettel

… and of course lots more that are particular to my setup. E.g. I write out goals in the morning and have a shortcut that runs at midday that will remind me of the goals/gratitudes for the day

Python scripts

  • Ones similar to above, but now accessible on a PC.
  • a script to auto generate a list of hashtags and link names, alphabetized, into a hidden file. This is useful for when I am using comparatively dumb editors on an iPad/iPhone that are not smart enough to manage wikilinks with a vault that has multiple folders. (And I wish obsidian would allow you to see an alphabetic list of all hashtags - in the mean time it is also useful for that).
  • I use a google form to fill out daily logs (and other ifttt recipes to record various data like fitbit - instrumented self stuff). I am building out python scripts to grab this data and insert it into my daily log so that it becomes the central storage container for all my info.
  • I am also playing around with a script that goes through and removes unused fields in my zettels leftover from templates to make them look a bit cleaner.
  • I really want to make a script that will log in to gmail and convert messages to markdown and download them. The lack of an email-to-obsidian markdown gateway is killing me :wink:

Autohotkey

I use autohotkey for simple automations, like:

  • Cleaning up text pasted from a pdf (e.g. remove line carriage returns and word wrap hyphens, rename brackets to parenthesis)
  • doing a quick dictionary lookup of a selected word
  • taking a selected word/phrase in obsidian and converting it to a Wikipedia link
  • classic keyboard expansions for date, time, time stamp, etc.

1Writer JavaScript

I’m also tempted to add a few JavaScript extensions in 1Writer. One would be to help me find hashtags and links when I am just on the phone, using the hashtag/link file made in python above.

I got lots more, but this is what comes to mind :wink:

And I do plan to share these out to the community, but would like to run them through their paces for stability first. I am sharing the list above just help spark discussion on what is possible, find out what others are doing, and get feedback.

4 Likes

Would love if you guys could share what you’ve created, if you see no inconvenience of course :slightly_smiling_face: There’s a lot of awesome ideas here (cleaning up text pasted from a PDF, backing up, finding the most used words in one’s vault…)!

2 Likes

I look forward to the 1Writer scripts. Thanks!

1 Like

Here’s a simple but fun output that shows me an overview of my journal notes:

Output:

20201225-journal ||||||||||||||||| 350
20201226-journal |||||||||||||||||||||||||||||||| 641
20201227-journal ||||||||||||||||| 354
20201228-journal |||||||||| 216
20201229-journal |||||||||||||||||||| 413
20201230-journal |||||||||||||||||||||||||||||||||||| 720
20201231-journal ||||||||||||||||||||||| 471

The Bash command to produce this (it’s not the most efficient thing, but works):

for f in `find /path/to/journal -type f | sort`; do \                                                       11:29:22
FILENAME=`basename -s .md $f`; \
COUNT=`wc $f | awk '{print $2}'`; \
PLOT=`calc "'|'*($COUNT//20)"`; \
echo "$FILENAME $PLOT $COUNT"; \
done;

calc is essentially just a python script that executes this (helpful as a simple calculator in the terminal):

print(eval(sys.argv[1]))
1 Like

I’ve made Shortcut on my iPhone for quick capturing into Obsidian. Described in detail here: Take Quick Notes in Obsidian from iPhone

I found this info on the fitbit page for API developers. This is way out of my skill level, but I thought I would pass it on for anyone that is able to use this to gather their fitbit info. I wish I knew enough to do it myself. Reference