Need to sort out my paragraphStyleGroup

Hi all

See my script which does not sort below paragraph style. But I need to sort my paragraph styles as well as my group of paragraph style styles.

Here's the code to sort the paragraph styles:

myParStyles_Sort (app.activeDocument);
function myParStyles_Sort (doc)
{
var string_array = sort_par_names (doc);
for (var i = 0; i < string_array.length; i ++)
() doc.paragraphStyles.item ([i] string_array) .move
LocationOptions.after, doc.paragraphStyles [i + 2])
}

function sort_par_names (doc)
{
var table = doc.paragraphStyles.everyItem () .name;
Array.Shift (); Array.Shift ();
array.sort return (myCaseInsensitive);
}
function myCaseInsensitive (a, b)
{
return a.toLowerCase () > b.toLowerCase)
}

Some current examples of style sheets

Picture 13.png

Need to change this format as indesign made with sort by name option.

Picture 14.png

Thanks in advance for your time and support.

Chang

You can use a recursion, like this:

myParStyles_Sort (app.activeDocument);
function myParStyles_Sort (doc){
    var myItem;
    var myLastItem;
    var string_array = sort_par_names (doc);
    for (var i = 0; i < string_array.length; i++){
        myItem = doc.paragraphStyles.item (string_array[i]);
        if (myItem.hasOwnProperty("paragraphStyles")){
            myParStyles_Sort(myItem);
        }
        if (i == 0){
            myItem.move (LocationOptions.AT_BEGINNING);
        } else {
            myItem.move (LocationOptions.AFTER, myLastItem);
        }
        myLastItem = myItem;
    }
}

function sort_par_names (doc){
    var firstIndex = doc instanceof Document? 2: 0;
    var myArray = doc.paragraphStyles.everyItem().name.slice(firstIndex);
    myArray = myArray.concat(doc.paragraphStyleGroups.everyItem().name);
    return myArray.sort ();
}

Tags: InDesign

