Sync with External Folder?

I’ve just discovered the “sync with external folder” feature. For me, I think this can be very useful, but I’m not sure I properly understand it. I watched the demo video, but I’m still confused. Here’s a walkthrough of my question:

I have a folder that contains 200 poems. They’re all .txt files. Their filenames and (flat) directory structure are meaningful to me at the moment, because I use these files with other applications (Git for example).

I thought I would try to create a new scrivener project, to sync with those files, and experiment with ordering, grouping and editing them.

I did “sync with external folder” and pointed to that directory, but it didn’t seem to work.

Do all the files I sync with Scrivener have to be in a folder called “Drafts”? If so, can that be changed?

I also noticed that, when the files do sync (when they’re in a folder called “drafts”) they get renamed to contain a sequence number (that’s ok with me) and also a scrivener ID number (that’s potentially problematic for me because it is meaningless in other environments). Is there a way to make these filename numbers optional? (this might be asking too much but…) Can Scrivener have some sort of internal way of knowing which file is which without renaming it?

Thanks for any feedback you may have, anybody, and thanks for making Scrivener and this forum so great!

I am not entirely sure what you are doing, but it seems that you might want to look into the “Import Files As Aliasses” feature (under the “file” menu. :slight_smile:

The trouble with that method is that it will only import files into the “research” folder. The files I’m working with aren’t research. They’re the writings themselves. Also, this import doesn’t accept .txt files, according to something I read in the changelog, so that doesn’t seem like a viable option for me.

I am running Scrivener version 2.4.1 on OSX 10.8, and I can do just exactly what you want to do.

I I check on the File -> Sync -> Sync with external folder, I get a dialogue box that lets me

Under OPTIONS:

  • choose which folder I want as the folder with which i want Scriv to sync
  • sync the Draft folder or other folders excluding the Draft
  • sync only the docs in a certain collection I have designated
  • prefix the files with numbers (or not)
  • take snapshots before syncing
  • check the external folder upon opening the project

as with prefixing the files with numbers, these are all checkmarks: I can have them on or off.

And under FORMAT and there you can choose to sync with plain text format, with whatever extension you wish.

So I created a new project based on the blank template, and these are my settings in the Sync With External Folder:

Under OPTIONS

  • Sync the contents of the Draft folder is checked
  • Check external folder on project open and automatically sync on close, is checked
  • Other options here are left unchecked

Under FORMAT

  • the format for external Draft items is Plain Text with extension txt
  • Automatically convert plain text paragraph spacing, is unchecked.

So I created 3 documents in the Draft folder, wrote in some text, and chose the external folder. Then I had Scrivener sync with this folder, closed the project, opened a text editor and added two lines to one of the files. I then saved the file and closed the text editor, and opened the project in Scrivener. Scriv gave me a couple of boxes about syncing, I told it to go ahead. The additional two lines appeared in the document in the project.

Also, the titles of the documents in the binder are the same as the titles in the external folder, except that the external .txt files have the numbered suffix of -3-.txt, -4-.txt, and -5-.txt - this might not be something Scrivener lets you change, since it needs those numbers to know where in the binder to place them. (Creating a new .txt file in the external folder using the text editor imported it into the Draft upon syncing, at the bottom of the Draft folder. When I synced the project again, Scrivener changed the name of the .txt document in the external folder, adding -6- to it.)

hope this is not too long winded and gets you closer to where you want to be

  • asotir

Thanks for this I’ll go through the steps you described.

Thanks for the input but I guess my question was a bit unclear. Is it possible to sync files that are (a) not in a “drafts” folder and (b) to do so without changing their filenames?

Yes, if you look at the sync settings the first two options address whether you want the sync scope to be draft only or everywhere.

Filenames on the disk will always be potentially changed based on their order (if you use numbering) or name in the binder. It would be confusing otherwise, if files kept their original names even though the binder name was changed, or if their number ceased to reflect their current position in the binder order.

Is it just my imagination or is the sync only a one-way sync? If I have files in a directory, and then create a blank project to sync them, they never show up in the project. I’m content to use “import” instead, but what if I had many, many files to sync?

This feature is for synchronising text with programs other than Scrivener. It should never be used to try and sync two projects together, or to update one project with another’s files. As you note, that is what Import/Export are for, or better yet just drag and drop between project binders if you can.

I am finding it very frustrating with trying to sync with Ulysses. I have been working on text files but want to edit them in Scrivener for compiling. Thing is that I don’t want the fie names to be changed at all. I want to keep the names the same as in Ulysses. I have already prefixed each file with a number so the order stays the same, but when I go to sync Scrivener with an external Dropbox folder it puts numbers at the end of the file too which is really annoying and in turn this creates duplicates of that file in the Dropbox folder. I have the “Prefix the filenames with numbers” unticked.

Is there any way to keep the file names intact and not create duplicates?

I’ve tried this myself, with Ulysses and other apps, to no avail :frowning:

The filename is the only mechanism we have available to safely communicate where the contents should go back into the project. Any tool that aggressively renames files should thus be avoided, especially if it messes with that number on the end. That number is crucial as it identifies the precise binder item the text came from. Changing it or duplicating it could have bad results. This is incidentally the same reason why we do not let you sync to Scrivener projects to one folder—because Scrivener is a program that aggressively renames sync files. :slight_smile: Each project has its own internal identifier for binder items.