Search for characters, nested and apply the Cstyle

I have

you want to find the nested applied characters and apply the Cstyle, but my capture of code all the text in a document. Can you please guide me,

nestedreport();

function nestedreport() {}

myDoc var = app.activeDocument;

var myDocPath = myDoc.filePath;

var myDocName = myDoc.name;

try {}

app.findGrepPreferences = app.changeTextPreferences = null;

app.findGrepPreferences.findWhat = "^.» + » ;

myFind = myDoc.findGrep (false);

var ntexts = new Array;

for (i = myFind.length - 1; i > = 0; i--)

{

if(myFind[i].contents.nestedStyles==null)

{

ntexts.push (myFind [i]. Happy)

ntexts.appliedCharacterStyle = "Nested";

}

}

}

{catch (e)}

}

Screen shot 2015-07-21 at 2.26.33 PM.png

Hello

I'm still somewhat struggled with the final goal, however to make a small step:

To detect a string that is formatted using nestedStyle (part of the content of the paragraph), you can use this:

assuming that ==> text is selected - say a paragraph

var
  cCharStyle,
  charStyles = app.selection[0].characters.everyItem().appliedNestedStyles,
  step = charStyles.length,
  resString = "";

  while ( (cCharStyle = charStyles.pop() ) && step--)
       if ( cCharStyle.length )
            resString = app.selection[0].characters[step].contents + resString;

alert ( resString );

Jarek

Tags: InDesign

