Help find text and apply INDEXES

Hi Forum,

I m trying to apply INDEXES of the words founded in one click the button"of the created user interface.

Is this possible.

It's my test.

app.findGrepPreferences = app.changeGrepPreferences = null;

doc = app.activeDocument.stories.everyItem ();

app.findGrepPreferences.findWhat = "policy";

found = app.documents [0] .findGrep ();

for (i = 0; i > found.length; i ++) {}

FND = found [i];

If (found.length > 0)

doc. Indexes [0] .topics. Add (found);

App.Select [found];

doc.pageReferences.add (found [i], PageReferenceType.currentPage);

}

Thank you and best regards,

rkids

Hi rajnikids,

I'm new to javascript.

Try this

app.findGrepPreferences = app.changeGrepPreferences = null;

doc = app.activeDocument.stories.everyItem ();

app.findGrepPreferences.findWhat = "policy";                                                         the text you are looking for

myTopic = app.activeDocument.indexes.add (). topics.add ({name: 'Policy'});       Add topic

founded = app.documents [0] .findGrep ();

for (i = 0; i

found = based [i];

App.Select (found);

myTopic.pageReferences.add (found, PageReferenceType.currentPage);

}

Tags: InDesign

Similar Questions

  • Find the text and apply the format paragraph tag in Framemaker 11

    Help!

    I am trying to automate the search text in a file FM11 and CE marking with a specific paragraph tag. Once it is, I want to be able to search for the same string again and delete it. The research will include wildcard characters. I'm moving Word files on and bring with manual numbering of paragraphs. Thus, when they arrive, they "2.3.4.5" before paragraphs for example. I want to search all of the numbers at the beginning of paragraphs, tag all those with the appropriate para format (starting a catalog) and then remove the manual numbering.

    At this time do us it manually, using find/replace and by using wildcard search strings to find (such as '\P[1-9]*.*.*.*[0-9]', which will find all the para numbering at the beginning of a paragraph 4-digit), then using the change option to paste to paste in a paragraph of the catalog tag. Then we repeat the same search and delete the text, leaving only the tag para to the number format. It works very well, but errors can occur if the search string in set incorrectly or if the numbers are not deleted (in this case, it is found on the next search and re-labeled incorrectly). For example

    I work for the Air Force collection of entries from the field and creating publications out of them, so there is no mobile profit here, just trying to be efficient. Any help is greatly appreciated!

    Thanks in advance

    b

    Hi Brian,.

    I guess right here because I've never done this before, but... In my view, there is definitely something wrong with your mission to find the property values. The way you wrote, you are trying to assign two properties to a single table space. That's why you need to remove these two lines to make him find work, because they are replacing the FindText property apparently. Here is my proposal for how it should be:

    findParams = AllocatePropVals (2);

    findParams [0].propIdent.num = Constants.FS_FindText;

    findParams [0].propVal.valType = Constants.FT_String;

    findParams [0].propVal.sval = searchString.

    findParams [1].propIdent.num = Constants.FS_FindCustomizationFlags;

    findParams [1].propVal.valType = Constants.FT_Integer;

    findParams [1].propVal.ival = Constants.FF_FIND_USE_WILDCARDS;

    In any case, let me point out again once it is a hypothesis and I did not test this. I am sure, however, that the solution is somewhere along this path.

    Russ

  • need help finding text that should be in my clip board

    I need help to find the text that should have been copied or pasted into my Clipboard

    give all the information that you did in your other thread here, which also had an answer for you

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-files/need-help-in-finding-text-that-was-cut-from-Word/2e0f3bd3-B572-462B-b8ea-4406c389925f

  • Find Greek and applied characters for Times new roman

    Dear friend,

    How to find characters 'Greeks' and applied to the new Roman style - regular in the Application. Please see my screenshot for your reference.

    Screen Shot 2016-04-27 at 7.12.04 PM.png

    Please suggest a friend

    Thanks in advance

    Try this Grep (in my humble OPINION written by Martin Fischer)

    To find:

    [\x{0370}-\x{03FF}\x{1F00}-\x{1FFF}]+

    Replace with:

    'other' your character style

    Have fun

  • [JS, CS3] Please help - need to find text and then insert to find

    Hi all

    I have a clever script that I use to make fractions by inserting a textframe inline.  It has a dialog box that allows you to enter the numerator and the denominator.

    Now, I would like to change this script to search for fractions in the text (for example, 5/16) and replace this part with my textframe inserted automatically.

    The problem is I can not understand how to find the word containing the character slash and then to get the insertion point, so I can add my textframe as an inline.  Once I found the word with the slash (fraction), I think I can split the fraction in the slash content for the numerator and the denominator.  Just can't pop than textframe there at this time and replace the word.

    Have I made this pretty clear to anyone who might be able to help?

    Kind regards

    Len Swierski

    Hey Len,

    You sent me on a journey into the past. I wrote about this issue very soon after CS hit the street with JavaScript for the first time. On this page:

    http://www.pdsassoc.com/index.php?NAV=javassub&ban=SettingFractions&info=jstutorials/Setti ngFractions/index.html

    you will find that I think it's a relevant discussion. I required the user to select a slash but this is where you will be after your script has found a slash. I hope this helps. I was maybe a little pedantic on this page, but this is all very new at the time.

    Dave

  • With the help of FindChangeList.jsx - can't find text AND character style?

    I have been using the "FindChangeList.jsx" script in CS5 and it works well for what I need, except for one thing: ideally I want to pick up a piece of text with a certain style of applied character. Is it possible to do something like

    Text {findWhat: 'some text', appliedCharacterStyle: 'character style name'}

    I tried the above, but it is basically ignored the character style and found all of the text corresponding to the sentence (unknown what character style has been applied). Any ideas?

    Thank you very much. HJ

    Problem solved-, I made two mistakes. First of all, the style is a paragraph not one style style character, and secondly, it has been grouped into a folder. So I moved out of the folder and changed the code to ' appliedParagraphStyle: ' (and everything worked fine.:).

    Thank you. HJ

  • BlackBerry smartphones HELP! Need help with text and Email folders.

    Hi everyone, I just lost my cherry Blackberry today. I am the proud owner of the Curve 8900 and could not tell how much I love him. My previous T-Mobile G1 has nothing on this phone.

    In any case, here's my problem. I have two icons on my homescreen, the 1st is an envelope and the 2nd is an envelope with a globe in it. On the first envelope, I get my text, sms, mms AND gmail, a 2nd (envelope with globe) I only have my gmail. Is it possible to separate them so this icon of an envelope is only for text messages sms & mms and one strictly for my email only?

    I'm having a really hard time finding it.

    Thanks in advance.

    Raul.

    Hi Raul and welcome on the BlackBerry Forums

    The envelope is the main e-mail folder, and the envelope with globe is the specific folder for each e-mail account.

    To separate the e-mails and SMS follow this

    Go to the folder of main messages, press menu (the BlackBerry key logo), options, General options, SMS and Email Inboxes change to separate.

    Thank you.

  • Need help with text and image

    I'm working on adding an image as a background, he has been in a slight saturation. However I have text that I want to place on top of that and it becomes as light as the image. Can you please help me make the solid text. I am searching through all the effects of the text box, and it seems normal to 100%.

    Your help is very appreciated.

    Thank you

    Samantha B.

    Try to add a new layer and dragging the text boxes to this layer.

  • To the help of text and a bar of progress inside a ToolTip.

    Hello

    I try to get my ToolTip appears as: "percentage: progressBar," but don't know how to do. I did so that the progress bar appears with the help of some users on this forum, but do not know how to use the text with it. Here's what I have:
    import java.awt.Dimension;
    import java.awt.BorderLayout;
    
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JToolTip;
    import javax.swing.JProgressBar;
    
    public class ToolTip {
    
         private JFrame frame;
         
         private JButton button;
         
         private JToolTip testToolTip;
    
         private JProgressBar progressBar;
    
         public static void main(String[] var) {
              new ToolTip();
         }
    
         public ToolTip() {
              progressBar = new JProgressBar(0, 100);
              progressBar.setValue(5);
              progressBar.setStringPainted(true);
            
              testToolTip = new JToolTip() {
                   {
                        setLayout(new BorderLayout());
                        add(progressBar);
                   }
    
                   @Override
                   public Dimension getPreferredSize() {
                        return new Dimension(150, 20);
                   }
              };
    
              button = new JButton("herp") {
                   
                   @Override
                   public JToolTip createToolTip() {
                        return testToolTip;
                   }
                   
              };
              button.setToolTipText("A");
              
              frame = new JFrame("derp");
              frame.setSize(100, 100);
              frame.getContentPane().add(button);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
         }
    
    }
    Re-reading this I'm not so sure my point will get everywhere, so roughly what I want is something that could implement a JLabel and JProgressBar inside the same ToolTip, label and the bar showing up to their respectful of progression.

    Hmm... not quite sure where you see the problem: what's the problem with adding a component that shows the text that you want to show him? Something like

            testToolTip = new JToolTip() {
                JLabel label = new JLabel();
                {
                    setLayout(new BorderLayout());
                    add(progressBar);
                    add(label, BorderLayout.NORTH);
                }
    
                /**
                 * @inherited 

    */ @Override public void setTipText(String tipText) { label.setText(tipText); } @Override public Dimension getPreferredSize() { return getLayout().preferredLayoutSize(this); } };

    as indicated on the button, which shows the tooltiptext could add something with a fixed text as well, or you want to :-)

    See you soon
    Jeanette

  • With the help of text and buttons movieclips as buttons to point to the same layered framework?

    I'll have a terrible time with the 3.0 AS and animating CC 2015.2 in this project.  I was given a suggestion, but now I'm so confused output errors that I hope to get answers from you advanced people.

    The project is similar to this:

    Identify the Structure of the trees

    Framework 1 - nothing selected, visible instructions

    Frame 2 - Select sheets by clicking on the image (tree top or bottom) or text, leaves description becomes visible

    Frame 3 - branches select by clicking on the image (tree top or bottom) or text, description branches becomes visible

    Frame 4 - trunk select by clicking on the image (tree top or bottom) or text, description of trunk becomes visible


    Suggestion is:

    Do the video clip of each region of image tree and drop it on the layer smaller on top with alpha 0%

    Create a badge of the clip, and then tap on timeline with each framework has put in evidence and description

    Make the text button, then tap chronology framework with each has put in evidence and description

    Trunk frame – more small area place top layer

    Branches Frame - smaller than the leaves but superior to the place of the trunk between the two

    Framework of leaves - most square of the area on the layer under the Branches

    Can anyone offer any suggestions?  I used to program 5.5 Flash with Actionscript 2.0, but difficulties with Animate and Actionscript 3.0.  I don't know if I have to use swaps or specific images, but when viewing, he travels all frames without stopping even if each image as the AS command stop ();

    Thanks in advance!


    Rick

    Tree-Example.png

    Yes, if your buttons or movieclips, overlap one on top Gets the default click event. So, if you decide to create separate movieClips or separate buttons, be sure to give everyone an exclusive space.

    One approach I've used in the past for such things is to open the work, the tree in Photoshop then "cut" art into segments and put each segment in a different layer in Photoshop. Then you can import that art directly in to animate and each layer will import under a separate post. Then you can combine them into a movieClip to a work of art on the stage. From there, you can select each segment and each a movieClip or button you want.

  • 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

  • I need serious help please... We do translations of textbooks, I searched an excessive type function but have been unable to find, we are working in indesign CS 5. It takes allot of time to delete the text and type in the new language.

    I need serious help please... We do translations of textbooks, I searched an excessive type function but have been unable to find, we are working in indesign CS 5. It takes allot of time to delete the text and type in the new language.

    Argh it's frustrating! I never noticed that the key was not working in InDesign.

    A bit of research and it turns out that the MS Office has this as an option in their software. But I can't find an option in the InDesign preferences to make it work.

    However, somethings do not appear in the shortcuts and preferences and are hidden triggers in InDesign that are accessible via a script.

    I'm not saying that it is possible to activate the button insert by using a script, but it is plausible that he can be activated.

    Maybe ask on the forum script? Scripting InDesign

    I know that this may be a possibility as with InDesign prior to export PDF documents interactive versions, there was previously no way to export PDFs interactive as unique pages if the gaps of.

    But the option to toggle this setting was scriptable.

  • 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.

  • Script to search for text and remove the hyperlink and characterstyle link which applies (back to normal)

    I need help with my script to search for text and remove the hyperlink and characterstyle link which applies (returns the normal text).

    I can't do either as I want.  I want the user to be able to type in a dialog text they want to search for, do search this text IGNORING case (case insensitive) and then for all instances that he find it, remove character styles that are applied to the (set to [none]) and delete the hyperlinks.

    My code seems to define the character style [None], when I click on the text and look at the window of character Styles, BUT all old styles (font color, underline) are always applied and removed not as I want.

    Also, I can't understand how to remove all of the old links.

    Here is my code:

    myDocument var = app.activeDocument;

    var noneStyle = myDocument.characterStyles.item ("[None]");

    var myFindVal = "";

    var myErrorText = "";

    var myErrorCount = 0;

    myDialog = app.dialogs.add var ({name: "search user submitted text and delete hyperlinks from objects found.", canCancel: true});

    {with (MyDialog)}

    {with (dialogColumns.Add ())}

    {with (borderPanels.Add ())}

    staticTexts.add ({staticLabel: "search and delete hyperlinks for :"}); "})

    myTextBox var = textEditboxes.add({minWidth:100});)

    }

    }

    }

    If (myDialog.show () == true) {}

    myFindVal = myTextBox.editContents;

    doSearchAndReplace();

    app.findTextPreferences = NothingEnum.nothing;

    app.changeTextPreferences = NothingEnum.nothing;

    If (myErrorCount == 0) {}

    Alert ("done! ("Part of the links have been removed for: '" + myFindVal + ""! "");

    }

    else {}

    Alert ("last error: '" + myErrorText + "' & number of errors:" + myErrorCount);

    }

    }

    myDialog.destroy ();

    function doSearchAndReplace() {}

    app.findTextPreferences.findWhat = myFindVal;

    app.findChangeTextOptions.caseSensitive = false;

    app.findChangeTextOptions.includeFootnotes = false;

    app.findChangeTextOptions.includeHiddenLayers = false;

    app.findChangeTextOptions.includeLockedLayersForFind = false;

    app.findChangeTextOptions.includeLockedStoriesForFind = false;

    app.findChangeTextOptions.includeMasterPages = false;

    app.findChangeTextOptions.wholeWord = false;

    var myFoundItems = myDocument.findText ();

    for (i = 0; i < myFoundItems.length; i ++) {}

    myRemoveHyperlinkAndStyle (myFoundItems [i]);

    }

    }

    function myRemoveHyperlinkAndStyle (myFoundItem) {}

    try {}

    myDocument.hyperlinkTextDestinations.item (myFoundItem) .remove ();

    myDocument.hyperlinkTextSources.item (myFoundItem) .remove ();

    myDocument.hyperlinkURLDestinations.item (myFoundItem) .remove ();

    myFoundItem.applyCharacterStyle (noneStyle);

    }

    {catch (MyError)}

    myErrorCount ++;

    myErrorText = MonErreur;

    }

    }

    Hello

    Right, some hyperlink might be a pageItem...

    expand the 'if' condition with:

    If (myHyp [len].source.hasOwnProperty ("sourceText") &... content ==...)

    Jarek

  • Search / replace the text and then apply ParaStyle

    Hello world

    Any thing we can find text like "[FT], [FBI], [FISH]" and apply a paragraph style "FISH_Text note, BList", only once.

    We have all files MS is going this kind of circumstances, not just any style of paragraph apply in these files-MS.

    Screen shot 2012-03-28 at 5.03.52 PM.png

    Thank you! I appreciate your help and explanation Adv.

    I see that you asked this over a week ago. Sorry for not noticing - who should post disappeared from the page fast actual coverage.

    It didn't need to script in itself. Using GREP find/replace, search for this:

    \[FT\] (.)

    and replace with this:

    $1

    -with your paragraph style defined in the change Format field.

    Script unproven to do lots of these (warning: I do this as I type):

    var changelist = [ [ "FT", "Footnote"], [ "FBL", "BList"], ["FISH", "FISH_Text"] ];
     app.findGrepPreferences = null;
     app.changeGrepPreferences = null;
    
     app.changeGrepPreferences.changeTo = "$1";
    
    for (i=0; i		   

Maybe you are looking for

  • I keep getting pop up windows to update my browser Firefox 5 then 6 and now 7... Is it a scam?

    I get popup boxes (not firefox or mozilla logo) saying Firefox beta 5 (at the beginning) and then beta version 6 and version 7 beta now available and asking me to download and install. I suspect a pfishing or for the worse, but some functions in my v

  • Panel.VI printing using versions 6.1 and 8.6

    I have a large version 6.1 program that uses print panel.vi to print a report long text to the default printer, which is where print impressions from panel.vi; However, I need to change the default printer so that I can use this vi to print on severa

  • Age of Mythology CD 2

    I have the game Age of Mythology Gold edition.  However the second CD don't exceed 61% because there is a small hole in the cd.  Could I get a replacement given the closest place to get this game is 250 miles...  I have the CD key and two discs.  All

  • Error loading C:\Windows\eqiqitej.dll.

    Whenever I start my computer I get this message. Can someone tell me what it is? What type of filling is? IE: file system OS or drivers and utilities.  How to fix?

  • Update on p6110y Office

    I recently got the game diablo 3.  I know I need to update my video card, my CPU and maybe my diet.  As I am not very computer I was hoping you could give me some ideas. Thank you.