Hello,
Some days ago I tried MultiMarkdown and found out that one can put Metadata in a YAML Header at the top of a note in form of key: value pairs. (Markdown Metadata)
The look reminded me of Key Attributes and the Text Pane in Tinderbox.
As I like to take notes outside of Tinderbox and was looking for a way to capture “meta” stuff right along with the note creation I made a Keyboard Maestro Macro which creates a fresh Markdown file from a BBEdit Template, ready with my new YAML Header (I divide Header and “real” content by “—” on a new line. Not sure if this is necessary.) All files created by this macro are saved to a Finder folder which is a WatchFolder in Tinderbox.
My Plan now is to extract the YAML values, put them in User Attributes and then remove the complete Header from $Text. Then I can do stuff in Tinderbox (look through the notes, reorganize them, fill User Attributes and maybe add new ones). But I don’t want the notes to only live in Tinderbox so the next step would be Export. I want Markdown files with the User Attributes in form of a YAML Header and beneath this $Text (structure just like the input in the WatchFolder).
Now I would have notes which can be accessed from any app (which can handle Markdown or plain text). The neat thing about a YAML Header in MultiMarkdown is: it’s not there. It’s hidden in rendered view. If I index the exported notes in DEVONthink then I would have “normal” Markdown notes - plus the hidden User Attributes exported from Tinderbox. Hidden but searchable.
But I don’t want to use the exported notes in DEVONthink in the first line. My starting point was to split up revision of notes and actual usage (e.g. Attribute Browser) into two separate Tinderbox documents. This way the state of a note should always be clear. So I plan to make the folder with the exported notes a WatchFolder in another Tinderbox document and repat the extracting of YAML values and setting of User Attributes there.
In order to keep everything clean and clear I thought of:
- moving the File to another Finder folder (to stop reloading $Text)
- changing $File to the new location in Finder (for easy access if needed)
- moving the processed notes to another $Container (just tidy up)
I have this code so far but it doesn’t work the way I thought it would. If I use it as $Edict of the “Imported from Finder” Prototype I have to click every note to process it (or do I have to wait much longer?). And used as $OnAdd of the WatchFolder it only moves the notes to the other container.
$MyString=‘"’+$File.replace(“~/”,“/Users/ian/”)+‘"’ ; runCommand(“mv “+$MyString+” /Users/ian/moved/”) ; if $Text.contains(“—”) {$MyList=$Text.replace(“;”,“:”).split(“\n”); $MyList.each(n){if n.beginsWith(“title: “){$YAMLtitle=n.replace(“title: “,””); $YAMLtitle=$YAMLtitle.replace(”:”,“;”)}}; $MyList.each(n){if n.beginsWith(“created: “){$YAMLcreated=n.replace(“created: “,””); $YAMLcreated=$YAMLcreated.replace(”:”,“;”)}}; $MyList.each(n){if n.beginsWith(“category: “){$YAMLcategory=n.replace(“category: “,””); $YAMLcategory=$YAMLcategory.replace(”:”,“;”)}}; $MyList.each(n){if n.beginsWith(“state: “){$YAMLstate=n.replace(“state: “,””); $YAMLstate=$YAMLstate.replace(”:”,“;”)}}}; if $Text.contains(“—”) {$Text=$Text.split(“—”).at(1)} ; $Container=processed ; $File=$File.replace(“/Test/”,“/moved/”) ; $EdictDisabled=true ;
What am I missing? Is this a good way to go at all? What do you think of splitting different steps to different Tinderbox documents? Does it make sense?
Ian