109: Automating Obsidian

David mentioned in the episode (and elsewhere) the comfort he gains from using Obsidian Sync, specifically the end-to-end encryption with private key. But I notice that David makes liberal use of community plugins and in so doing will presumably needs to switch off the Obsidian restricted mode to enable use of these plugins. Doesnā€™t this undermine the security benefits of Obsidian Sync? Or do these features/controls relate to different security challenges: the first ensuring that no one, including Obsidian, can access your syncing data; the second potentially exposing unrelated vulnerabilities including unauthorised access to your device via a community plugin?

I appreciate the ā€˜socialā€™ safeguards around community plugins, particularly those with wide usage and presumably an active community of users on the look out for issues/threats.

I acknowledge this post is off topic in not relating to Obsidian automation and so am happy for it to be moved elsewhere or for me to be directed elsewhere. Many thanks.

It relates exclusively to data encryption in transit and at rest for the remote sync storage. As an optional component, it does not relate to local storage or use.

Think of the sync service as something external to the app. It is a web service and not the local app. Plugin security, app security, OS security, network security, etc. are all separate sets of security considerations; which of course can be viewed as a broader set of interrelated security interests.

1 Like

Enjoyed the episode.

Any suggestions or examples on how best to use YAML with Obsidian files? Specifically - what is some useful metadata to keep ā€¦ and how do you keep from going overboard on it?

2 Likes

Not helpful perhaps, but the answer here is going to be ā€¦depends. I use YAML very differently in my two databases. In my more administrative one, YAML is used in some cases for my ā€œpeople filesā€, which includes an alias, a cover image, and various tags. These all allow dataview to sort into a kind of useful card catalog.
In my research intensive vault, I use different kinds of yaml. For instance, I have become pretty enamoured with the ability to bring in map data for my archaeological research, so in this case the YAML captures geographic data that then gets plotted on a map with the (incredible!) Leaflet plugin. My zettelkasten notes are a bit more basic, but again are laying out information that I want to be able to quickly peruse using dataview. So - the answer really depends on how you might use other plugins. (Like I said, perhaps not a helpful comment!)

1 Like

I have not allowed myself to add any more plugins to Obsidian for the last few months as I focus on getting more of the actual work doneā€¦but :clap:, listening to this and Iā€™ve added 2 of the basic ones that I somehow missed (the URL insert, and the dynamic table of contents).
Cheers!

Many thanks @sylumer. This is helpful.

Thanks @aroddick . Those are some useful examples. The geographic data use case is particularly cool. I see that YAML is an incredibly powerful tool. I guess key is just start experimenting with it some.

1 Like

This seems an appropriate place to ask my Obsidian automation question. Iā€™ve listened to the episode and itā€™s all about automating things into Obsidian from other places, or automating within Obsidian. I would like to automate things out of Obsidian sometimes, and even though itā€™s just plain text files thereā€™s magic going on that I canā€™t easily get at.

For example, I can use the dataview and tasks plugins to magic up task lists for me within Obsidian with code blocks like this one that pulls out my incomplete tasks from my in progress projects:

dataviewjs
dv.taskList(dv.pages('#project')
	.where(p => p.status == "In Progress")
	.file.tasks
	.where(t => !t.completed), 
	true);

which gives me a nice task list on an Obsidian page. What Iā€™m thinking is that youā€™d run something on the command line to process this to an output file. Something like process-obsidian tasklist.md > tasklist.txt which would give you the actual task list output as a text file.

Am I missing something obvious? I had a crawl through the Obsidian forums looking and found someone asking something similar being pointed to the innards of one of the plugin implementations for how to process the text files to find the tasks etc yourself. But Iā€™m wondering if Iā€™m missing a trick, or missing an obvious search term to find the answer?

Thanks.

3 Likes

In the Automators Max portion of the show, @MacSparky mentioned heā€™s planning an on-air light for his Endor Studios project. I know there are out-of-the-box solutions for this, but I put together a DIY version using a Philips Hue bulb. And now when I press my Stream Deck button for ā€œStart Podcasting,ā€ it launches Audio Hijack, sets my Podcasting Focus mode, silences my Mac, and turns on my On Air light to red. Hereā€™s my write up of how I made the light: Making an On Air Light with Philips Hue and Automation - Bettnet.com