Similar Questions

  • Have 5 licenses under my account, but I'm able to download only 2. What can be done to get this sorted out?

    Have 5 licenses under my account, but I'm able to download only 2. What can be done to get this sorted out?

    To the link below, click on the still need help? option in the blue box below and choose the option to chat or by phone...

    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If it fails to connect, try to use another browser.

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html ( http://adobe.ly/19llvMN )

  • My account has been blocked, I forgot security question answers. Could someone help me to sort out how to access my account security question unanswered!

    My account has been blocked, I forgot security question answers. Could someone help me to sort out how to access my account security question unanswered!

    Hello

    You must work with the support of Yahoo and their forums.

    Yahoo help and support
    http://help.Yahoo.com/l/us/Yahoo/helpcentral/

    Yahoo products and services
    http://everything.Yahoo.com/us/

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Need help with outer join

    Hello

    I have a requirement in which I need to get data from a third table where a date of the third table is higher than a date in the second array.

    Ex:

    SELECT t1.column1, t3.column2
    FROM t1, t2, t3
    WHERE t1.id = t2.foreign_id
    AND t1.id ( + ) = t3.foreign_id
    AND t3.some_date_column > t2.another_date_column
    
    

    However, using the query above returns no results if the date condition is not met. I still need to show t1.column1 and a null t3.column2.

    How should I do this?

    Thank you

    Allen

    Edit: Added information about the requirement.

    Hi Allen

    1. SELECT t1.column1, t3.column2
    2. T1, t2, t3
    3. WHERE t1.id = t2.foreign_id
    4. AND t1.id = t3.foreign_id (+)
    5. AND t3.some_date_column (+) > t2.another_date_column

    I guess that this t1.column1 must not be null. Or am I wrong? The + sign must be placed on the side where draws are accepted. You must repeat it for each condition on the table.

    Alternativlely you can use the LEFT OUT JOIN syntax. If the two columns are allowed null you need a FULL OUTER JOIN.

    BTW: The join to t2 is not required if a refefernce constraint forced.

  • I need to read Out Loud repair information.

    I need to read Out Loud repair information.

    I need to read Out Loud repair information.

  • need to evolve out of pdf file how to

    need to evolve out of pdf file how to

    Hi Dominic,

    This can be done using Adobe Reader, you must have Acrobat in order to crop/scale out PDF format.

    Thank you

    Tanvi

  • In order to become a distributor of volume Adobe Reader, (my computers have no internet access), I need to fill out the Distribution of Volume License Agreement, but will not accept an answer I gave to the question: "Please indicate the product or service

    In order to become a distributor of volume Adobe Reader, (my computers have no internet access), I need to fill out the Distribution of Volume License Agreement, but will not accept an answer I gave to the question: "Please indicate the product or service name and description.

    This form must be completed and submitted online. Also the browser Javascript must be activated.

    https://distribute.Adobe.com/mmForm/index.cfm?name=distribution_form&PV=RDR

  • I have problems with the form widget. When I created my forms, I need to leave out the line, one email because my client does not want the message line and two because those who have tried to fill the online form cannot submit because that box "email".

    I have problems with the form widget. When I created my forms, I need to leave out the line, one email because my client does not want the message line and two because those who have tried to fill the online form cannot submit because the 'email' box keep rejecting their email address valid. And I just tried to remove the line in my form and it does not allow me to delete or to mark it as not necessary either.

    Currently, there is no way around the field email forms of the Muse. Another option is to have a look at Jotforms or another third-party provider of shape that Muse has widgets for.

  • I have a ONE TIME need to fill out a PDF form.

    I have a ONE TIME need to fill out a PDF form and send it by e-mail; What are my options?

    Adobe Reader is all you need to do this, which is a free application.

    Tuesday, December 30, 2014, at 5:01, seisen5561, [email protected]>

  • I have most of my emails containing the tag. I need to sort those not marked.

    Are all of my emails in the Inbox and I tag them color. I need to find anyone who is not marked. Is there a way to sort them to show no marked ones all together?

    Make a right-click any button of the column (the buttons at the top of the columns that you click to sort), activate the Tag column, and then click the Tag sort by tag button column.

  • Need to sort the photos by date and time taken

    It is ridiculous that there is no possibility to sort the photos in an album by the date and time taken.  I imported the photos of several cards, two cameras take pictures at the same time, there is no way to sort photos, so the photos appear in true chronological order.  This should be added to the Photos, I think it's available in iPhoto.

    On Photos for Mac you can sort photos by date and time.  This was introduced with the update to El Capitan.  What version of Photos are you running?

    If you select one of your albums and ctrl-click, you can sort it by the titles, oldest first or newest first.

    Or is the problem that the sort order is incorrect?

    Then, you may need to adjust the date and time for pictures from camera cards different.  If you imported the photos while you were in different time zones, photo interpreter differently dates.  It will use the time zone of time current system at the time the photos are imported to interpret dates on cards.

  • Why do I need to fill out a credit card when I'm using paypal? I have enough money on paypal and I use exactly to do not to use a credit card.

    I wish to conclude a contract for a year with adobe in order to use photoshop, I live in the Netherlands, and I am currently at the Mexico to do some work. I pay 12, 09euros. I filled out my paypal to 13 euros and continue to pay. Yet Adobe wants me to fill out a credit card. I use paypal because I don't have a credit card... Why should I give strictly a credit card when you use paypal?

    Hi Brian,.

    You will need to contact support by calling/chat for this request.

    Contact the customer service

    * Be sure to stay connected with your Adobe ID before accessing the link above *.

    Kind regards

    Sheena

  • Need to fill out the field of text based on the selection after pressing an event in the OPS

    Dear all,

    I have a requirement as below

    I have a table of tip having a LOV field and I have a button to add a line so that I can add a row more lov field and after I am pressing a button to insert the LOV data into a table, my requirement is in the top of the page that I have text field, I have to fill the selected values of LOV in below format in this area.

    EX:

    Table of the advance:

    Row1:ABC

    Row2: DEF

    In the text field, I need ABC-> DEF in this format after pressing a button, and that the value should insert into the table in this form, please help me on this

    Thnaks

    Hello

    Advanced table: (SEE: SampleAdvnacedVO)

    RowNo ColLovValue

    1 ABC

    DEF 2

    Create an OAMessageTextInputBean (Id - ValueItm) and

    Set Property Render ${oa. RenderVO1.Render} with initial value as a BOOLEAN. FAKE.

    Button: Send

    Create a partial fire Action by clicking on the "submit" button

    Code central:

    Of the PFR:

    {if ("submitClick". Equals (PageContext.GetParameter (EVENT_PARAM)))}

    am.invokeMethod ("executeRenderVO");

    OAViewObject vo = am.findViewObject("SampleAdvnacedVO1");

    Line = vo.getAllRowsInRange ();

    String value = null;

    SampleAdvnacedVORowImpl voRow = null;

    for (int i = 0; i)< row.length;="">

    {

    voRow = rank (SampleAdvnacedVORowImpl) [i];

    value = value + "-->" + voRow.getColLovValue ();

    }

    System.out.println ("values-" + value);

    OAMessageTextInputBean valueItmBean = (OAMessageTextInputBean) webBean.findChildRecursive("ValueItm");

    valueItmBean.setValue (value);

    }

    GOT the Code

    public void executeRenderVO() {}

    OAViewObject vo = getRenderVO1();

    vo.executeQuery ();

    vo.insertRow (vo.createRow ());

    Line OARow = (OARow) vo.first ();

    row.setAttribute ("to make", Boolean.TRUE);

    }

  • need help with outer join filter.

    Need a little help to filter a result set and I can't seem to find a good way to do this.
    /*table*/
    
    create table invoice( farinvc_invh_code varchar2(100),
                                  farinvc_item varchar2(100),
                                  farinvc_po varchar2(100)
                                  )
       create table po( 
            supplier_number varchar2(60),
            supplier_invoice_no varchar2(60),
            po_number varchar2(60),
            run_date varchar2(60),
            PO_LINE_NUMBER varchar2(60) );
    /*data*/
    
    INSERT INTO "INVOICE" (FARINVC_INVH_CODE, FARINVC_ITEM, FARINVC_PO_ITEM) VALUES ('I0554164', '1', 'P0142245');
    INSERT INTO "INVOICE" (FARINVC_INVH_CODE, FARINVC_ITEM, FARINVC_PO_ITEM) VALUES ('I0554164', '3', 'P0142245');
    INSERT INTO "INVOICE" (FARINVC_INVH_CODE, FARINVC_ITEM, FARINVC_PO) VALUES ('I0554165', '1', 'P0142246');
    INSERT INTO "INVOICE" (FARINVC_INVH_CODE, FARINVC_ITEM, FARINVC_PO) VALUES ('I0554165', '2', 'P0142246');
    
    
    
    
    
    INSERT INTO "PO" (SUPPLIER_NUMBER, SUPPLIER_INVOICE_NO, PO_NUMBER, RUN_DATE, PO_LINE_NUMBER) VALUES ('914100121', '529132260', 'P0142245', '21-NOV-12', '1');
    INSERT INTO "PO" (SUPPLIER_NUMBER, SUPPLIER_INVOICE_NO, PO_NUMBER, RUN_DATE, PO_LINE_NUMBER) VALUES ('914100121', '529137831', 'P0142245', '21-NOV-12', '3');
    INSERT INTO "PO" (SUPPLIER_NUMBER, SUPPLIER_INVOICE_NO, PO_NUMBER, RUN_DATE, PO_LINE_NUMBER) VALUES ('914100121', '529137831', 'P0142245', '21-NOV-12', '2');
    INSERT INTO "PO" (SUPPLIER_NUMBER, SUPPLIER_INVOICE_NO, PO_NUMBER, RUN_DATE, PO_LINE_NUMBER) VALUES ('914100122', '145678', 'P0142246', '22-NOV-12', '1');
    INSERT INTO "PO" (SUPPLIER_NUMBER, SUPPLIER_INVOICE_NO, PO_NUMBER, RUN_DATE, PO_LINE_NUMBER) VALUES ('914100122', '145679', 'P0142246', '22-NOV-12', '2');
    query execution of im.

    SELECT  farinvc_invh_code,
                    supplier_number,
                    supplier_invoice_no,
                    farinvc_item, 
                    farinvc_po ,
                    po_number,
                    run_date,
                    PO_LINE_NUMBER
            FROM INVOICE, PO
            WHERE PO_NUMBER = FARINVC_PO(+)
            AND FARINVC_ITEM(+) = PO_LINE_NUMBER
            
    result
    "FARINVC_INVH_CODE"           "SUPPLIER_NUMBER"             "SUPPLIER_INVOICE_NO"         "FARINVC_ITEM"                "FARINVC_PO"                  "PO_NUMBER"                   "RUN_DATE"                    "PO_LINE_NUMBER"              
    "I0554165"                    "914100122"                   "145678"                      "1"                           "P0142246"                    "P0142246"                    "22-NOV-12"                   "1"                           
    "I0554165"                    "914100122"                   "145679"                      "2"                           "P0142246"                    "P0142246"                    "22-NOV-12"                   "2"                           
    "I0554164"                    "914100121"                   "529132260"                   "1"                           "P0142245"                    "P0142245"                    "21-NOV-12"                   "1"                           
    "I0554164"                    "914100121"                   "529137831"                   "3"                           "P0142245"                    "P0142245"                    "21-NOV-12"                   "3"                           
    ""                            "914100121"                   "529137831"                   ""                            ""                            "P0142245"                    "21-NOV-12"                   "2"                           
    It is a much larger table, and I took an excerpt in order to keep things clear and understanding. I would like to filter the result set to only show lines that have po numbers are the same and line are the same but there is an additional element. in other words as such.
    "FARINVC_INVH_CODE"           "SUPPLIER_NUMBER"             "SUPPLIER_INVOICE_NO"         "FARINVC_ITEM"                "FARINVC_PO"                  "PO_NUMBER"                   "RUN_DATE"                    "PO_LINE_NUMBER"              
    "I0554164"                    "914100121"                   "529132260"                   "1"                           "P0142245"                    "P0142245"                    "21-NOV-12"                   "1"                           
    "I0554164"                    "914100121"                   "529137831"                   "3"                           "P0142245"                    "P0142245"                    "21-NOV-12"                   "3"                           
    ""                            "914100121"                   "529137831"                   ""                            ""                            "P0142245"                    "21-NOV-12"                   "2"                           

    Hello

    Let me assure you that I understand.
    Last time, we were looking for the PO_NUMBERs who have been partially put into correspondence , i.e. groups of rows in the order table with the same po_number, which some had corresponding lines in the table Bill, and some of whom have not. It was essential that there is at least 1 line and 1 row without connections with the same purchase order.
    Now that you are interested SUPPLIER_INVOICE_NOs who are partially paired, i.e. groups of rows in the table of po with the same po_number and supplier_invoice_no, some of which have corresponding lines in the invoice table, and some are not. ("Supplier_Invoice_No" is quite a mouthful. "We'll abbreviate as sin in the future.) However, the final selection is based on po_numbers: If a po_number has partially matched sins, then we are interested all po_number. For example, the result set must include = 529132260 SIN, even if that sin is completely, because there is a partially matching sin (529137831) with the same po_number (P0142245).

    As this problem revolves around partially matching sins, let's call them Cardinal sins . We can calculate match_cnt and total_cnt based NAS as well as po_number. Then, we can use another analytic function so see if the po_number has all cardinal_sins, like this:

    WITH    joined_data     AS
    (
         SELECT     i.farinvc_invh_code
         ,     p.supplier_number
         ,     p.supplier_invoice_no
         ,     i.farinvc_item
         ,     i.farinvc_po
         ,     p.po_number
         ,     p.run_date
         ,     p.po_line_number
         ,     COUNT (i.farinvc_po) OVER ( PARTITION BY  p.po_number
                                            ,                  p.supplier_invoice_no
                               )     AS match_cnt
         ,     COUNT (*)           OVER ( PARTITION BY  p.po_number
                                            ,                  p.supplier_invoice_no
                                          )     AS total_cnt
         FROM           po       p
         LEFT OUTER JOIN  invoice  i  ON   i.farinvc_po    = p.po_number
                                      AND  i.farinvc_item  = p.po_line_number
    )
    ,     got_cardinal_sin_cnt     AS
    (
         SELECT  joined_data.*
         ,     SUM ( CASE
                        WHEN  match_cnt  >= 1
                     AND     match_cnt  <  total_cnt
                     THEN  1
                    END
                  ) OVER (PARTITION BY  po_number)     AS cardinal_sin_cnt
         FROM    joined_data
    )
    SELECT    farinvc_invh_code
    ,       supplier_number
    ,       supplier_invoice_no
    ,       farinvc_item
    ,       farinvc_po
    ,       po_number
    ,       run_date
    ,       po_line_number
    FROM       got_cardinal_sin_cnt
    WHERE       cardinal_sin_cnt     > 0
    ORDER BY  po_number
    ,            farinvc_item
    ;
    
  • What is the need to sort an ArrayCollection collection?

    Hello

    But can you get it someone please let me know why there is easy sort of the ArrayCollection collection?

    Where this might be useful? because insofar as my collection ArrayCollection knowledge would be used as a dataprovider to a DataGrid and datagrid already has a facility for sorting according to the column header clcik.

    So why or where Mecahnism type is used in the ArrayCollection collection?


    Please apologize if the question is stupid.

    Please share your ideas.

    In fact, the DataGrid type use sorting the Collection, she uses as a dataProvider, which means that the type of collection ArrayCollection is used if the dataProvider is an ArrayCollection collection.

    It can also be useful when you need to process an ArrayCollection of the elements collection in a particular order. Sorting the collection ArrayCollection using a for each loop to process the data in the correct order.

Maybe you are looking for