I’m using Scrivener’s external folder sync feature with Obsidian.md without any (major) issues. Can someone please explain how Scrivener name the files with an integer between square brackets?
Is there an option not to have those numbers? I’m assuming there isn’t, as it might need as a way of identifying the file.
Where does the numbering comes from? That is, what is the rationale used for the integer value?
I’m trying to understand how this works as I’m contemplating developing a tool for helping with some Scrivener tasks.
It’s been a while since I used this feature, but as far as I remember, the numbers simply increase to reflect Scrivener’s Binder order in places where the exported files are sorted alphabetically (e.g. OS folders, Obsidian directory tree, etc.).
I thought that has something to do with the order of files, but I changed a file’s position in Scrivener, forced a sync, but the number stayed the same.
Hmmm. That’s what the manual says about it (also answers your question: yes, you can turn off the numbers):
Prefix file names with numbers
Enabled by default. Causes the names of the files in the sync folder to be prefixed with a numeral corresponding to its position in the binder. Disabling this will remove the number and the contents of the folder will be subject to ordinary alphanumeric sorting based on the names of your binder items.
(see: 14.3.1 “Setting Up Folder Sync”)
ADD: And also this (not the same kind of number!):
Can I change the names of the files?
It is very important to never change or remove the number enclosed in brackets at the end of the file name. This number is what Scrivener uses to link the file back to a specific item in the binder. That caveat aside, changes made to the names of files on the disk will update respective binder titles if possible. The prefix number, if applicable, will be ignored.
(see: 14.3.2 “Usage”)
In short: The number in brackets is the ID, it won’t change, it can’t be turned off. The number in front (prefix) is meant for sorting, should change reflecting the binder order, and can be turned off. Sorry for the confusion.
One more thing. If you want to be sure you get the ID numbers right (there’s no point in guessing or trying to predict them), you can look them up in your project’s .scrivx file.
E.g. every <BinderItem> has a UUID (something like “7208C0A3-E4A1-7ADE-B38A-148224G2093B”).
And then there’s an <ExternalSyncMap> section, which holds entries like <SyncItem ID=“7208C0A3-E4A1-7ADE-B38A-148224G2093B”>99</SyncItem>
The [99] is your identifier.
If you damage anything, I didn’t tell you to poke around there.
Prefix file names with numbers: I have that turned off. That is not what I meant.
The numbering I was refering to is the one between brackets at the end of the file name (a suffix, not. preffix).
I’ve been poking inside a .scrivvx file and I noticed the identifiers. I’ve been doing my investigations with a dummy/test project.
It is early stages but I’m looking to develop a tool for Obsidian to better sync a Vault with a Scrivener project. It is VERY early stages, but I think that by leveraging Obsidian’s YAML front matter (sort of a meta-data) I could come up with a plug-in that does a better sync with Scrivener. Like support for folders and Scrivener meta-data. And who knows, perhaps even converting markup/RTF back and forth.
Yeah. At this point you probably end up skipping Scrivener’s sync (and file name conventions) altogether and just doing the conversions all by yourself. Sounds like a fun project. And a bit scary.
I want to start with no support to sync with the built-in Draft or Research folder. User will have to create a Notes (or something else) folder to sync.
Also sync from Obsidian to Scrivener will be much easier than the other way around. Also I haven’t coded in years (I’m more at the high level of sotware architecture and design at this point) so it is likely I’ll need some contributing help.
It could turn out really nice in terms of organization (mapping keywords, labels, custom metadata and such), but the “actual writing” part… You’d have to limit the formatting to the few available Markdown options. Otherwise you end up inserting a lot of HTML to simulate styles.
You’re right. I’ll start very simple. Speaking of which…
I always understood that a folder in Scrivener is a loose concept, because you can always add documents under other documents in the same way you can add them under folders. However, there is the type attribute in Scrivener entries. I noticed in a blank project the usual suspects:
Plus a document is of type Text and a folder is of type Folder. But since we can change icons to anything, and anything can contain anything, then what is the practical difference between a Text and a Folder?
Okay, @JimRac was first. Those small differences aside, there’s no fundamental difference between a file and a folder, as far as Scrivener is concerned. The nesting happens via <Children> elements.