Similar Questions

  • How can I search for characters with no applied font?

    I have a document with many Chinese mixed with the English. Unfortunately the conversion of the Word always remove part of the formatting of the characters. It's time consuming to manually find a square with a cross boxes, anyone knows a method to search for characters with no police?

    There seems to be no option in find/replace to choose no font / no as it does with the paragraph styles and character styles.

    See here http://www.kahrel.plus.com/indesign/missing_glyphs.html

    and here http://indesignsecrets.com/tackling-missing-glyphs.php

  • What computer privileges must install and apply the updates for Creative Apps clouds using Windows 7?

    What computer privileges are required to install and apply the updates for Creative Apps clouds using Windows 7?

    When you work for a company that controls the software installed on your computer, it is important to know if IT supports is necessary to install and apply the updates when updates are available.

    It is important to know this information before you buy.

    Thank you for your support.

    ~ Paul Miller

    admin command is required for installation or any changes made to the software from your computer.

  • link to an interactive report AND apply the filter for 2 items.

    Hi can you help me out here on how to create a link to an interactive report AND apply the filter for 2 items.

    Here is my code

    I have a list of table, clicking the selected item should link to interactive report and create the filter. Below the code does not work for a filter. can you help me what to do with 2 filters.

    A filter = > works very well

    sys. HTP.p ("< ul class =" uChartList"> ');

    sys. HTP.p ("< class li =" uNumber uGrid col_2 col_sart"> ');

    sys. HTP.p ("< a href =" "|") sys. HTF.escape_sc ('f? p ='|: APP_ID |': 0 0 :'||: APP_SESSION |':00:P00_XXX:000, RIR:IREQ_XXX:Test :') |) » » >') ;

    sys. HTP.p ("< class =" uValue"> ' | l_tester |) ("< / big >");

    sys. HTP.p ("< small class =" uLabel"> < /small > Tester ');

    sys. HTP.p ("< /a > '");

    sys. HTP.p ("< /li >" ");

    Scenario 2:

    Two filters = > does not

    sys. HTP.p ("< ul class =" uChartList"> ');

    sys. HTP.p ("< class li =" uNumber uGrid col_2 col_sart"> ');

    sys. HTP.p ("< a href =" "|") sys. HTF.escape_sc ('f? p ='|: APP_ID |': 0 0 :'||: APP_SESSION |':00:P00_XXX:000, RIR:IREQ_XXX:Test:P00_YYY:001:IRC_YYY:test2 :') |) » » >') ;

    sys. HTP.p ("< class =" uValue"> ' | l_tester |) ("< / big >");

    sys. HTP.p ("< small class =" uLabel"> < /small > Tester ');

    sys. HTP.p ("< /a > '");

    sys. HTP.p ("< /li >" ");

    Thanks in advance

    actually the syntax wrong values in the syntax of the passes to several elements.

    is

    f? p = 6000:6004: & APP_SESSION. : NO:6003:MY_ITEM1, MY_ITEM2, MY_ITEM3:1234, 5678

    Use above scenario and verification.

    Go

  • HP Notebook: Remove black search box that says - start typing to search for applications, files and settings

    Remove the black search box that says start typing to search for applications, files, and settings

    Can someone tell me please how to permanently delete this search field that keeps appearing in different applications that I use?

    I have windows 10 on a HP laptop. Often when I'm working in an application and I move the cursor on the screen, this search box - start typing to search for applications, files, and settings - appears. I tried several times to turn it off, but I do not just because I can't seem to get rid of it.

    I would like it removed permanently or turns off permanently so it is not continue to block my view of the application, that I'm trying. Any suggestions would be greatly appreciated.

    Thank you.

    Terry20

    @Terry20

    Found this.

    Click on the Start button and select settings.

    Then select devices.

    Click on the mouse and touch pad and scroll down and select 'extra mouse Options '.

    This will open a box that should have the information and the name of the type of touchpad has your computer.

    Click on settings and then in the new box that opens, you should see a tab that says 'Tapping '.

    Open this tab and you should see 'Three finger Tap' and 'four finger Tap.

    Clear the check boxes, and then click 'apply '.

    REO

  • effective method for searching for my computer and its peripherals

    I am very dissatisfied with the tools at my disposal to search for my computer. I'm looking for another product, because Microsoft developers seem to have as objective search of his computer a very difficult task.

    So what third-party products are out there for the research and management of research on his computer?

    Here is an example of a task, I want to perform. I have a directory with pdf files and word files. I have a sentence and I want to find all files to see which files have this single sentence? It is a basic task simple, I'm sure that almost everyone would like to do at some point. This simple task was made more difficult with each subsequent version of windows.

    Here are some tasks I want to do like all the time.

    Look for file names and not the content of the files. searching content of files in file types. Search files with a certain creation, date of modification. all these things are hidden by users and which must be very complex I have a suite of wire run.

    You need this search filter from Adobe installed so that the indexer will gain the ability to 'see' inside these files: http://www.adobe.com/support/downloads/detail.jsp?ftpID=5542

  • My one year contract is about to expire. Can I extend the same price for two months and cancel the contract without redoing the accession of another full year?

    My one year contract is about to expire. Can I extend the same price for two months and cancel the contract without redoing the accession of another full year?

    Hello

    The plan of photography is an annual plan therefore would renew for another 12 months.

    Under the terms of subscription, an early termination fee would be applied if you have decided to cancel two months in the new contract - Adobe - General conditions of subscription

    Fill the cloud creative and plans unique app are available on a monthly basis, which can be another option - https://creative.adobe.com/plans

    Kind regards

    Bev

  • Help with a script that detects the content in a cell and apply the cell style to line

    Hello


    I am trying to add an article to my table formatting script that is a cell with the word 'Budget' (but this can be written as ' Budget:' or ' Budget: (E) "- but without the speech marks) and apply the cell Style - SponsorCells - to all the cells of the whole line. I currently have on what it will, but it does not work:


    function checkWhichTable()
    {
    // ensure the user made a selection
    if (app.selection.length != 1)
    return null;
    var currentTable = app.selection[0];
    if (currentTable.hasOwnProperty("baseline"))
    {
    currentTable = app.selection[0].parent;
    }
    while (currentTable instanceof Cell || currentTable instanceof Row || currentTable instanceof Column)
    currentTable = currentTable.parent;
    if (!(currentTable instanceof Table))
    {
    // No table selected
    return null;
    }
    return currentTable;
    }
    app.doScript(checkUserSelection, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Process Table");
    
    
    function checkUserSelection ()
    {
    var a_table = checkWhichTable();
    if (a_table == null)
    {
    if (confirm("No table selected. Do you want to process *all* tables?") == false)
    return;
    allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
    for (aTable=0; aTable<allTables.length; aTable++)
    {
    processTable (allTables[aTable]);
    }
    } else
    {
    processTable (a_table);
    }
    }
    function processTable(table)
    {
    // do something here!
    
    
    //Set 1st Row Height
    table.rows[0].height = "30mm";
    
    
    //Find Text in Cell and apply Cell Style to Row 
    var  
      myCellText=['Budget', 'Budget:', 'Budget: (E)'];  
     var myRegEx = new RegExp("^("+myCellText.join("|")+")$");
      for (i=0; i<table.cells.length; i++)
      {
        if (table.cells[i].texts[0].contents.match(myRegEx))
          table.cell[i].appliedCellStyle = "SponsorCells";
      }
    
    
    //end - do something here!
    }  
    


    I can get the script to apply the cell style to "SponsorCells" for each cell that contain the word 'Budget' etc, but I need cell ever on this line to have the cell style applied. I tried to re-write line 56 which applies the style to a cell, but I can't seem to make it work. Any help would be great.


    Separate on this issue, I would like to have a line of code similar to the 46 line, which sets the 1st height of lines, but I would like to say "If a cell has 'A cell Style' and then applies the value height 10 mm". If someone could result as a help of bonuses, things would be great double.


    Thanks in advance!

    But that could be painfully slow. To speed things up, follow these steps:

    var cells = table.cells.everyItem().getElements();
    for (var i=0; i
    

    It is faster, because it creates an array of cells with a call to table.cells, which is several times faster than calling table.cells. And before assigning to line 12mm height is useful to check if it is already 12 mm. checking things in InDesign and do things only when it is necessary is much more effective than simply doing things even if they are not necessary.

  • Selection of parts and columns, or entire lines and apply the character style

    I am trying to apply character styles to certain parts/whole rows and columns.

    I can change individual cells with the following code...

    table = app.selection[0];
    if (table.hasOwnProperty("baseline")) table = table.parent;
    if (table instanceof Cell) table = table.parent;
    if (table instanceof Column) table = table.parent;
    if (table instanceof Row) table = table.parent;
    if (table instanceof Table)
    
    {
     table.rows[0].cells[6].texts[0].appliedCharacterStyle = "none report";
     }
    

    ... but when I try to select an entire line, I get the error 'Object does not support property or method' texts. "" "When I try one of the following two codes.

    {
     table.rows[0].cells.texts.appliedCharacterStyle = "none report";
     }
    

    {
     table.rows[0].cells.appliedCharacterStyle = "none report";
     }
    

    Anyone know how I can do the following?

    1. Select any row (or column) and apply the character style

    2. Select the last line (regardless of the number of rows in the table) and apply the character style

    3. apply the character style to specific columns (with theexception of the cells of two albums)

    Thank you!

    Hello

    Change this line:

    table.columns[a].cells.itemByRange(2,-1).texts.everyItem().appliedCharacterStyle = "chart orange";
    

    for the first 2 rows in each column

    Jarek

  • I can't open my e-mail address. Error Msg "check online for a solution and close the program."

    I couldn't open my email... get a pop up block saying message "check online for a solution and close the program.

    Hello

    Please check the email client that you use to send and receive mail.  You use Outlook or Windows Mail, or you are using an Internet e-mail account?  If you please you would follow with me to provide detailed information about your question, I would be very happy.

    If you use Outlook, go to the Control Panel, go to programs and features and attempt to repair the installed program.  If necessary, back up your data to this show and uninstall and reinstall.

    Thank you

    Aaron
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • I previously registered for upgrade offer and received the coupon code but has failed can I take advantage of the offer now

    I previously registered for upgrade offer and received the coupon code but has failed can I take advantage of the offer now

    If you don't have the product key, then sorry, too late, you can simply buy it now.

    http://www.Windows.com/buy

  • How to search for text in all of the PDF files on a mobile device?

    How to search for text in all of the PDF files on a mobile device?

    Not possible on mobile devices.

  • How to search for a specific word in the code using Dreamweaver?

    I need to search for a specific word in the code for all the pages of my site. How can I do it using Dreamweaver?

    To search for local files of a Site defined in DW...

    Open the search tool & replacement with Ctrl + F

    Replace the drop-down list search in entire current Local Site

    Replace the drop-down list of search text or Source code

    Add the text to search for in the search field

    Add the replacement text in the field replace (or nothing if you just want to remove the text)

    Hit replace all

  • When I add images in MUSE, do photos resize for web quality (and therefore the page will load pretty quickly) or what I have to do using external software such as photoshop, etc. ? Thank you

    When I add images in MUSE, do photos resize for web quality (and therefore the page will load pretty quickly) or what I have to do using external software such as photoshop, etc. ?

    Also is there a way I can change the email of the contact form for my contact at the same time form a whole.

    I have over 100 contact forms and I want them to send the same email anyway I can do without going one by one?

    Yes, the new image is physically reduced (interpolated/oversampled) to the dimensions of the original image once that replace you it through the portal of IBE.

    Thank you

    Vikas

  • Help with a script to search for text in a table cell and apply the cell style

    Hello

    I build the script which Jongware wrote in his post here http://indesignsecrets.com/tackling-tables-through-scripting.php - I am trying to create a variable in which I can add a number of different parts of the text, in this case it's different parts of the United Kingdom i.e. 'London', 'East', 'Scotland' etc. I just need the script to apply the cell Style - 'District Cell' - to any cell that contains text in the variable. Here's the script, if anyone can help I would be grateful.

    function checkWhichTable()
    {
    // ensure the user made a selection
    if (app.selection.length != 1)
    return null;
    var currentTable = app.selection[0];
    if (currentTable.hasOwnProperty("baseline"))
    {
    currentTable = app.selection[0].parent;
    }
    while (currentTable instanceof Cell || currentTable instanceof Row || currentTable instanceof Column)
    currentTable = currentTable.parent;
    if (!(currentTable instanceof Table))
    {
    // No table selected
    return null;
    }
    return currentTable;
    }
    app.doScript(checkUserSelection, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Process Table");
    
    
    function checkUserSelection ()
    {
    var a_table = checkWhichTable();
    if (a_table == null)
    {
    if (confirm("No table selected. Do you want to process *all* tables?") == false)
    return;
    allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
    for (aTable=0; aTable<allTables.length; aTable++)
    {
    processTable (allTables[aTable]);
    }
    } else
    {
    processTable (a_table);
    }
    }
    function processTable(table)
    {
    // do something here!
    
    
    //Find Text in Cell and apply Cell Style
    var textInCell=['London', 'Scotland', 'South West'];
    for (i=0; i<table.cells.length; i++)
    {
    if (table.cells[i].texts[0].contents==textInCell)
    table.cells[i].appliedCellStyle = "District Cell";
    }
    
    
    
    
    }
    

    Hello

    Change this feature:

    function processTable(table)
    {
    //Find Text (exactly as it is) in Cell and apply Cell Style
    var
      textInCell=['London', 'Scotland', 'South West'],
      mFound, cFound;
    
    app.findGrepPreferences = null;
    app.findGrepPreferences.findWhat = "^(" + cities.join("|") + ")$";
    mFound = table.findGrep();
    while( cFound = mFound.pop() )
      cFound.parent.appliedCellStyle = "District Cell";
    }
    

    Jarek

Maybe you are looking for

  • Satellite A205 - S4577 - start problem

    I have a Toshiba Satellite A205 - S4577 with Vista Home on it. Yesterday, I downloaded and played AoE 2, it worked fine. I shut it down yesterday and when I tried to start it today the windows would go to halfway through the loading phase, a blue scr

  • Updates to Windows on the Production servers

    We have a requirement that RnD machines should not receive the patches once a user is working on it. The only option is to patch the data servers once the user connects or disconnects. The user must also permit/deny the installation of patches. I wou

  • Jump from blackBerry browser crashing

    My BlackBerry Bond is not Facebook allow exploit. A message keeps telling me that the browser is crashed. I tried the following and still no luck: clear the cache and history, power off /on peripheral. Help, please. I'm so frustrated with BlackBerry.

  • HP Deskjet 3000 - change the language implementation

    My roommate got the free printer through a nanny she family for. The menu language is what I believe to be Japanese. How can I change it to English?

  • With VCS-E media stream, VCS - C

    Hello We intend to implement a VCS infrastructure now I'm not sure wich accepting media between endpoints. On the photo, you could see the scenario. Endpoint 1 is communicate with the endpoint 2. 1 medium Wich takes the media stream? 2 what endpoint