Sync Scrivener to External Folder In Obsidian - Obsidian Internal Links workaround

I use Scrivener for my fiction writing, and I’ve recently started using Obsidian for note taking / idea generation on the fly.

In Scrivener, users have the ability to sync the contents of their project to an external folder via the “Sync to External Folder” feature. The official Scrivener forum has a pretty good explanation of how this can be used with Obsidian.

The Problem
However, when Scrivener syncs to an external folder, it creates files in this format:

  • FILENAME [INTEGER_IDENTIFIER]
  • Example: Anna Karenina [100]

This file naming convention is invalid in Obsidian ( [ and ] are restricted characters in Obsidian File Names).

Because of this, Obsidian’s internal links feature won’t work. This issue is described in this Obsidian Forum Post:

The Workaround
Aliases!

  1. Add an alias to the top of any note with an invalid file name.
  2. When you create an internal link in another file, link to the alias instead of the file name.
  3. Now your internal links should work!

EDIT:
It looks like you don’t need to set an alias in the invalid file if you don’t want to. Of course, if you don’t create an alias inside the invalid file, Obsidian won’t be able to auto-complete the internal linkage.

If you want to create an internal link to a note with an invalid file name, you can simply write you link in this fashion:

  • [[FILENAME [INTEGER_IDENTIFIER]|VALID_NAME]]
  • Example: [Anna Karenina [100]|Anna Karenina]]

Mods / Obsidian devs, let me know if you think there are scenarios where this alias workaround won’t work.

2 Likes

I use the Hazel app on my MacBook. You can set it up to watch for new files in a folder, make a copy of the file, then rename the file and move it to an Obsidian folder. I’ve been using it for Scrivener and web clippings.

4 Likes

Interesting idea! I was thinking about connecting Scrivener with Obsidian for note-taking and writing.

Is this a two-way sync? Can changes made into the Obsidian folder be synced back into Scrivener?

I haven’t tried a two way sync. Hazel is dealing with local Mac files and I use Obsidian sync so a local file is pushed to their sync server. It’s clean and works for me. I’m not sure moving files and syncing at the same time would work. One interesting idea would be to put the file in the Scrivener Research folder. I’ll have to try it next time.

1 Like

Yes! 2 way sync works just fine.

With Scrivener, it only syncs changes from / to the external folder (in this case, the one in your Obsidian vault), whenever Scrivener

  1. Opens
  2. Closes
  3. When you initiate a manual sync.
    Note: You can change these external folder sync settings in Scrivener.

Some things to be aware of:

  1. Whatever Scrivener documents you sync will now be in Markdown. No big deal if it’s just your Scrivener research folder, but if you’re syncing your Binder, you’ll have to remember to Compile from Markdown when you output your draft.

  2. If you make a new file in the Obsidian Folder first, it won’t have the [INTEGER_IDENTIFIER] in the file name. When you first sync it with Scrivener, Scrivener will modify the file name to include the [INTEGER_IDENTIFIER]. This means that if you create internal links before the file is synced with Scrivener, those links will break (because those links will now have the invalid bracket characters).

That’s great news! Will try that later.