Converts a Capacities notes export (Markdown + images) into TextBundle files suitable for import into Craft on macOS.
Capacities exports notes as a folder of .md files organised by type, with associated images in a Media/ subfolder. Craft imports .textbundle packages — a folder format that bundles a Markdown file together with its assets and metadata. This script bridges the two.
- Recursively converts all
.mdfiles in the input directory, preserving the subfolder hierarchy in the output - Copies referenced images into each bundle's
assets/folder and rewrites paths accordingly - Sanitizes image filenames (removes spaces and parentheses) to maximise compatibility
- Sets alt text to the image filename, matching Craft's own export format
- Strips YAML front matter; prepends
# Titlefrom thetitlefield andTags: #tag1 #tag2from thetagsfield - Removes the duplicate H1 heading that Capacities includes in the body
- Converts Capacities multiline inline code (single backticks spanning multiple lines) to proper fenced code blocks
- Escapes hashtags that appear at the start of a line in the body (would otherwise be parsed as headings)
- Weblink notes (
type: Weblink): renders as a titled markdown link, with any body notes preserved below - Task notes (
type: Task): collected from all source files into a singleTasks.textbundlein the output root, with- [ ]/- [x]checkboxes based on completion status - Skips image-container notes (
type: Imagein front matter) and removes links to them - Handles URL-encoded paths, case-insensitive filename matching, and asset filename collisions
- Ignores remote image URLs (leaves them unchanged)
- Prints a summary report with warning details after each run
Python 3.10+ — stdlib only, no dependencies.
python convert_to_textbundle.py [input_dir] [output_dir]| Argument | Default | Description |
|---|---|---|
input_dir |
. (current directory) |
Root folder of your Capacities export |
output_dir |
output/ |
Destination for generated .textbundle files |
python convert_to_textbundle.py "Capacities Export" "Capacities Output"Capacities Output/
Tasks.textbundle/ ← all Task notes collected here
text.markdown
info.json
Charts/
My Chart.textbundle/
text.markdown
info.json
assets/
image_1.png
Pages/
My Page.textbundle/
...
Weblinks/
My Link.textbundle/
text.markdown
info.json
- Run the script and copy the output folder to a location accessible from your Mac (e.g. Google Drive)
- In Craft, use Import and select the output folder
- Craft will recreate the folder hierarchy and resolve all images automatically