Retrieves the paragraph formatting with style name

All the

kindly help me how to extract the name of definition with example.txt formatting:

FOR EXAMPLE:

Name of the style: "Body".

Font = "15".

head = "" 18"" "

Aligh = "Left".

etc...

Concerning

Hurix

Change by Dave Saunders: something prevents the work answer button. I hope that this edition will reactivate it.

Hi Hurix,

Welcome.

Please indicate the question as answered

Add the properties you need by following the instructions in the 3rd line.

Trevor

// Export Specified Details of Documents ParagraphStyles By Trevor
// http://forums.adobe.com/thread/1445961?tstart=0
exportParagraphStyleDetails ("appliedFont pointSize spaceAfter spaceBefore"); // add property names separated by a space - The Style Name is included automatically
// see http://jongware.mit.edu/idcs6js/pc_ParagraphStyle.html for a list of properties you can add

function exportParagraphStyleDetails (props /* A string list of the desired properties */) {
    doc = app.activeDocument,
    ps = doc.paragraphStyles.everyItem().getElements().slice(0),
    l = ps.length,
    c = 0;
    props = props.replace(/\s+/g, " ").split(" ");
    pl = props.length;
        var styleDetails = [];
    while (l--) {
        var  myStyle = ps[l];
        styleDetails[c++] = "******************************************************************\rParagraph Style Name: " + myStyle.name + "\r******************************************************************"
        for (var n = 0; n < pl; n++) {
            styleDetails[c] = props[n] + ": " + myStyle[props[n]].toString();
            if (myStyle[props[n]].hasOwnProperty ("name")) styleDetails[c] = styleDetails[c].replace (/:.+/, ".name: " + myStyle[props[n]].name);
            c++;
        }
    styleDetails[c++] = "\r";
    }

    temp = new File (Folder (Folder.temp) + "/" + doc.name + " Paragraph Style Properties " + ("" + new Date).replace(/:/g,"\xB7").replace(/G\S+$/,"")+ ".txt");
    temp.encoding = "UTF-8";
    temp.lineFeed = ($.os[0]=="M") ? "Macintosh" :" Windows";
    temp.open('w');
    temp.write("\uFEFF" + styleDetails.join("\r"));
    temp.close();
    $.sleep(300);
    temp.execute();
}

Tags: InDesign