1 Like

Would be a great feature if dataview could write the results to a new file.

That would enable you to run another query on the results. Or compare the results of multiple queries :slight_smile:

Drafts Automation with Obsidian
My challenge is using [[content]] links as I may often forget the syntax. In Obsidian this is not a problem as the app tries to guess the actual link from my input. For Drafts this is a notable disadvantage. I am hoping that I am missing some magic that allows Drafts to reference existing [[links]]?

All help gratefully received

Auto complete suggestions for the same double open square bracket is a feature.

Been working for me for quite some time.

Thanks for the prompt and I recognise my lack of description has not helped. What I want is for auto complete to reference links that exist already in Obsidian. I use Drafts to start the text but I dont use Drafts as the long term storage.
Guess I could be looking at a feature request but appreciate the support

Obsidian could refer to multiple vaults in multiple locations. I think you would have to build an index for Drafts to reference and then you might be able to do something with an autocomplete definition, but I donā€™t recall anything being able to reference an external list.

Another option to would be to have an archived draft for every page in your vaults. Then Draftsā€™ existing link autocomplete on would work.

I canā€™t see it getting built in as a feature in Drafts, in much the sam way I canā€™t see Obsidian building in any support for looking up links in Drafts.

Brilliant advise - thanks for the support

Finally got to this episode, for some reason the use of YAML and Dataview never clicked for me before. Luckily today i have some free time in the afternoon, so I can spend the time converting my odd linking system to YAML & Dataview format!

Thanks for making this episode!

Love this show. You hooked me on Obsidian, but am struggling to get to that next level.

Need some advice: My use case is:

I have a list of songs as atomic notes.
I have a list of albums as atomic notes.
Songs first appear on an album in a position, ie. the last song, second song, etc on the album.
The same song may also appear on a different album, like a compilation album, or a live album, in a different position in the track list. Or if Iā€™m building a list of concert set lists, it may have been performed hundreds of times.
Whatā€™s the best way generate track lists containing the songs?

I was thinking the song would have tags for each album on which it appears, but that omits the track number on that album.
I could have a second tag, like album name and track number, but that doesnā€™t seem like it would scale very well for concert lists.

Any recommendations for how to do this with dataview?

Extra complexity I can skip if not feasible:
I also want to include other data for the song. For example, a live version one night might be a different run time. Say, someone took a long solo, or there was an extended jam, etc.

If you want to build the lists dynamically using Dataview rather than manually maintaining it in each album, then you might want to add it to the YAML in each songā€™s note:

Maybe something like this?

---
notetype: song
song: Sgt. Pepper's Lonely Hearts Club Band
artist: The Beatles
albums:
  - album: Sgt. Pepper's Lonely Hearts Club Band
    track: 1
  - album: 1967 - 1970
    track: 3
---

Perhaps a little fiddly to maintain, but you can then access that data in the song note directly, and album notes could query that meta data. Specifically you would need to query a list of objects.

You could alternatively add details to the album note like this:

---
notetype: album
---
# 1967 - 1970
## Track List
1. [[Strawberry Fields Forever]]
2. [[Penny Lane]]
3. [[Sgt. Pepper's Lonely Hearts Club Band]]
...

Then you would be able to pull in via Dataview query all notes the song is linked from, of notetype ā€œalbumā€. Simpler but then you wouldnā€™t be pulling in the track to your song note - just the album. So that is a consideration - do you need to see the placements on the song note, or is that just a nice to have?

For working with YAML meta data in Dataview, do check out the data types page in the docs, and the Dataview relate posts on the Obsidian forum for lots of great worked examples.

The extra complexity I would say is more difficult. In the strictest sense, are these variations the same song? I would argue they are not, they are by definition something based on the original but differ in some way. If they were represented as a single note, how would you envisage specifying for an album which variation was used? It can be done ā€¦ but it is certainly more difficult. The alternative might be to have ā€œstubā€ notes for your variations that embed the main song note, but include additional information about the variation and different meta data to reflect the differences. It might be something worth considering or even trying on a small scale to see what works best for you.

Hope that helps.

1 Like

Thank you!!! This is very helpful. I will try it out. Much appreciated!!