Skip to main content
dublove
Legend
July 23, 2026
Question

How to represent 'basic style'? Is it possible to directly copy the 'none' style?

  • July 23, 2026
  • 3 replies
  • 25 views

Hi everyone~

The 'none' in cell style and object style seems to indicate:

noneCellSty = app.documents[0].cellStyles.itemByName('[None]');
noneCellSty.duplicate();

I tried to copy the None style directly, but it is failed. Perhaps I have to create a new 'trueOne' style based on [None] to control it.


another question:

how to represent 'basic paragraph style' and 'no paragraph style'?
Like this:

noneBasePar = app.documents[0].paragraphStyles.itemByName('[None]');

And ,How to express the 'basic paragraph'?

Thank you.

 

    3 replies

    rob day
    Community Expert
    Community Expert
    July 23, 2026

    Based on the 'basic paragraph', it must be like this: basedOn:"[Basic Paragraph]"

     

    There are the 2 defaults, [Basic Paragraph] and [No Paragraph Style], and they are not the same.

     

    The root read only [No Paragraph Style] is the same for all documents. All documents also have a [Basic Paragraph], but it can be defined differently in any document, which creates potential problems when cutting and pasting between documents with different [Basic Paragraph] definitions.

     

    I usually use [No Paragraph Style] for Based On when creating my document’s default style and give it a unique name—something like ProjectNameDefault.

     

     

    rob day
    Community Expert
    Community Expert
    July 23, 2026

    Also, root styles can’t be edited or copied, but you can add a new style that is based on the root, which effectively creates an editable document root style.

     

    Here’s a root [No Paragraph Style] copy with an adjusted font and point size:

     

    // a copy of the root paragraph style with a customized applied font, and pont size
    var s = app.documents[0].paragraphStyles.add({name:"MyDefault", basedOn:"[No Paragraph Style]", appliedFont: "Vista Sans OTCE", pointSize:10})

     

     

    rob day
    Community Expert
    Community Expert
    July 23, 2026

    Hi ​@dublove , [None] is a root style and is read only—you can get more info with this:

     

    try {
    var noneCellSty = app.documents[0].cellStyles.itemByName('[None]');
    noneCellSty.duplicate();
    }catch(e) {
    alert(e)
    }

     

     

    dublove
    dubloveAuthor
    Legend
    July 23, 2026

    @rob day 

    Thank you very much, I'll give it a try.

    Based on the 'basic paragraph', it must be like this:
    basedOn:"[Basic Paragraph]"
    The English version is really 'what you see is what you get', it's really good.