Similar Questions

  • CS3: need script to replace spaces with underscores in the paragraph and character style names

    Help! I am very new to scripting.

    I managed to find and tweak existing javascripts to search through all my paragraph styles to disable hyphenation and off balance the jagged lines, but I need help with this one.

    I work on Mac OS 10.4.11 using Indesign CS3.

    I need a script that will search all my paragraph and character styles in my open Active document and replace spaces by underscores.

    Can someone help me with this? It would be greatly appreciated!

    1. I don't know, but I think you can use all the regular GREP inside this function codes. Do not use the quotation marks around of the expression, use slashes! (Why? Just a curiosity of Javascript... maybe a hack that goes back to the gray mist of JS development...)

    This work should - but rather the code above, this is not tested:

    .. Replace (/ [-\ / ()-. _] + / g. '_');

    The GOLD group inbetween the brackets contain all the characters you want to replace with an underscore: the hyphen (this has to be the first character in the group, else it will be interpreted as a range of characters from each side!), space, slash (this one is 'special' inside the function replace JavaScript, so I think he needs to escape with a backslash)! in parentheses, a period (not sure if it should escape - into ordinary GREP, it's the wildcard character for any character, but maybe he loses his magic within a group of GOLD) and finally... the underscore character. Why?

    Well, this replacement string comes with a free bonus. Note the sign after the installment of GOLD +. This means that a whole sequence of these characters is replaced by a simple underscore: "it's / a - / test" will become "This_is_a_test". Adding the underscore line itself to the string of research means that it will also find the whole chain 'space space (stroke underscore)' in 'This style (_)' and, oh magic!, replace it immediately with a single underscore.

    Just FYI, the tiny "g" after the closing slash is abbreviation of 'global', i.e. at the global level, replacing in this string. replace the default values for a replacement only (why? see above...), and adding the 'g' ensures he keeps replacing until it is not find matches more.

    2 see point 1.

    3. uh, yes it's true, but you will need to check very carefully if nothing inside one of these basic models is substituted. You can apply a base style and add substitutions to make look like a subtitle, but that isn't making it a. And to the next paragraph, you can apply a base style and add substitutions to make it look like a paragraph of plain text (etc.). It's a signature of witness to bad formatting...

  • Cannot delete the paragraph format

    I created a template with titre3 instead of Head3 - same name just different properties. I deleted all the paragraph formats, imported the new model, updated headers. Head3 remains persistent in the document. I don't then uncheck the box for NextParagraph so that there is no required following paragraph. It just removes himself from the period of document. I tried to remove it from the catalog and it does not remove the format. But this is still in the document. Any thoughts?

    I noticed something like this in the past as well. I don't know what caused it.

    My problem was:

    • Save as MIF.
    • Open the MIF with a text editor.
    • Search the text in the paragraph of the problem.
    • Check if it has the attribute set to Yes flocked. If Yes, change the No.
    • Save the MIF file.
    • Open it in FrameMaker. Check, if you can change the format of your problem paragraph subsection.
  • Changes to the paragraph formats are not anything related to all the

    Hello:

    The recent post from Dennis ("phiguru"?) touched on my problem, but mine is more simple.

    I stupidly changed text one together heading to red to remind me that basically contained revisions are needed, and that the old "mat" is not for publication. (I was in a hurry and were recalled from the conditional tags, of course. (Duh).

    Now, I'm trying to restore the paragraph formats affected in their original fonts colors. (Fortunately, my stupid first color change appears not to have affected the same paragraph formats in other topics.)

    These images seemed terrible when I posted this a moment ago, thank God by clicking on it opens a larger and clearer version.

    top of RH8 Styles and Formatting pod.PNG

    Using the editing tool - the icon of the pencil in the Styles and pod-shaped, I am trying to change the color of the font. Seems pretty simple, but just in case:

    Changing font color in main Styles window.jpg

    The line "tile Texture Mapping... "is one of the guilty parties heading 3 that refuses to change. I have change the color black, light underscore, click OK, and get nothing.

    I don't expect anything really of the 20th century to occur, such as the change applied universally, but when you tap on a new blank line which has been designated the heading 3, the new text is still red.

    Go to an existing line of heading 3 reddened and re - select the style desired apply a menu Style drop-down at the top left only annoys me that same infuriating business cited by Dennis:

    Heading 3 refusing to change.jpg

    You want to:

    1. update the Franck to reflect recent changes?

    2. reapply the setting in the form style to the selection?

    Any advice, anyone? I know I'm probably missing something obvious, but he continues to elude me, and my line of work, life and time are running ever forward.

    Thank you.

    Hi Lew

    Have you tried to do a right click in the line that is colorful and choosing "delete attribute"?

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7, 8 or 9 in the day!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

  • second line to the paragraph indented using styles?

    made anyone know if its possible in Indesign to do the second line of the paragraph indented using styles?

    I'm working on a book and I put the first word of each paragraph to be slightly larger and a different font to the rest of the paragraph. I did it using a style nested with the paragraph style. I also want to do what the second line is indented from the amount of space to the first word on the first line. This isn't problem doing this maunally but I want to find a way to define a style for this so that I can compose the book like this.

    any help is appreciated!

    Looks like you're talking to "drop words".

    On this page: http://in-tools.com/plugin.php?p=24

    In addition to the commercial product, there is a (simpler) free script on the page to create using drop caps.

    Substances

  • LOBs and how to retrieve the record inserted with EMPTY_BLOb()

    Hi guys


    How to retrieve the records inserted with EMPTY_BLOb() instead of NULL value.


    Best greetings
    A.G.

    There must be a better way, but these work:

    SELECT... from tableX where length (lob_column) = 0;
    SELECT... from tableX where dbms_lob.getlength (lob_column) = 0;

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    http://www.jlcomp.demon.co.UK

    "All experts it is a equal and opposite expert."
    Clarke

  • Help about the paragraph and character styles scriptting

    Hi all

    I'm working on a project with many files, I change change on all styles of paragraph with multiple processes

    for ex, change the font for all styles of paragraph on all open documents

              var docs = app.documents;  
                     
              for (var d = docs.length-1; d >= 0; d--) {  
                      var doc=docs[d]; 
                      
    var pstyles = doc.allParagraphStyles;  
    for (var a = 1; a < pstyles.length; a++) {    
                              if (pstyles[a].appliedFont.name=="Arial\tBold")    
                                   pstyles[a].appliedFont = "Arial\tBold Italic";    
                         }
                     }
    

    but I found a text inside frames (the locked position) my find/replace a not to apply to this topic

    so, is there anyway to do this process for all chassis from locked position?

    or at least make the lock of the United Nations to all open documents, but I can only do this for the active doc

    app.activeDocument.pageItems.everyItem (.locked = false)

    Another thing, I tried to change it on all styles of character on the files and I wrote the code with my little knowledge script but it seems does not, any hint please?

              var docs = app.documents;  
                     
              for (var d = docs.length-1; d >= 0; d--) {  
                      var doc=docs[d]; 
                      
    var cstyles = doc.allCharacterStyles;  
    for (var a = 1; a < cstyles.length; a++) {    
                              if (cstyles[a].appliedFont.name=="Arial\tBold")    
                                   cstyles[a].appliedFont = "Arial\tBold Italic";  
                         }
    }
             }  
    

    Thanks in advance

    Maybe your consolidated text block... Try this

    docs var = app.documents.

    for (var docs.length - 1; d = d > = 0; d-) {}

    var doc = docs [d];

    var pgItems = doc.allPageItems;

    for (var a = 0;< pgitems.length;="" a++)="">

    If (pgItems [a] instanceof TextFrame) {}

    While (doc.groups.length > 0)

    doc.groups.everyItem () .ungroup ();

    pgItems [a] .locked = false;      }

    }

    }

  • Reapply the paragraph format

    Hi all

    Once more, it seems that I have "put the cart before the horse" do the following:

    -In the current document, I have a text selection and want to reapply bmp format from the catalog to the current portfolio.

    -Take the catalog properties and apply to current TFP do nothing.

    function ReApplyPgfFormat (oDoc, tRange) {
    // oDoc        current document
    // tRange      current text range
      var currPgf = tRange.beg.obj;
      var pgfFormat = currPgf.Name;                   // most likely Footnote, but not guaranteed
      var pgfFmt = oDoc.GetNamedPgfFmt(pgfFormat);    
      var pgfProps = pgfFmt.GetProps();               // from catalogue
      currPgf.SetProps(pgfProps);                     // re-apply
    alert ("Reformatting done?");                     // re-apply did not happen
    }
    

    I was looking in the documentation (fdk reference, object reference) in both directions - but do not have the slightest idea.

    This is the final solution to my problem which is not just re - apply the current format ¶:

    • Although the paste operation inserts something with different format, the information field lower left does not indicate the number-one changed format. There is no * after the format name.
    • After inserting (replacing) the temp. quote by a record of biblographic number indicates the sizes and mixed fonts. Only a part of the ¶ is selected (the part where was the quote found Temp.).

    What I ned to do in my case is the following:

    • Get only font family and size of the font of the catalogue
    • Only apply these properties to the completely selected ¶
    function ReApplyFontAndSize (oDoc, tRange) {
      oDoc.TextSelection = tRange;                    // current selection is only part of ¶
      var currPgf = oDoc.TextSelection.beg.obj;
      var pgfFmt = 0, propsPgf;
      pgfFmt = oDoc.GetNamedPgfFmt(currPgf.Name);    // get properties from catalogue  
    
      if (!pgfFmt.ObjectValid()) {                   // pgf fmt is not in catalogue
        return;
      }
      propsPgf = AllocatePropVals(2);                // for font-family and -size
      propsCatlg = pgfFmt.GetProps();                // get properties from catalogue
      j =  GetPropIndex(propsCatlg, Constants.FP_FontFamily);
      propsPgf[0] = propsCatlg [j];
      j =  GetPropIndex(propsCatlg, Constants.FP_FontSize);
      propsPgf[1] = propsCatlg [j]; 
    
      tRange.beg.obj = currPgf;                      // select the whole paragraph
      tRange.beg.offset = 0;
      tRange.end.obj = currPgf;
      tRange.end.offset = Constants.FV_OBJ_END_OFFSET;
      oDoc.TextSelection = tRange;
      oDoc.SetTextProps (tRange, propsPgf);          // apply font family and size
    } // --- end ReApplyFontAndSize
    

    This can be streamlined - but it does what it should.

  • Change the paragraph by Script Style

    Hello!

    I don't know if this is the right place for this question but since its related to scripting, I'll ask here.

    Is it possible to change the paragraph Styles InDesign with a Script?

    For example, I need set Format1 hyphenation to specific values properties without changing the other properties. For Format2, I need to change other properties such as the Glph scaling.

    Like I need to do this with a lot of files, I suppose that the best way to archive it could be a script.

    Is there someone who had an idea on how to do it?

    Thanks in advance

    Thomas

    You're right, this can be done very effectively with a (relatively) simple script. This is an excerpt from a longer script of mine which covers a changing choice of design of end minutes documents open at once:

    for (i=0; i
    

    For a list of all paragraph properties that you can change, look in the ESTK help or (in a more user-friendly way to read and search) in an online version of these same data: InDesign ExtendScript API (10.0).

  • [JS] Copy or move the paragraph and character style style

    Hello
    I try to transfer paragraphs a the document to a block a second document but I have hugs the style of paragraph et style character applied.
    I use this command line:


    o.leBlocLegendes.contents = o.leBlocLegendes.contents + leDocument.stories.firstItem().paragraphs[leConteurPara].contents;
    
    


    How do I do not lose anything?

    Thank you


    Original message

    Hello

    I am trying to transfer of the paragraphs in a document to a block of a second document but I loses all the style of paragraph and style of applied character.

    Plug-in this command line:

    o.leBlocLegendes.contents = o.leBlocLegendes.contents + leDocument.stories.firstItem().paragraphs[leConteurPara].contents;
    

    Comment do pay nothing lose?

    Thank you

    Hi Liphou,

    .silence is indeed a property of type string only disregardingly of styles, anchor frames and other animals.

    You prefer the use of object methods and duplicate stories. However styles can be substituted with the target document. If you can load styles before the duplication of the text.

    var main = function() {
        var doc, st, tempDoc, f, tf;
        if (!app.documents.length
            || app.selection.length!=1
            || !app.selection[0].properties.parentStory) {
            alert("You need to select text or text frame");
            return;
        }
    
        doc = app.activeDocument;
    
        if ( !doc.properties.fullName ) {
            alert("Please save file first !");
            return;
        }
    
        st = app.selection[0].parentStory;
        f = File ( doc.fullName );
        tempDoc = app.documents.add();
        tempDoc. importStyles ( ImportFormat.TEXT_STYLES_FORMAT, f, GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE );
    
        tf = tempDoc.textFrames.add();
        st.duplicate(LocationOptions.AT_BEGINNING, tf.insertionPoints[0]);
        tf.fit(FitOptions.FRAME_TO_CONTENT);
    
    }
    
    main();
    

    HTH,

    Loïc

    www.ozalto.com

  • Adding anchors based on the paragraph in Javascript Style

    I've read over the documentation for days and just trying to understand how to add an anchor point to a paragraph in javascript style. That's what I have so far:

    main() {} function

    myDoc var = app.activeDocument;

    var num_pars = myDoc.stories [0].paragraphs.length;

    for (i = 0; i < num_pars; i ++) {}

    If (myDoc.stories [0].paragraphs.item (i).appliedParagraphStyle.name == "Title") {}

    aText = app.activeDocument.stories [0] .paragraphs [0];

    aDest = app.activeDocument.hyperlinkTextDestinations.add(aText,{name:aText.contents});)

    }

    }

    }

    What I am doing wrong?

    I thought about it! Thanks for your help! Here is the final code for anyone who could find that I couldn't find before:

    main() {} function

    myDoc var = app.activeDocument;

    var anchorsAddedCnt = 0;

    app.findGrepPreferences.appliedParagraphStyle = "Title";

    app.findGrepPreferences.findWhat = "^."

    var myTitleResult = myDoc.findGrep ();

    for (i = 0; i< mytitleresult.length;="" i++="" )="">

    var anchor = myDoc.hyperlinkTextDestinations.add (myTitleResult [i]);

    Anchor.Name = "A00.01.00";

    Anchor.label = "A00.01.00";

    anchorsAddedCnt += 1;

    }

    Alert ("Added" + anchorsAddedCnt + "anchors");

    $.writeln ("Added" + anchorsAddedCnt + "anchors");

    }

    main();

  • Where to publish the white paper with MY NAME on it

    White papers NOR does not have the name of the author listed on it, as the link.  So any suggestions on what reputable labview site I publish white paper with my name on the paper?                                    http://digital.NI.com/public.nsf/allkb/7F95D43D3F50FCAC8625710E000068E1

    The link you provided is just a standard KB article, so we don't know what the author's name, you are referring.

    You consider not to be a 'reputable' site of LabVIEW?

    You may be looking for the section of the documents of the Community of NI Developer Zone?

  • Clonning an ASM database on the same server with different names of sid.

    Hello people!

    I tried to clone an existing database on the same host with a different name with no luck.

    I tried what 415579,1 reccomends, but, when I reached the RESTORE CONTROLFILE from clause that it fails since this process the old and the new database must be the same. I don't want that. I want a separate copy, not a database of pending. There are other people in the company who will use this database, and I just want to replicate it.

    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-03002: failure to modify the order db at 26/05/2009 14:51:15
    ORA-01103: the name "OLD_DB_NAME" in the control of the database file is not "NEW_DB_NAME".

    I want to just clone a database with a different name, in the same way we used to do with ALTER DATBASE BACKUP CONTROLFILE to TRACE-> COPY DB_FILES-> RECREATING CONTROLFILES WITH a DIFFERENT NAME DATABASE.

    Exp/imp it's a possible solution, but I wonder if it is just another way to clone an existing database in the same node with a different namedo with RMAN? Just as we used to with BACKUP CONTROLFILE to TRACE-> DBF_FILES-> RECREATING CONTROLFILES WITH DB NAME DIFFERENT COPY.

    It's the links I tried to follow without success.

    http://www.Oracle.com/technology/deploy/availability/PDF/asm_cloning.PDF
    Duplicate by RMAN 10 g

    and many others...

    Thanks for your help.
    Alex.

    You'll need an auxiliary copy if you restore the database to a different name.
    Take a look at the following note:
    http://jhdba.WordPress.com/2009/04/02/cloning-a-database-ASM-to-ASM/

  • Control the vertical text with styles (or similar) rationale

    I'm on a 450-page document which is divided into 20 separate chapters. Each chapter is divided into sections and each section begins with a title that includes a page break. This means that some end of sections with a few paragraphs of text on a page is empty.

    Where pages are close to full text, I like to get the vertical justification to "justify" so that the leader/line spacing is adjusted to the top and bottom lines in uniform positions.

    Is it possible to do this automatically and without having to manually turn the parameter "align: top ' on pages without text? (and therefore, in which the setting seems ridiculous?)

    (I'm working to be able to make changes to the content of re-importation of text for future versions without having to manually change the settings on each image whenever, if there are major changes in the length of the text, etc.).

    Thanks if you can help!

    Here is a review of your options of native InDesign (which boil down to the use of the sequence and rotating Options on vertical Justification).

    Substances wrote a plugin "Proper vertical Justification" which is very nice. I've never used and am not connected with in - Tools.com (in addition to having purchased their products).

    (I'm working to be able to make changes to the content of re-importation of text for future versions without having to manually change the settings on each image whenever, if there are major changes in the length of the text, etc.).

    I deal with "major changes in the length of the text" on a daily basis, due to the expansion of text or compression in the translation. The best way to do it, in my experience, is to style all your text with an object Style frames and wisely use keep Options. At the very least, make two object Styles - one for 'body' of the text, and then one for 'last page' text alignment at the top. In this way, you can simply insert/delete pages in the middle of your chapter, and you will not need to access text block options at all.

  • Transmitting the internal format with POF

    I would like to put a bunch of objects in internal format on the client side, put them inside a processor of entry and then insert them under the name 'directly' in a backingmap on the server side.

    My question is that the most effective (target =) way to send internal data with POF (since the data are already in POF serialized format is should be quick).

    / Magnus

    Shouldn't be the last line of this code...

    binaryEntry.updateBinaryValue(binary);
    

Maybe you are looking for