How to apply a cell of table based on grep style research?

Anyone who knows how to make a script that searches an array of Indesign for

-> All cells whose text begins with "banana".

-> And apply the cell style 'Yellow' in these cells?

I searched the forums for somedays and got this tip: https://github.com/seuzo/regex_cellstyle/BLOB/master/regex_cellstyle.jsx

-> But the script is in Japanese and also use dialog boxes.

All help much appriciated!

Hi Frankemans,

myDoc = app.activeDocument var

app.findTextPreferences = app.changeTextPreferences = null

app.findTextPreferences.findWhat = "banana".

var myFound = myDoc.findText)

for (i = 0; i

{

If (. parent.constructor.name myFound [i] == "Cell")

{

. parent.appliedCellStyle myFound [i] = "yellow."

Overrides var = myFound [i] .clearOverrides () //this is the new line added to this content

}

}

Thank you

Beginner

Tags: InDesign

Similar Questions

  • How to highlight a cell IR report based on a value in another column?

    I used the code below and the cell is highlighted for all use column formatting css #COLTOHIGHLIGHT #add to pageBut what I need is if the HIDDENCOL is 'OUT' value and Custom2 should apply if the HIDDENCOL has value 'IN' then custom1 should apply. How to do? Please help thanks loly

    Sinduja Sivasailam wrote:

    Thank you for your contributions. I understand the concern.

    As suggested, I've reproduced the problem in the environment of the APEX.

    Thanks for making the effort. I suggest the following approach, which is more flexible and allows a more efficient use of the separation of concerns as above. I created an example on a new page to illustrate this.

    1. change the report query to

    select
        jan
      , feb
      , mar
      , jan_st
      , feb_st
      , mar_st
    from
        project_status
    

    2. in the report, set the month columns to display text and status columns to be hidden.

    3. set the property Expression of HTML for each column of months to use a HTML data attribute to include metadata status as well as the displayed value:

    #JAN#
    

    4. create a dynamic action after Refresh on the IR region to retrieve the status of project code in the columns of months and apply it as a class to the cell of report element:

    Event: After refresh

    Selection type: Region

    Region:

    Real Actions

    Sequence: 10

    Action: Run the JavaScript Code

    Fire on Page load: Yes

    Code

    $('.a-IRR-table td [data-prj-status]').each(function () {
      var x = $(this);
      x.parent().addClass(x.data('prjStatus'));
    });
    

    5 Add a style sheet to the page of Inline CSS property with a rule to set the background color of cell as required for each State of the project:

    .a-IRR-table tr:hover td {
      opacity: 0.7;
      transition: opacity .1s
    }
    .a-IRR-table td.REQ,
    .a-IRR-table tr:hover td.REQ {
      background-color: #ff9;
    }
    .a-IRR-table td.INP,
    .a-IRR-table tr:hover td.INP {
      background-color: #cf9;
    }
    .a-IRR-table td.YTS,
    .a-IRR-table tr:hover td.YTS {
      background-color: #ccf;
    }
    .a-IRR-table td.CR,
    .a-IRR-table tr:hover td.CR {
      background-color: #f66;
    }
    .a-IRR-table td.COM,
    .a-IRR-table tr:hover td.COM {
      background-color: #9cf;
    }
    
  • How update the column in the table based on the value selected in apex4.1

    Hi all
    I have the following tables,
    leave_type table,it has the following fields,
    1.emp_name,
    2.sick
    3.casual
    and it has the values as follows,
    emp_name                  sick             casual
    guru                           10                10
    mishra                         10                10
    leave_master table and it includes the following fields
    1.emp_name,
    2.leave_type
    3.no_of_days
    I have the form based on the table "leave_master"
    Here, the leave_type has the LOV which includes.
    sick and casual.

    When the form is filled out and clicked on the button submit,
    I need to update the column leave_type in table leave_type,
    for example,.
    if 
    emp_name:guru
    leave_type:sick
    no_of_days:3
    then I want to update the leave_type column,
    sick sick = - no_of_days for the 'guru' of name
    That is to say, ill = 10-3 = 7

    then the leave_type of the table must be,
    emp_name                       sick             casual
    guru                                 7                10
    mishra                              10               10
    someone can such me what code or method I can use?
    Thank you.

    Published by: Gurujothi on May 24, 2012 21:54

    Published by: Gurujothi on May 24, 2012 21:54

    Try something like this...

    BEGIN
    IF: PXX_LEAVE_TYPE = "Sick" THEN
    UPDATE LEAVE_TYPE
    THE PATIENT VALUE = SICK -: PXX_NO_OF_DAYS
    WHERE EMP_NAME =: PXX_EMP_NAME;
    ON THE OTHER
    UPDATE LEAVE_TYPE
    DEFINE CASUAL = CASUAL -: PXX_NO_OF_DAYS
    WHERE EMP_NAME =: PXX_EMP_NAME;
    END IF;
    COMMIT;
    END;

  • How to apply a commandlink to an ADF for line header cell

    I put a bed ADF implemented only the table. I have a column that I'm designating as a column in Add/Remove. In simple terms, I would like to than the cell of this column in the header row to have a drive behind it a link that opens a form 'add a line '. For each individual detail line column will have an order in connection with the function 'delete '. I'm having no problem with the button Delete.

    My question is, "someone has advice on how to apply a command link to a row header cell.

    Here is a sample based on your use cases:


    emptyText = "#{bindings." Employees.Viewable? "{'No data to display.': 'Access Denied.'}".
    fetchSize = "#{bindings." Employees.rangeSize}' rowBandingInterval = '0 '.
    selectedRowKeys = ' #{bindings. " Employees.collectionModel.selectedRow}.
    selectionListener = "#{bindings." RowSelection Employees.collectionModel.makeCurrent}' = 'single '.
    ID = "t1" >

    headerText = "#{bindings." Employees.hints.FirstName.label}"id ="c1">



    headerText = "#{bindings." Employees.hints.LastName.label}"id ="c2">


    **
    **
    **
    *
    *
    **
    *
    *

  • How can I write in a table cell (row, column appear) in a databae?

    How can I write in a table cell (row, column appear) in a database using LabVIEW Database Toolkit? I use Ms Access. Suppose I have three columns in a table, I write 1 row of the 1st column, then 1st rank of the 3rd column. The problem I have is after writing the 1st column of 1st row, the reference goes to the second row, and if I write in the 3rd column, he goes to the 2nd row 3rd column. Any suggestion?

    When you perform a SQL INSERT command, you create a new line. If you want to change an existing line, you must use the UPDATE command (i.e. UPDATE tablename SET column = value WHERE some_column = some_value). The some_column could be the unique ID of each line, date and time, etc.

    I don't know what is the function to use in the Toolbox to execute a SQL command, since I do not use the Toolbox. Also, I don't understand why you don't do a single INSERT. It would be much faster.

  • How to perform account on a Table hierarchical Oracle based on the Parent link

    Hello


    I have the following to Oracle 11 g R2 hierarchical table definition:


    Table Name: TECH_VALUES:
      ID,
      GROUP_ID,
      LINK_ID
      PARENT_GROUP_ID,
      TECH_TYPE

    Above the hierarchical table definition, some examples of data might look like this:


    ID      GROUP_ID      LINK_ID      PARENT_GROUP_ID      TECH_TYPE 
    ------- ------------- ------------ -------------------- --------------
    1       100           LETTER_A     0
    2       200           LETTER_B     0
    3       300           LETTER_C     0
    4       400           LETTER_A1    100                  A 
    5       500           LETTER_A2    100                  A 
    6       600           LETTER_A3    100                  A 
    7       700           LETTER_AA1   400                  B 
    8       800           LETTER_AAA1  700                  C 
    9       900           LETTER_B2    200                  B 
    10      1000          LETTER_BB5   900                  B 
    12      1200          LETTER_CC1   300                  C
    13      1300          LETTER_CC2   300                  C
    14      1400          LETTER_CC3   300                  A
    15      1500          LETTER_CCC5  1400                 A
    16      1600          LETTER_CCC6  1500                 C
    17      1700          LETTER_BBB8  900                  B
    18      1800          LETTER_B     0
    19      1900          LETTER_B2    1800                 B 
    20      2000          LETTER_BB5   1900                 B 
    21      2100          LETTER_BBB8  1900
                     B


    Keeping in mind that there are only three Types of technology, i.e. A, B and C, but could not span on different LINK_IDs , how can I do a count on these three different TECH_TYPEs based solely on the ID of parent link where the parent group id is 0 and there are children below them?

    NOTE: It is also possible to have parents in dual link ID such as LETTER_B and all values of children but different group ID.

    I'm basically after a table/report query that looks like this:

    Link ID        Tech Type A         Tech Type B          Tech Type C
    -------------- ------------------- -------------------- -------------------
    LETTER_A      
    3                   1                    1
    LETTER_B      
    0                   3                    0
    LETTER_C      
    2                   0                    3
    LETTER_B      
    0                   3                    0

    Be hierarchical and my table can consist more of 30 000 files, I must also ensure that performance to produce the report above shown here query is fast.

    Obviously, in order to produce the report above, I need to gather all necessary County outages based on TECH_TYPE for all parents of the link id where the PARENT_GROUP_ID = 0 and store it in a table according to the guidelines of this report layout.

    Hope someone can help with maybe a combined query that performs the counties as well as stores the information in a new table called LINK_COUNTS, which will be based on this report. Columns of this table will be:

    ID,

    LINK_ID,

    TECH_TYPE_A,

    TECH_TYPE_B,

    TECH_TYPE_C

    At the end of this entire requirement, I want to be able to update the LINK_COUNTS table based on the results returned by the sample data above in a SQL UPDATE transaction as the link ID parent top-level already exists within my table LINK_COUNTS, just need to provide values for breaking County for each parent node link , i.e.

    LETTER_A

    LETTER_B

    LETTER_C

    LETTER_B

    using something like:

    UPDATE link_counts

    SET (TECH_TYPE_A,TECH_TYPE_B,TECH_TYPE_C) =

       (with xyz  where link_id = LINK_COUNTS.link_id .... etc

    Which must match exactly the above table/report

    Thank you.

    Tony.

    Hi, John,.

    Thanks for posting the sample data.

    John Spencer wrote:

    ...  If you need to hide the ID column, then you could simply encapsulate another external query around me. ...

    Or simply not display the id column:

    Select link_id, -id,

    Count (case when tech_type = 'A' end then 1) tech_a.

    Count (case when tech_type = 'B' then 1 end) tech_b,.

    Count (case when tech_type = "C" then 1 end) tech_c

    of (connect_by_root select link_id link_id,)

    the connect_by_root ID, tech_type

    of sample_data

    Start with parent_group_id = 0

    connect prior group_id = parent_group_id)

    Link_id group, id

    order by link_id, id;

    Same results, using SELECT... PIVOT

    WITH got_roots AS

    (

    SELECT CONNECT_BY_ROOT link_id AS link_id

    Id CONNECT_BY_ROOT ID

    tech_type

    OF sample_data

    START WITH parent_group_id = 0

    CONNECT BY PRIOR group_id = parent_group_id

    )

    SELECT link_id, tech_a, tech_b, tech_c

    OF got_roots

    PIVOT (COUNT (*)

    FOR tech_type IN ('A' AS tech_a

    'B' AS tech_b

    'C' AS tech_c

    )

    )

    Id ORDER BY link_id

    ;

  • 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

  • How can I insert several CSVs in dreamweaver in a table based on ID

    How can I insert several CSVs in dreamweaver in a table based on ID? I recorded each sheet in the doc excel as a CSV file and now I want to import all the CSVs in one table by pulling the information attached to the ID of the line.

  • How to upgrade all the record for a particular column in a table based on search criteria.

    Hi all

    I'm new to ADF. I have a requirement where I have to perform the update of mass on a table.

    Scenario:

    Ex: I have a search region manual dept. where I search with deptId: 20. I get 20 records in my table. now I have another area where I have an inputchoice list that contains all the column names that exist in the dept table. Beside that, I have a text box and a button update

    The user now, first research with dept id: 20 and click on the button Search, where it shows 20 record in the table. He then select an input choicelist(ex: ManagerId) column, then enter the new value in the decision-making box(ex: abc) then click on the button update.

    Now, I want to, all the records in the ManagerId column with dept id: 20 update with the new value 'abc '.

    Can someone help me with the code.

    Thanks in advance...

    Hello

    If you go to your VO and generate the ViewObjectImpl, here you can create a method that contains two parameters, 1 the name attribute and 2 the value.

    Then you can follow something as explained in this post:

    ADF tutorial: how to apply actions in bulk to a view object lines

    The only difference is that you must create a method like this:

    ' Public Sub updateAttribute (attribute String, Integer value) {}

    RowSetIterator iter = createRowSetIterator (null);

    While (iter.hasNext ()) {}

    Line = iter.next ();

    row.setAttribute (attribute, value);

    }

    }

    Then execute you who expose a customer interface and then after you filter your table according to your criteria just this method passing the correct parameters.

    Concerning

  • How can we do the invisible table cells (but not content) in DW CS5?

    How can you efficiently convert the table cells in invisible ones so that the content within these cells gets stand alone, visibility-wise, please?  I looked at so many different orders of Dreamweaver CS-5, but none seem to do the trick, at least do not apparently potentially compromising the existing content somehow.  Any thoughts, please?

    Change

    BORDER CELLPADDING = "0".

    TO

    BORDER = "0".

    See what for you.

    Gary

  • How to update the password on the other table based on the mod

    Hello

    I need to update the password for the other table based on the mod.

    I have two table 'user' and 'reset '.


    User:

    Username username password date_exp

    s232322 Bobby John sdds4545df4r 10/12/2010
    s454566 George Bill f444556gh76 07/14/2010
    s343466 Bill Clinton fgf54tyujkkkhj 06/12/2011
    .
    .
    .


    Reset:

    Series encrypt decrypt

    fgf5656fg 0 Watellemon
    1 dfggf5665 lime juice
    dfdffd545 2 applesalad
    3 54r4gggt airlines
    construction of 4 hg44hh63
    5 fgf4343yh security
    .
    .
    .

    How can I update the password of a table to another table "reset"?

    Ex: query

    Update user set password = (select Encrypt reset where mod (length (username), 10))


    If mod (length (username), 10) is 0, it should take series "0" encrypt the password and update the password in the table "user".
    If mod (length (username), 10) is 1, it should take serial '1' encrypt the password and update the password in the table "user".
    If mod (length (username), 10) is 2, it should take series '2' encrypt the password and update the password in the table "user".
    If mod (length (username), 10) is 3, it should take series '3' encrypt the password and update the password in the table "user".
    If mod (length (username), 10) is 4, it should take series '4' encrypt the password and update the password in the table "user".
    ....


    Please help me write an update query.




    Thank you
    Nihar

    Hi, Nihar,

    You almost had it! You just need to correlate the subquery for the main UPDATE statement, like this:

    UPDATE     user_table     u     -- USER is a built-in function; it's not a good table name
    SET     password = ( SELECT  encrypt
                   FROM    reset     -- RESET isn't a very good table name, either
                   WHERE   serial     = MOD ( LENGTH (u.username)
                                             , 10
                                   )
                 );
    
  • How to apply the Style to some words in a paragraph (or table)?

    I have a table with the #'s. Some numbers have a note marked with an asterisk.

    For example:

    A01-121600

    A01-121602

    A01-121608 *.

    A01-121610

    A01-121611 *.

    And in this table, there are hundreds of part # s with some with reference asterisks scattered through. I wish that the asterisks to be red in color and a smaller font size. So I created a character style to reflect that.

    So, my question is there a way to apply this new character Style to the entire table, then each asterisk is changed?

    Thank you.

    The find/replace field allows you to apply a character Style to all the text found.

    Another option: If all the text in your table is formatted with a paragraph Style, you could add a GREP style to add this character Style to all instances of an asterisk in the text of this paragraph Style. This way, if the new numbers of the asterisk was added later, the asterisk turns to Red style automatically.

  • Make some lines in a table based on a condition.

    I have a table based on a View object that displays four columns: Secure, Description, username and Date.

    Currently it displays all the data based on the request of the VO.  When a user clicks on a line, the complete 'Description' is showed in a below - rich text editor where it can be updated and saved in the database.

    I am facing a problem of application of security for the page.  The scenario is as follows:

    If a logged-in user (defined in the flowrate range of Page), does NOT match the user name on a specific line (user name of the database), AND "Safe" is TRUE (in the case of the database, '1'), then the 'Description' should NOT be visible.

    Looks like I can set the property 'Lent' on the specific Description column, but if it is not made and the user clicks on the line, the value of the Description always displayed in the below rich text editor.

    What would be the best way to do this?  Is it possible to manually set the Description of the '< Secured >"(or something) in the table and the text of the editor if the condition is true? I hope that this is possible is because I want that line to be always present, just the Description hidden in both components.

    This should be done by programming or can be done with an EL expression?

    If by programming is the only way, how can I write logic for Page loading?

    Thank you!

    This can be done with an EL expression. You can write an EL expression for visible or properties readonly or disabled of the elements present within af: column.

    The EL expression can look like the line is #{pageFlowScope.userName. The name}, click the line if you have written the code to display Description in your bean to manage programmatically you can access pageFlowScope username and apply the same condition.

  • How to apply the AUTOFILTER on interactive report.

    Hello

    I'll have a report / form based on assume that the table EMP

    Page1 - Interactive (report)
    Page 2 - form

    report query-> select * from EMP;

    1 has created a new employee P2_EMP ('ABC') on page 2 and SAVE the record.
    2. as soon as I save the record on page 2, the control returns to Page1 (Interactive report)
    3. on page 1, all the Archives of the employees are displayed.

    What I want to, whenever I create a new employee P2_EMP = 'ABC' and SAVE the record, control on Page1 (Report) but only recording with employee P2_EMP = 'ABC', should be displayed on page 1...

    HOW can I achieve., I mean how to apply the AUTOFILTER on Page1 (interactive report)

    Currently, I have to manually apply the FILTER on page 1 (employee = ABC), I want to avoid.

    Thank you
    Deepak

    Hi Deepak,

    Could you have another element to the 1 'P1_NEW_EMP' page, pass this back into your branch when control passes from Page 2 to Page 1 and then put it as a condition of your report.

     select * from EMP
    where (employee = :P1_NEW_EMP or  :P1_NEW_EMP = '');
    
  • How to apply the strategy of UCS1.4 collection (1 d)

    Hi all

    I try to collect statistics on the performance of the network. but do not know how to apply the policy to the collection.

    Service profile, I cam see political Stats. But within the political framework of Stats, there are onlu available in config/choice is political threshold.

    Can someone help out me? Thank you very much!

    I think this is what you are looking for?

    UCS stores the past 5 statistics records at the "Reporting Interval" setting;
    There is no configuration to change that number.  You can put this interval out 8 hours but then you only get a snapshot every 8 hours. Trending or history retrieval would require an interval based extraction and storing application that utilizes the UCS XML API.

    This is a link to the UCS XML API information.
    http://www.cisco.com/en/US/docs/unified_computing/ucs/sw/api/ucs_api_book.html

Maybe you are looking for