Import Styles from Nisus or Word

Does anyone know of an easy way to batch import styles from Nisus Writer Pro, or for that matter from Word?

I could go through them individually and set them up in Scriv but it would be easier if there were some way of importing them all as a batch. I’m wondering if someone may have created a Nisus Macro and/or an AppleScript for doing it.

Formatting yes but styles, no.

As far as I know the best you can do is make a Word doc which exhibits paragraphs of all the styles you want, then drop that into your Scriv project. Now step through those paragraphs and Define Style From Selection. At least that’s how I would think to do it.

1 Like

One trick to be aware of is that if an imported .docx or .rtf file has styles in it that match the names of styles in your project, they will remain styled on import. So if you first go through the list of used styles in your document, and create matching style names (no need to bother much with formatting yet, just get the names right), then when you import the document it will link up with the project’s styles—but importantly, without changing their formatting (you can do that, with the Documents ▸ Convert ▸ Text to Default Formatting command, but I suspect that’s the opposite of what you really want). You can then do as @gr suggests, and use each paragraph or character span to update the formatting. Easiest way to do that is to load the Styles panel and just go through each line in the imported document, right-clicking on the highlighted style in the panel, and redefining it.

Once you’ve done that, you might want to set this project aside as a stylesheet source. Basically don’t use it for anything, but in future projects where you want to use these styles, use the Format ▸ Styles ▸ Import Styles... command and target this project you’ve prepared. You can also create a starter project as a template, and opt to include the stylesheet in the template. And for cases where you want this style always used (save for in templates that have their own stylesheet), go into the Editing: Formatting preference pane, and click the button at the bottom to set the current project’s styles as the global default.

On the whole though, for getting style info between software, the approach of creating a “reference document” that has all of those styles designed and in use is the best most compatible way of preserving them and transferring settings between software.

1 Like

Thanks to all for the replies.

Basically what I’m trying to do is to set up a template with the styles that will be used in the final doc, which will be either Nisus .rtf or Word .docx. Do this prior to work on the project and it should all work through without too much faff.

Taking on board the comments from AmberV and GR, I’ll set up a doc in Nisus with paragraphs corresponding to the styles and then import that to a blank template setting up styles using “Define Style From Selection”. Since I’m starting with a blank template I wonder if it may be best to remove any current styles in the blank Scriv template before importing the Nisus doc. That should mean that all style names will in future correspond with those in a final Word or Nisus doc.

In a sense, yes, if the intention is for the styles in the editor look the same all the way through to the final word processing software, then it would in fact be better to avoid any of the stock styles or their names. This is because most of the built-in compile formats will adjust the appearance of these styles to match the output settings. For example, you wouldn’t want “Block Quote” to come out in 16pt Helvetica when compiling to Manuscript Times 12pt.

But you can of course also just open up any compile Format and strip out all of its style rules if the intention is to pass things through, or start from the “Default” format rather than one of the more opinionated ones.

In short, Scrivener’s styles are different from word processing styles because they are designed to allow for a “front end” use, in the main editor, that has nothing to do with the output formatting. Doing things as I described above would kind of opt out of that approach, but it’s always there if you want it as well.

3 posts were split to a new topic: Disable superscripted ordinals (nd, th, st)

If I understand correctly, importing an RTF document means that one has to recreate the original styles, and then reapply them to every paragraph and text span?

Is there some sort of automation to help with (very) long documents?

Paolo

Not really true, Paolo.

AmberV’s post above answers your question:

3 Likes

Oh, I missed this part. I’ll try it immediately, thank you!

Paolo

I tried, but with no success :frowning:

What I did was defining paragraph and character styles from the existing text. The names I used where the same as in the RTF file.

I then imported the same text with the File > Import > Import and Split command. Alas, no style was applied, and the file was not split into sections.

Paolo

What I noticed, by trying to import (without splitting) an RTF file generated by InDesign CS6, is that Scrivener applied the initial paragraph style to all the subsequent text. The original formatting is preserved, but the assigned styles are flattened to the first one.

I also tried removing all formatting but not styles from Nisus Writer, and then importing again in Scrivener, but the same did happen. I know that I didn’t use any free formatting in the original ID document, but this was a measure of safety for cleaning anything extraneous.

EDIT 2022-07-24:

I did some other tests, all with no success. A couple of them consisted in copying & pasting from Nisus Writer Pro and LibreOffice 7. In the first case, text attributes were applied, but no styles were applied. In the second one, the pasted text was flattened out and stripped out of all the styles and attributes.

The target Scrivener document includes styles with the same name as the source RTF file, but they are simply ignored.

I also tried with the simplest of documents, with an RTF file (made in Nisus Writer) only including a few lines of text and a few paragraph styles. The first lines had the correct paragraph style applied. The subsequent ones had No Style applied.

Furthermore, I noticed that if I have two paragraphs of Body text, the Body paragraph style is only applied to the first one, but not to the subsequent ones. New lines, in the original text, are created by pressing the Return key, therefore entering a paragraph break.

Being able to import styles is very important for me, or transferring huge projects into Scrivener would be impossible. I would be very interested into some other hints.

Paolo

I went one step forward in importing styles.

Here is what I did:

  1. Copied all the text from an InDesign CS6 document, and pasted it into a new Nisus Writer Pro 3.3 document.

  2. Saved the RTF file from Nisus.

  3. Imported it into a Scrivener project, where matching styles where already present.

It worked for most of the paragraphs, that had the correct style applied. I would say that about three quarter of the paragraphs in a very long text have the style applied. The others are ‘No Style’.

As far as I can see, character styles are ignored. None of the ones I tried have survived import. I don’t remember if Scrivener allows for selecting all the text in the document with the same text format (but at the moment I can’t find it). This would let me apply the character styles en masse.

Import and Split based on document structure is not working. But maybe I should make the structure more obvious to Scrivener (maybe by using the H1-H6 paragraph style names?).

Paolo

@ptram : It worked for most of the paragraphs, that had the correct style applied. I would say that about three quarter of the paragraphs in a very long text have the style applied. The others are ‘No Style’.

I’ve never seen that happen, but most of my tests have been done with fairly simple samples. Some advice on how to see this happen reliably would be helpful.

@ptram : As far as I can see, character styles are ignored. None of the ones I tried have survived import. I don’t remember if Scrivener allows for selecting all the text in the document with the same text format (but at the moment I can’t find it). This would let me apply the character styles en masse.

Yes, this is the result I get as well. I am not sure when that broke, but it doesn’t work with even the stock styles in a very basic round-trip export/import from Scrivener itself (so not even factoring other word processor variances).

As for selection: Edit ▸ Select ▸ Select Similar Formatting

Import and Split based on document structure is not working. But maybe I should make the structure more obvious to Scrivener (maybe by using the H1-H6 paragraph style names?).

It definitely needs to have a proper hierarchical outline structure in the stylesheet. If Nisus doesn’t have a navigation table, or if it is incomplete, then it won’t import correctly. I don’t know if it needs to use “Heading 1” nomenclature precisely for import, but if it doesn’t work initially, try following that naming scheme. Scrivener does need that naming scheme for export/compile, in order to build a proper outline.

1 Like

After some analysis from @AmberV, I can confirm that paragraph style conversion works fine in Scrivener, even with very long RTF files. It is just that one has to be careful not to leave out of the project any style.

Paolo

Hi @ptram. I haven’t been contributing as I can’t remember ever having a problem with this.

But just a thought: there is an NWP macro which removes unused styles from the document. If you ran that before importing into Scriv, it would be easy to check what styles you need to have set up in your Scriv project before importing.

Mark

1 Like

Further to that, I can’t remember whether it is one of the default macros, but just in case it’s not and you’re interested, here it is:

Remove Unused Styles.nwm.zip (2.6 KB)

:smile:

Mark

1 Like

No, it isn’t. So, thank you for that!

Paolo

1 Like

Glad to be of help. I use it when I have to import a DOCX into NWP. Word typically creates dozens of styles the majority of which are not applied to the text in most documents, so clearing them out with the macro makes the styles palette useable!

:smile:

Mark

1 Like

Hi,

Apologies for not attaching this post to an existing thread on the same issue, but I can no longer find it.

I tried importing an RTF file with Scrivener Mac v3.3.1, and character styles still weren’t imported.

The RTF file was originally created by InDesign CS6, resaved with Nisus Writer Pro, and then imported into a Scrivener project that already had the desired character styles.

Text formatting is perfectly fine, but character styles are not applied, as they are in the original RTF file in Nisus.

Paolo