I’ve managed to start using Obsidian and Keyboard Maestro effectively which is very nice. A big improvement over Drafts for what I was trying to do, since now I have properties and links between notes, templates and auto-filling.
Now I’m thinking whether I can export selected Obsidian notes to tinderbox, with the tricky part being able to keep the links between obsidian notes (as well as mapping obsidian properties to tinderbox attributes).
what would be interesting is to map the obsidian template to a tinderbox prototype and then automatically export from obsidian.
Has anyone done this?
(I looked in the archives for both obsidian and tinderbox and didn’t see an outcome. I think Michael B demoed moving markdown content which is a bit different and simpler)
thanks, Frederick
PS Keyboard maestro does have the issue that there are sometimes issues if the computer doesn’t finish an action before the next one starts, which means putting in delays manually, sort of annoying to have to do this.
IMO it’s a relatively straightforward process; both to get your Notes from Obsidian to Tbx and set them up within the Tbx-specific environment, as well as to retain backward links to origin .md files in your Obsidian vault.
Create your Note in Obdsidian, apply the Obsidian Template of your choice - which will insert “Properties” (analogous to Attribute>value pairs) in the .md file’s YAML. It helps greatly if you create all your Tbx-bound Notes in a specific folder, which you will set up in Tbx as your $WatchFolder.
Populate the YAML values as you need. You can get pretty adventurous here, including setting $Container values and so on. You can also set your $Prototype value!
Open a Tbx project, create a Container and set its $WatchFolder.
Copy out the source Notes to a Working Container in Tbx (remember that $WatchFolder notes are read-only, and technically belong to the origin app, Obsidian). Your $File value, which is the link to the origin .md file, will also copy over.
The .md file will also include the YAML content, which you can pick up and assign to Tbx Attributte values using streaming action code, in the order of:
"$Text.skipTo("Property: “).captureLine(“Attribute”);”
That’s it, your Properties are now converted into Attribute values.
Regarding the latter part - I’m not sure there is too great of a value to maintain more than cursory backward links to your origin .md files, as you can easily fall into the trap of content duplication/multiplication as well as eternal chasing after updates to origin data and appending such updates to your Tbx project structure. You could write Functions to scour and auto-append your content, but it can still get hairy. Also - if you re-locate your origin .md file post-importing it into Tbx, you’d need to manually update your linked Note in Tbx.
This is useful, but perhaps explain to the OP in detail how to configure the streaming code, where it goes, how to trigger, etc. aTbRef has the details but assumes some foreknowledge that the OP might not have.
I.e., when the notes are copied and pasted into a “Working Container” the $ReadOnly attribute will still be True and needs to be flipped to False before further processing of these copied notes can happen.
I use a Stamp, which runs through my Property values and saves them to $Attribute values. You can also Function-ize the code or set it up in an Action for the Container containing $WatchFolder - a lot depends on your general working style. I prefer to do manually via a Stamp, as I might choose to tweak and alter values just before running my Stamp.
The literal translation of the streaming action code "$Text.skipTo("Property: “).captureLine(“Attribute”);” is: Go through the $Text, skip to the line where the Property name is mentioned (followed by colon and a space) - then capture the rest of that line and save it as the value of the $Attribute indicated between parentheses.
You can further add a line to your Stamp that will clean up your Note after the Attributes are assigned, by deleting Content between the YAML markers (which are “—” and “—”). I haven’t done that (as yet); for now I either delete manually or dump the YAML content to a User Attribute set up for the purpose.
Hope this clarifies.
Edit: Noted the point added by @PaulWalters regarding ReadOnly status needing to be manually toggled for Notes copied out to the Working Container. I use a Stamp for that as well. This second Stamp also sets Prototype as well as DisplayedExpression values. The reason I separate the actions into 2 Stamps is so I can manually edit Notes prior to running the streaming action code - I prefer small discrete steps, that way
I think you asked before what Keyboard Maestro has to do the tinderbox aspect and the answer is it has nothing to do with it. (I no longer see your message here for some reason)
I simply mentioned it as being very useful since Michael B mentioned it at the meetup and I find it very useful.
Thanks, good point. By all means note here or by DM what’s missing—i.e. the unguessable bits. The aim is to help the person new to things so if I can, I will.
@mwra, what would be the best way to select the section of Text between the 2 YAML header markers? They display in $Text field as — and — (“dash dash dash” and “dash dash dash”).
I could ease this process for RegEx search purposes, by including (a portion of) the text string following the first YAML marker.
Since Obsidian files are Markdown and sit in the file directory on your computer as a Vault. All you need to do is point a TBX file at the Obsidian Vault using the TBX watch folder. You can then pull in the files.
I do this all the time. I then use stream parsing to pull the values from OBS prototypes into TBX attributes.
What I want to do is - post-parsing and assigning the fields to Attribute values - to cut everything between the 2 sets of triple-dashes in order to paste them elsewhere. Is there a way to accomplish that using the stream parser?
Stream parsing is essentially a read0only process. It lets you find and copy data, e.g. to put as attribute values. But you could do a 2-pass process: once via stream parse to find/extract values then use a .replace() to remove any --- ... --- sequences.
Since the string - - - can only occur at the start or the end of YAML, you could easily pick out the YAML in a regular expression.
Equivalently, the stream parser could pick out and parse the YAML, and could then assign the rest of the stream back to $Text. (This might discard styling in the text, but it might not!)
Thoroughly and elegantly, I might add! Thanks for the great overview and approach tips, @satikusala, greatly appreciated by all
On a broader level, the video is a good reference I think for those juggling with entering content in Tbx through a mobile on-the-run environment, not just from Obsidian.