AT3, Scrivener, and Obsidian

A feature request to sync AT with Obsidian created an interesting discussion: Aeon working and syncing with Obsidian

I just discovered that Scrivener can write its document files in markdown to a sync folder that’s shared with Obsidian. Moreover, AT3’s metadata, which can be synced to Scrivener, can be written by Scrivener to a YAML frontmatter block in the markdown file.

This seems to open the possibility of achieving a syncing relationship between AT3, Scrivener, and Obsidian. Moreover, since Scrivener can automatically assign a numerical value representing the order of scenes, and place that value into the YAML, we could then use Obsidian’s Dataview plugin to always have the correct order of scenes in the view.

This could be promising. Before I head down this rabbit hole, I wonder if anyone here has already done something like this. If so, I’d love your perspective and advice.

3 Likes

Success!

My goal was to be able to write in either Scrivener or Obsidian and have them sync.

So I set up a Scrivener sync file that copies the scenes and chapters to a shared folder in the Obsidian vault. Scrivener can be set to share the files as .md files, which is just what we need.

Also, if I add, delete, or move a scene AT3 or Scrivener (which, again, already sync), I wanted that reflected in Obsidian. Scrivener has an option to automatically prepend to each .md file it writes to the shared Obsidian folder a number representing its order in the Scrivener binder. Obsidian dutifully reordered the files (scenes) in the Obsidian file explorer according to the prepended number. (How cool is that? And let’s not forget that Scrivener also syncs to AT3 in that regard.)

The result? I can now write in either Obsidian or Scrivener and the two programs will sync. I can move scenes around in Scrivener or AT3, and Obsidian will reflect that new order/structure.

Not only that, but I set up syncing to be automatic on closing Scrivener, plus there is a hotkey to manually trigger syncing (or, in my case, a Stream Deck key) if I want to.

One issue is that if I create wiki-type links in Obsidian when drafting, they will show as nonfunctional [[links]] in Scrivener. I don’t mind; I can probably find a way to remove those via a script if they bother me. They don’t, as most of my wiki-type links in Scrivener are in the story bible, and I don’t have any reason to sync those .md files to Scrivener. So there will be relatively few such [[links]] in my narrative as I write the manuscript.

I no doubt will do some tweaking but I think this is going to let me use all three programs for what each is best at.

4 Likes

Hey! I’m looking to setup sync between AT and Obsidian as well. If it takes having Scrivener inbetween, so be it.
Would you be so kind as to share more details on your workflow? How is the syncing to the shared folder being done? Did you write a bat file?
I’d also be interested in how to setup Scrivener to handle markdown in a way where it doesn’t conflict in Obsidian.

Thanks!

Happy to.

No batch file is needed. I use Scrivener’s built-in sync folder function to create a shared folder inside the Obsidian vault. Scrivener can then write, monitor, and update/sync the shared .md files any time you change them from either Obsidian or Scrivener (or, through syncing between AT3 and Scrivener, in AT3).

My assumptions:

  1. You want to sync AT3’s Narrative or Outline views, rather than the Timeline or Spreadsheet views.

  2. You want to do your writing primarily in Obsidian, yet be able to make changes and move things around in AT3 and have such changes reflected in Obsidian, even the order of things.

  3. You have an active AT3 project.

  4. You do not have an active Scrivener project.

  5. I use Scrivener 3 for Windows; if you don’t, I assume this will all work with the Mac version, too, but you’ll need to verify that.

The first step is to create a blank Scrivener project and, following the AT3 documentation, sync AT3 to that Scrivener project. Your Scrivener project will automatically be populated with all the AT3 narrative events plus any metadata you choose to sync.

Next, consult the Scrivener documentation to set up a shared folder. Be sure to create it inside the Obsidian vault. Call it something like “Scrivener sync.”

Lastly, inside Scrivener, initiate the sync process. Scrivener will write its documents to that shared file, but you will configure syncing so that Scrivener writes them as .md files rather than its native .rtf files. Initially, since your Scrivener documents are blank (because you’re working with a new Scrivener project), it will create .md files without content. You can then copy/paste whatever content you’ve already written into the relevant .md file. You can paste in any YAML block text as well. From that point forward, you can write to these .md files, and Scrivener will sync them back to Scrivener (syncing can be automated to trigger when closing Scrivener and can be manually done, too). Then, you can sync Scrivener to AT3 using AT3’s syncing.

If you want, you can configure the Scrivener sync function to prepend to the .md file name a number representing its position of the Scrivener (and, through syncing between AT3 and Scrivener, AT3) narrative. It will then show the files in the narrative order in Obsidian’s file manager. Here’s what they look like in Obsidian (disregard those small numbers representing word count; those are added by a plugin called Novel Word Count):

Unfortunately, as you can see, Scrivener insists on appending a bracketed number, such as [2] in the highlighted .md file, to each .md file name. It uses this number to enable any changes made to the file to be synced back to Scrivener. That can create an issue with Obsidian’s wiki-like linking when linking to that file. I’ve discussed this issue, and how it doesn’t impact my workflow, in the Scrivener forum, here: Scrivener, Obsidian, and Aeon Timeline…Oh My! - Scrivener - Literature & Latte Forums. I also discuss using link aliases as a workaround if this is truly a problem in your workflow.

I hope this gets you started. Let me know if I can answer any questions.