Lisa Sieverts

Follow @agilelisa on Micro.blog.

grep, BBEdit and Obsidian to the rescue

I want to share some grep pride and also write things down for when I need it next time.

I have a new gig where I’m teaching online project management courses for another company. They give me the slides and a delivery guide, but I’m on my own for figuring out what I want to say. I’ve already delivered 3 classes and thus have figured out what I want, which includes displaying the slides in my notes.

I’m working on a new course which has 214 slides. I wanted to save some typing by setting up the structure in advance.

First step, Excel. I typed “Slide 1” and “Slide 2” in adjacent cells and then let Excel do the rest of the numbering out to “Slide 214.”

Thence to BBEdit. I did a couple of greps but the best one saved the Slide number pattern and then pasted it back in with the Obsidian markdown link pattern to transclude an image.

Here’s the match:

Slide ([0-9]+)

And here’s the replacement instruction:

Slide \1\n\!\[\[Slide\1MCAF.jpeg\]\]\n

Abracadabra!

CleanShot 2022 10 24 at 16 42 21 2x

The last step was going to Powerpoint and using their export goodness to get a resized JPEG for each slide, luckily this functionality is built into Powerpoint. I copied the resulting 214 correctly named JPEG files into the directory I use for Obsidian attachments, then pasted the text from BBEdit into my note, and voila, 214 placeholders in Obsidian including the correct slide image. I feel brilliant.

I can’t also show you the cute little slide pictures in Obsidian because the content is proprietary.