Sync to external files -- not supporting highlighting and footnotes

Dear Scrivener wizards,

I am having an issue with the External Folder Sync option (File > Sync > with External folder). I am using this because it allows me to integrate my Scrivener texts with DEVONthink. More on that here: ““embedding” files written with Scrivener into DevonThink” [forum.literatureandlatte.com/t/embedding-files-written-with-scrivener-into-devonthink/46728/2]).

I am running into an issue where Scrivener is not behaving correctly (or, how I would like it to) with regards to highlighting: When I highlight in Scrivener, it does not communicate the highlighting to the RTF document generated as part of the external sync (and therefore doesn’t show up in DT, where I need to see that highlighting). Highlighting behavior does work correctly going in the other direction: I can highlight in either DT or the RTF document and the highlights appear (after syncing) in Scrivener. But I need the opposite as well, that is, for my Scrivener highlights to appear in the RTFs.

The same poor behavior between Scrivener and the RTF files also plagues use of footnotes. When I add a footnote, it doesn’t appear in the RTF document, and therefore disappears from Scrivener if the RTF is used to update the Scrivener text.

Is there some way to resolve this issue?

I looked in Scrivener > Preferences > Sharing but didn’t see anything obvious there.

I’m syncing to RTF files, which seems like a fine format for me because my text needs are very basic besides wanting to preserve basic formatting. But I’m not committed to it for any reason–just need something that actually works.

Your help resolving this is much appreciated! Thanks!

I’ve just done a quick test and confirm the following:

a) Highlights and footnotes can’t be seen in TextEdit or DT3.
b) The same highlights footnotes in the same rtf file, can be seen when it’s opened in Word.
c) Highlight and footnotes transfer back into Scrivener from everywhere.

So it looks like it’s an issue with the external editor you use (DT3 uses Apple’s basic editor, so it’s not surprising that it won’t show them if TextEdit won’t). BTW — the highlights I added to test in Word also aren’t shown in TextEdit/DT3).

If you open the RTF file as a pure text file in Vim, for example, you can see from the raw text that the highlight and footnote codes are in there: they’re just not displayed in those editors.

That would suggest that it’s an issue external to Scrivener.

Is that so–for highlights? I do this on my machine and sure enough I see the footnotes (hurray!) but not the highlights… Which makes me think the issue is on the Scrivener end. (Though I didn’t follow the other comment about if you open the RTF in Vim you will see all the formatting. Even the highlighting?? Ugh, maybe I’m answering my own question…still in denial.)

Highlights created in Scrivener can definitely be seen in Word. This is the original Scrivener document:

[attachment=1]Screenshot 2021-02-04 at 14.06.01.png[/attachment]

This is the synced version opened in TextEdit:
[attachment=2]Screenshot 2021-02-04 at 14.06.41.png[/attachment]

And this is it opened in Word:
[attachment=0]Screenshot 2021-02-04 at 14.11.40.png[/attachment]

The Vim comment is simply that if you open any RTF file in any purely plain text editor, you’ll see the actual RTF coding. The paragraph you see has this mess lurking out of sight:

