Change the color of line of text found grep

I use InDesign CS 5 on Mac. I modified the script to find the word 'Base' and apply a fill color to the cell.

But I'm also trying to figure out the following:

1. search only in the selected table (I tried to change to var docTables = app.selection [0]; but I got an error for o = docTables.length I don't know how to fix.)

2. Add Grep search looking for 'Base' with the character style "medium weight table" attached (I tried to play with this code I use elsewhere, but can't figure out how to merge the two...)

app.changeGrepPreferences.appliedCharacterStyle = app.activeDocument.characterStyles.item ("medium weight table") ;)

3. apply fillColor on the line. I tried to play with the parentRow command, but not very successful there.

app.findGrepPreferences = NothingEnum.nothing;   
  //[Grep, cellStyleName]
var grepSearch = [["Base"]]  
  
var docTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();  
  
o = docTables.length;  
for(var i = 0; i < o;i++){  
    myTable = docTables[i];  
l = grepSearch.length;  
while(l--){  
app.findGrepPreferences.findWhat = grepSearch[l][0];   
var foundList = myTable.findGrep();   
f = foundList.length;  
while(f--){foundList[f].parent.fillColor = "PANTONE 3005 C 45%";}
}
}  
  
app.findGrepPreferences = NothingEnum.nothing;

Thanks for any help on any of these issues.

Hi Jennifer,.

I suggest making some clearings:

1. to catch a table from selection select an item in a parent table instance and check desired until successful.

2. you merge Grep conditions while assigning a value to consecutive preferences

(if your test should work in fact). To refer to the line in a cell content (text) use text. parent.parentRow

3 assign a witness to a .fillColor property

Then try this:

var mSel = app.selection[0],
mCheck = mSel instanceof Table || mSel instanceof Document;
while (!mCheck) {
          mSel = mSel.parent;
          mCheck = mSel instanceof Table || mSel instanceof Document;
          }
if (mSel instanceof Document) {alert ("Select anything inside a table"); exit();}

app.findGrepPreferences = NothingEnum.nothing;
var grepSearch = ["Base"] ,
l = grepSearch.length,
mStyle = app.activeDocument.characterStyles.item("chart semibold"),
mSwatch = app.activeDocument.swatches.item("PANTONE 3005 C 45%");

app.findGrepPreferences.appliedCharacterStyle = mStyle;

while(l--) {
          app.findGrepPreferences.findWhat = grepSearch[l];
          foundList = mSel.findGrep();
          f = foundList.length;
          while(f--) {
          foundList[f].parent.parentRow.fillColor = mSwatch;
          }
     }

app.findGrepPreferences = NothingEnum.nothing;

Jarek

Tags: InDesign

Similar Questions

  • change the color of line based on the value of column 5 Apex in the classic report

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Hello

    I know this question has been asked several times here, but I'm working on 5 Apex and need to know the correct way to do it in this version.

    I need to change the color of the text of the entire line (no background color) based on the value in one of the columns of the classic report. I have just two conditions, if the value of column = Yes, color should be red, otherwise it must be green.

    I am new to jscript and css, so appreciate if someone can tell me the solution with steps.

    I have already checked this link that changes the value of the column, need to do something similar to the whole line.

    https://tylermuth.WordPress.com/2007/12/01/conditional-column-formatting-in-apex/

    Hi coolmaddy007-Oracle,.

    Here's an example set up on the apex.oracle.com according to the specifications you gave: https://apex.oracle.com/pls/apex/f?p=35467:1

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Here is how it is done:

    Create a dynamic action with the following specifications:

    Name: Give the appropriate name

    Event: After refresh

    Selection type: region

    Region: select your region classic report

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $('td[headers="JOB"]').each(function() {
      if ( $(this).text() === 'MANAGER' ) {
        $(this).closest('tr').find('td').css({"color":"red"});
      }
      if ( $(this).text() === 'SALESMAN' ) {
        $(this).closest('tr').find('td').css({"color":"green"});
      }
      if ( $(this).text() === 'CLERK' ) {
        $(this).closest('tr').find('td').css({"color":"blue"});
      }
    });
    

    NOTE: Download the selector appropriate for your knowledge $('td[headers="JOB"]') case using firebug/browser development tools.

    Items concerned: leave blank.

    PS: Changed the example to change the color of text instead of the background color.

    I hope this helps!

    Kind regards

    Kiran

  • Change the color of a dynamic text field selection

    Hi all

    Among the requirements of the project, I must provide functionality in my application to be able to change the color of the text box selection. Which does not Flash, I searched the net and found a good example of this with the flash.geom.ColorTransform and TextFormat classes. It works very well with windows. However, it does not work on Mac OS x. I use Flash 8 with ACE 2.0 for development.

    Please see the attached code

    Please advice.
    TIA

    I...

    Flash player version problem... I've upgraded to Adobe Flash Player 9 update 3, version 9.0.115.0 on Mac FF2 number and the color transformation works perfect!

  • How can I change the color to search for text in firefox?

    When you press CTRL + F in Firefox to make appear the text search and you search for a Word, the word is highlighted in this neon-green color. Is there a way to change the color of this? The green color is barely visible.

    As I mentioned in my first post, you can right-click and choose New > String to create the entry.

  • Change the color of line based on condition.

    Hello

    Am using jdeveloper 11.1.1.6.0

    I slipped and fell by xxxVO as an array of af in my jspx page.

    This vo has the attribute of gravity which is a component to select only one option.

    I need to change the color line if gravity = 1.

    How can I achieve this.

    Kind regards

    Prasad K T,.

    9840021070.

    Refer

    ADF: color change of the value of the column according to the requirement

  • How can I change the color of line in a line graph?

    I used Illustrator to create a line graph. (Not my option you want because I normally import from R and then edit, but the manual wanted to show that you can create graphic and edit them in Illustrator)

    In any case, I did all the editing, except that I can't change the color of the line. My job requires me to match the example of manual and the manual does not provide any instructions on how to do it. I did pretty much any method I can think and the rest always gray line. I'm almost ready to give up everything and lose the points, but something as simple as the color cannot be that hard, right? Right?

    You need spend the focus from filling in the race or the color Panel, or by using the shortcut SHIFT - X. You can use Select > same > Fill and stroke to select all parts of the line and then a Cmd (Ctrl)-J to connect all the parts.

  • Change the color of lines, such as the quick selection selection

    Is there anyway to change the color of the selection of black moving dashes (ants), a selection tool, such as the quick selection?

    No, sorry.

    If you could, it would be in the preferences. It is not the case.

    You can hide the mobile dotted with Cmd + H (Ctrl + H)

  • How to change the color of line according to the value of the column

    Hi all

    I have an obligation to change the color of the column based on the value. As I have a table of results and the State are success and failure and progresses, if the State values is the success that should appear in green and if the status is failed, that should be red...

    Here is my table ADF Trinidad read only tables.

    Can someone help me with this.

    Thank you

    Hello

    Try this:

    styleClass="#{row.bindings.Status.inputValue=='IN PROGRESS' ? 'INPROGRESS' : row.bindings.Status.inputValue}"
    
  • Change the color of line in an interactive report in version 4.2 # Apex

    Hi team,

    I have done following things in my interactive report to reflect changes in color, but these changes do not appear. Could you please help where I'm missing.

    Apex Version 4.2 #.

    Theme-100 light blue

    1. to light under the screen if active_flag is "N", then the entire line, I would like to show in a different color.

    2. then create a dynamic action like this

    Name: Give the appropriate name

    Event: After refresh

    Selection type: region

    Region: select your region classic report

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code

    $('td[headers="Active_Flag"]').each(function() {  
      if ( $(this).text() === 'N' ) {  
        $(this).closest('tr').find('td').css({"background-color":"#FFFF99"});
      } else if ( $(this).text() === 'Y' ) {  
        $(this).closest('tr').find('td').css({"background-color":"#EEA196"});
      } else {  
        $(this).closest('tr').find('td').css({"background-color":"#C6EA91"});
      }  
    });
    

    But it does not reflect anything, you can offer me if I wrong anywhere.

    Kind regards

    Sruthitamiri

    Sruthi Tamiri wrote:

    I have done following things in my interactive report to reflect changes in color, but these changes do not appear. Could you please help where I'm missing.

    Apex Version 4.2 #.

    Theme-100 light blue

    1. to light under the screen if active_flag is "N", then the entire line, I would like to show in a different color.

    2. then create a dynamic action like this

    Name: Give the appropriate name

    Event: After refresh

    Selection type: region

    Region: select your region classic report

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code

    1. {$('td[headers="Active_Flag"]').each (function ()}
    2. If ($(this) () .text = ' don't) {}
    3. $(this) .find ('td').css({"background-color":"#FFFF99"});).closest('tr')
    4. } ElseIf ($(this) () .text = 'Y') {}
    5. $(this) .find ('td').css({"background-color":"#EEA196"});).closest('tr')
    6. } else {}
    7. $(this) .find ('td').css({"background-color":"#C6EA91"});).closest('tr')
    8. }
    9. });

    But it does not reflect anything, you can offer me if I wrong anywhere.

    Interactive report region that model is set to Model No.? If so, that means that is missing an ID attribute that is required to bind a dynamic action after refreshing the report. Use a region template that contains id="#REGION_STATIC_ID#" , as the region without buttons or title.

    The number of standard theme for the theme of blue light is 15. Have numbered it 100 would indicate that it has been customized, exported and re-imported. In an application updated through previous versions of APEX, it can actually be an older version of this theme earlier at APEX 4.x, when a number of models in legacy issues, missing this attribute altogether.

  • Change the color of line permanently as a condition while the other lines remain default color

    I tried the methods I've read on other forums, but when I go to the next record, follows the color. I want the color to stay on the line that meet the condition. TNX

    Hello.

    You can use the built-in SET_ITEM_INSTANCE_PROPERTY to set the VISUAL_ATTRIBUTE property for each item in the folder that you want to change.

    The Set_Record_Property does not work or the Set_Block_Property.

  • How can we change the spacing between lines of text?

    6 How do I change the spcing between the lines of text using Dreamweaver. Do not see as an option in the menu of page properties.

    Try the line-height CSS property.

    --

    Kenneth Kawamoto

    [link removed by Moderator]

  • Hi, need to change the color of line at run time

    Hi all

    I have columns in the paintings is one of them for YES and it is of TYPE I create two attribute for this and place like this to trigger post_query block-level after that I get what I want the color of the YES and NO, but
    NOW I NEED TO CHANGE THE LINE COLOR IN FULL WHAT IT TAKES PLEASE GUIDE

    IF: ORDER_TRACKER2. TYPE = "YES" THEN
    SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.) TYPE ', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_NO');
    ON THE OTHER
    SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.) TYPE ', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_YES');
    END IF;

    Thanks and greetings
    Vikas Singhal
    IF :ORDER_TRACKER2.TYPE = 'YES' THEN
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.TYPE', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_NO');
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.ITEM1', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_NO');
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.ITEM2', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_NO');
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.ITEM3', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_NO');
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.ITEM4', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_NO');
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.ITEM5', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_NO');
    ELSE
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.TYPE', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_YES');
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.ITEM1', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_YES');
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.ITEM2', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_YES');
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.ITEM3', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_YES');
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.ITEM4', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_YES');
      SET_ITEM_INSTANCE_PROPERTY ('ORDER_TRACKER2.ITEM5', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'ATT_YES');
    END IF;
    
  • How to change the color of line based on Condition

    Dear all,

    We have requirment as shown below

    Based on the condition, I want to show the color for all of the line

    Example of

    If attribute = 'Y' then
    {
    < show the color for complete line in advanced table?
    }

    Please give me suggestion how join my requirment.

    Thank you
    Venkat Reddy Pulichintha

    Hey...

    you said that the code you wrote is working for a column... in the same way you can set the CSS Style on all other columns as well...

    Why don't you go with code that works...

    DataBound APIs are an alternative solution to this... you can search on it later...

    Thank you
    Gerard

  • change the color of the line in a diagram 3D with points - e3DShapePoints

    How can I change the color of line in a type of diagram of e3DShapePoints? I want to use one of the global predefined palettes.

    I managed to change the color of line of brand via:

    Report.Sheets.Item (MySheetName). Objects.Item (MyDiagramName). Curves3D.item (MyCurveName). Shape.Settings.Marker.Line.Color.ColorIndex = eColorIndexGlobalColorPalette3

    but this will not have the legend color unfortunately. Apparently there is no object available within the parameters of the curve line.

    Any suggestions?

    If you cange the color in the definition of the curve of dialogue for 'points' this corresponds to the 'points' textcolor because no line is available. (oMyShape.Extensions.Label.Font.Color.ColorIndex = eColorIndexGlobalColorPalette1)

    Dim oMy3DAxisSystem, oMy3DCurve, oMyPos, oMyShape
    Call Report.NewLayout)
    Call Data.Root.Clear)
    Call DataFileLoad (DataReadPath & "Report_Data.tdm", "CT","" ")
    Set oMy3DAxisSystem = Report.ActiveSheet.Objects.Add (eReportObject3DAxisSystem, "My3DAxisSystem")
    Set oMyPos = oMy3DAxisSystem.Position.ByCoordinate
    oMyPos.X1 = 20
    oMyPos.X2 = 80
    oMyPos.Y1 = 20
    oMyPos.Y2 = 80
    Set oMy3DCurve = oMy3DAxisSystem.Curves3D.Add (e3DShapePoints, "MyNew3DCurve")
    Set oMyShape = oMy3DCurve.Shape
    oMyShape.DataStructure = e3DDataStructureMatrix
    oMyShape.XChannel.Reference = "[2] / [1].
    oMyShape.YChannel.Reference = "[2] / [2].
    oMyShape.ZChannel.Reference = "[2] / [3].
    oMyShape.Settings.Marker.Type = eMarkerCircle
    oMyShape.Settings.Marker.Filling.UseCurveColor = True
    Call oMyShape.Settings.Marker.Filling.SetPredefinedColor (ePredefinedColorred)

    oMyShape.Extensions.Label.Font.Color.ColorIndex = eColorIndexGlobalColorPalette1
    ' oMyShape.Settings.Marker.Line.UseCurveColor = True
    ' oMyShape.Settings.Marker.Line.Color.ColorIndex = eColorIndexGreen
    ' oMyShape.Settings.Marker.Filling.UseCurveColor = True
    ' oMyShape.Settings.Marker.Filling.ColorIndex = eColorIndexblack
    oMy3DAxisSystem.ColorLegend.Visible = True

    Call Report.Refresh)

    It's a little confusing.

    Hope this helps

    Winfried

  • Somehow changed the color of my screen, cannot be found to restore.

    Original title: colors

    I have somehow changed the colors on my screen, I found where I can change the color of the letters somehow

    as well as the color of window boxes. now I can't find where I went

    You forgot to mention the version of Windows that you are using and this little piece of information is important to provide concise instructions in getting to the dialog box window color and appearance .

    In Windows 7, right click on the desktop and choose personalize. When new personalization window opens, click on window color down. Your options may be in the new window window color and appearance , or you may need to click on Advanced appearance settings of the dialog box window color and appearance .

Maybe you are looking for

  • MP4 is extremely slow in Compressor 3 - upgrade?

    Hello I work a lot with the files mp4 (or m4v) and I use a compressor to encode them to the ProRes format - and then to the FCP 7. Currently using Compressor 3.5.3 The problem: it is extremely slow. When dragging a mp4 file (say about 10 min) causes

  • Standard and extended warranty question

    In accordance with the previous answer of Garrett, I checked the details of the guarantee and the profile reads as follws. "Intl Extension of warranty from 1 to 2 years for NB with 1y" As for the registration and receive a free additional year... I h

  • cam action fails in the SD chip format

    How long should it take for the HDR AS100V of formar a 32 GB SD Chip? What do you do if it fails... If it barely fills the chip... which fortunately can be formatted by another device (not Sony) Thank you, best regards Michael

  • Satellite - black screen and can't restart with the recovery disk

    I have a black screen and can not restart with the restore disc but it seems to be. I find this odd, I can't ask Toshiba direct on my problem, but I have to wait for one nature in the heart of my problem or give me a helping hand

  • Windows Update keeps failing because 8000ffff and error codes a 80071, 90

    This is a new installation on a new hard drive I just bought. There is no other program installed yet including any antivirus. Please help I don't know what to do.