\pard\tx360\tx720\tx1440\pardeftab720\fi720\sl288\slmult1\sb120\sa120\pardirnatural\partightenfactor0 \cf2 This is a text file with \highlight3 highlighted text\highlight1 , annotations{{\*\atnid XXXXX}{\*\atnauthor XXXX}\chatn{\*\annotation\pard\plain\f0\fs24\b0\i0\ul0 \cf0 This is annotated\cf2 }}\f0\fs24\b0\i0\ul0 and footnotes{\super\chftn{\*\footnote\pard\plain\s99{\fs24\up0\super\chftn} \f0\fs24\b0\i0\ul0

You can see the codes for \highlight3, \annotation and \footnote buried amongst all the rubble, so Scrivener is producing the right codes: DT3 and TextEdit aren’t picking them up.

I’m not an expert at all, so this is just my guess though.

To follow up on the point I made on our other conversation on the DT3 forum.

If you sync the same document to an external folder with markdown, you get this in a markdown .md file (which I’ve amended to add new footnotes and annotations to).
[attachment=0]Screenshot 2021-02-04 at 14.30.33.png[/attachment]

When this is synced back to Scrivener, you get:

[attachment=1]Screenshot 2021-02-04 at 14.30.57.png[/attachment].

The downsides are:

  1. It only works with INLINE annotations and footnotes (but you can convert between the two sorts (Inline and Inspector) easily with the commands on the Edit > Transformations menu

  2. Highlights are lost. You could use critic markup commands → {== This is a highlight in Critic Markup ==}, which Scrivener won’t show, but with can be compiled later as highlights.

  3. You have to get used to using markdown syntax for bold, italic etc everywhere in the project as there’s not easy conversion in the editor.

It’s frustrating that you can’t just choose RTF or markdown and have a simple inter-app / device workflow that doesn’t involve compromises at some point in the chain, but I think that’s where we are — you have to decide which bits you want to compromise on! For me, markdown has a bit less friction than RTF, but YMMV, of course!

Thanks for going through this! I am only sometimes able to get the same behavior in Word… That is, sometimes the highlighting made in Scriv shows up, and sometimes not. (Weirdly, it likes to show highlights along with annotations.) The behavior seems intermittent regardless of whether I look for the highlighting in Word or TextEdit. The same seems to be the case for changing the color of the text. (I’ll just bracket the whole annotations/comments/footnotes question for now, as that’s a much lower priority for me at present.)

I have much better success on the DT side with RTFs. I can change the color of the text and highlight and it shows up in the RTF document great, as long as I use TextEdit (that is, it looks in TextEdit exactly as it looks in DT. [Behavior seems to get a bit weird with Word. Some highlights show up, others don’t; and when one saves a document in which the highlight isn’t visible in Word, the highlights disappear when opened via TextEdit or DT.])

Nevertheless, Scrivener–>RTF and RTF–>Scrivener still seems like a problem, The behavior seems intermittent – it’s very strange. I was able to get changes in text color to send from Scriv to the RTFs and from the RTFs to appear in Scriv when the Scriv project was very small and simple; but when I added a few distinct documents it got very buggy and stopped syncing text color across platforms. All this makes me think the fault lies with Scrivener.

Maybe I’m dense! Wouldn’t be the first time… It sounds like you suspect it’s just not going to work out, and that Mac TextEdit is going to make it impossible to go back and forth between Scriv and DT on the basis of syncing (from Scriv) and indexing (from DT) to RTF documents. I mean, are you saying you suspect that I’ll always bump up against highlighting getting dropped, text coloring getting dropped, etc.?

And that I should learn Markdown?! So much for Scrivener syncing to external files!?

TextEdit – and Apple’s TextKit – implements a smaller subset of the RTF specification than Scrivener does. Unfortunately, this means that other applications based on TextKit – like DevonThink – may be unable to display some of Scrivener’s formatting.

There are three options:

  • Rather than synchronizing to an External Folder, index (not import) the Scrivener project itself in DevonThink, and open it directly in Scrivener when you need to make changes.

  • Use a plain text format like Markdown instead. Even if the tool you use to edit the file is unable to render a specific piece of markup, the markup commands themselves – being plain text – will still be visible.

  • Use an external editor that more closely parallels Scrivener’s interpretation of the RTF standard. Word is one – Microsoft invented the format, after all – Nisus Writer Pro is another.

Katherine

I’m saying that Scrivener exports RTF files correctly, but some programs aren’t capable of rendering all the features of RTF, so if you use those programs, then round-tripping the documents won’t work for some of the features. Using markdown with External Folder Syncing is one way to get round that limitation – it’s what I do, but it also has compromises. There isn’t a single format which works perfectly in every circumstance, unfortunately (RTF is rubbish on iOS, for example),

So, it’s a bit unfair to say that Scrivener doesn’t do External Folder Syncing — it does, and it works very well, whether you’re using it for RTF or markdown files. The problem you’re having isn’t with Scrivener, it’s with the tool you’re using to view those files when they’re outside Scrivener.

HTH.

Thanks for these thoughts!

Is there some more info somewhere about this? Like, you have me wondering if I could use Scriv only with certain colors, or change colors in certain ways, which would be consistent with TextKit implementation (making the RTF text appear correctly). I obviously don’t know, but it seems like this is one nub of the problem. (The other is that Scriv doesn’t recognize the changes made in RTFs. Which suggests that Scriv’s subset of RTF specification is different, not just larger… But I only know logic. Not computer code. Maybe I’m wrong!)

Unfortunately, that doesn’t serve my purposes. The reason I want DT involved is to be able to use it to modify the text (and have Scrivener recognize the changes made). Since DT doesn’t recognize SCRIV files, this requires indexing synced files. (Or that’s my understanding. Please correct me if I’m wrong.)

That seems to be brookter’s suggestion as well. Coming from the official Scrivener team, this make me even more crestfallen, however!! (I mean isn’t it supposed to sync to external files!! Isn’t this one of the big selling points?!) Scriv says to abandon Scriv because it can’t be synced to external files?! Or am I missing a nuance?

Can I sync to Word documents (or some other relevant format) rather than RTF? The only other options I saw built-in are TXT, FDX, and Fountain. Is there a way of adding additional file type options to the File > Sync > with External Folder configuration?

The nuance you seem to be missing is that the problem is with other tools, not with Scrivener’s external folders feature. If they don’t implement the full RTF standard there is nothing you can do about it – they will drop the RTF features they don’t understand, and not preserve it when they write the files back.

To figure out what functionality is implemented by TextKit, open your exported Scrivener RTF files in TextEdit and see which features made it through and which ones didn’t.

1 Like

As brookter noted, Scrivener is writing the RTF files just fine. So you would need to contact the support team for whatever tool you want to use to read them.

Again, Scrivener is writing the external files just fine. We are not able to control what other software does after that. And certainly suggesting that you export a text format rather than RTF is not the same as suggesting that you abandon Scrivener!

The only available options are those listed. But Microsoft created the RTF format and Word reads and writes it without difficulty.

Katherine

It’s wrong to say that Scrivener doesn’t allow External Folder syncing — of course it does, for both RTF and markdown files.

The problem is that if you open the resulting RTF files in TextKit and then edit and save the file, it will strip out the highlights etc. That’s a limitation with TextKit, not with Scrivener, which you should really take up with Apple, because it’s not under the Scrivener developer’s control to change it. You need to use a fully capable RTF editor if you want to stick with RTF syncing with highlights / footnotes etc.

One answer for you, I think, is to index the externally synced in DT3, where you’ll be able to view the basic text. If you want to see and amend the full version, use Data > Open with… > Microsoft Word (or Libre Office or any other more capable RTF editor). Make the changes there and save it in Word. This will save the amended version in DT3 with the full features intact (though you won’t see them in DT3), and when you sync back to Scrivener, all the highlights and footnotes will be there.

As usual, test this with dummy data first…

HTH.

Was this resolved?
I’m considering DevonThink vs Notebooks app to Sync with External Folder for the webdav server options.

There was never anything for us to resolve. In a nutshell, this thread was a discussion regarding the use of incomplete rich text editors to edit Scrivener’s RTF files, and then wondering why, after these editors permanently damaged the files, Scrivener didn’t somehow magically resurrect the formatting they had deleted.

That all said, isn’t Notebooks a Markdown-based program? If so, this entire thread isn’t really relevant, particularly if you intend to use DT3’s Markdown features in conjunction with Scrivener’s sync folder tool. If you’re writing using Markdown in and out of Scrivener, then all compatibility issues vanish, naturally, since formatting is the same as loading any other kind of text.

Now what you do have to be wary of are Scrivener-based features that generate Markdown when you compile. Inline footnotes and annotations can be preserved round-trip with the optional setting in the Sharing: Sync preference tab, with Convert text inside (( )) and {{ }} to inline notes when syncing plain text files. But stuff like styles and inline images will not. You will thus have a better time, if you intend to use a heavy sync folder workflow, using native Markdown syntax more than you might otherwise.

I was unclear, sorry. I didn’t mean to suggest Scrivener had something to resolve. To put it better, I was wondering whether anything had changed or if it is something I might need to beware of. Thanks for summing up the issue, though. I think I understand it better now, and so I can probably check on test projects.

It handles formatted text (RTF? RTFD?) also.
I can and have saved test projects in its folders. (Notebooks basically sees the project as any other folder with files, and can display and edit the text files. However, it doesn’t comprehend their connections (Binder order, etc.) any more than Finder does.)

Yeah, I suspect that is always going to be a concern, and that in general any tool less than a full-blown word processor is going to be something you need to test before using on important data. I’d say most “bucket” style programs are going to be depending upon basic RTF toolkit like the stock macOS programming tools. Scrivener would be in the same boat as well, save for the fact that we’ve put years into pushing the stock engine further.

As for testing, I like to use the interactive tutorial. It has a good mix of features in use in the text, and lot of content, and can be reset to default if you mess it up.

On Notebooks, Okay! I must have been thinking of some other tool in that case. It could well be RTFD if it supports images in the text. The stock text engine does not support images in RTF (that’s one of those things we had to add).

Oof, I’d be very careful with it in that capacity then. It sounds to me like DT3 might have the upper-hand on that matter alone, as it treats Scrivener projects properly, and as the Finder would. It may be perfectly safe in theory, but in a program like that, that allows free searching of resources in its archive and so on, it sounds like it would be very easy to damage your projects on accident.

1 Like