Counting specific words aspect for statistic (CS3)

Hi! everybody!
I'm looking forward a script using Adobe "Extend Script Toolkit", that could allow me to count (statistics) all specific colored words (in red in my case) that I have in my Indesign CS3 document.
A friendly French guy sended me that script test code but it didn't work fine on Extend Script Toolkit
Déclarer variables
var_Compteur [entier]
var_Attribut_Couleur_Mot [string]
var_Mot  [string]
Initialiser variables
var_Compteur = 0
var_Attribut_Couleur_Mot = ""
var_Mot =  ""
Début boucle Tant que
var_mot = non  vide
si var_Attribut_Couleur_Mot = "Rouge"
alors var_Compteur = var_Compteur +1
=> mot  suivant
Fin tant que
Fin Boucle
Afficher var_Compteur
Please help!!!!!
Thanks a lot!

Here the code done by peter (megathanks!!!) :
app.findTextPreferences =  null;
app.findTextPreferences.fillColor =  "red";
//set some options here
app.findChangeTextOptions.caseSensitive =  true;
app.findChangeTextOptions.wholeWord  =  true;
app.findChangeTextOptions.includeFootnotes = true;
alert   (app.activeDocument.findText().length);
Sadly the script don't work I got an error to the line 2 : app.findTextPreferences.fillColor =  "red";
could someone tell me what is wrong?
Again thanks a lot to Peter

Similar Messages

  • Find word in text file and count specific words

    now I'll try to explain what I need to do. I have file.txt file, It looks like:
    John //first line - name
    One
    Three
    Four
    Peter //first line - name
    Two
    Three
    Elisa //first line - name
    One
    Three
    Albert //first line - name
    One
    Three
    Four
    Nicole //first line - name
    Two
    FourSo I have program's code:
    public class Testing {
            public static void main(String args[]) throws Exception {
                Scanner input = new Scanner(System.in);
                System.out.println("Select word from list:");
                System.out.println();
                try {
                    FileReader fr = new FileReader("src/lt/kvk/i3_2/test/List.txt"); // this is list of words, everything all right here
                    BufferedReader br = new BufferedReader(fr);
                    String s;
                    while((s = br.readLine()) != null) {
                        System.out.println(s);
                    fr.close();
                    String stilius = input.nextLine();   // eneter word which I want to count in File.txt
                    BufferedReader bf = new BufferedReader(new FileReader("src/lt/kvk/i3_2/test/File.txt")); // from this file I need to count word which I entered before
                    int counter = 0;               
                    String line;
                    System.out.println("Looking for information");
                    while (( line = bf.readLine()) != null){
                        int indexfound = line.indexOf(stilius);
                        if (indexfound > -1) {
                             counter++;
                    if (counter > 0) {
                        System.out.println("Word are repeated "+ counter + "times");}
                        else {
                        System.out.println("Error...");
                    bf.close();
                catch (IOException e) {
                    System.out.println("Error:" + e.toString());
            }This program counting specific word (entered by keyboard) in file.txt.
    I need to make this program: for ex.: if I enter word: One It must show:
    Word One repeated 3 times by John, Elisa, AlbertAll what I need to elect by who this word repeated. But I don't know really how to make It, maybe LinkedList or I dont know, someone could help me?
    Thank you very much.

    966676 wrote:
    All what I need to elect by who this word repeated. But I don't know really how to make It, maybe LinkedListYou should choose the simplest type fullfilling your needs. In this case I'd go for <tt>HashSet</tt> or <tt>ArrayList</tt>.
    or I dont know, someone could help me?You need to introduce a variable to store the actual name which must be resetted if an empty line is found and then gets assigned the verry next word in the file.
    bye
    TPD

  • How to Create a batch file to display and count specific words in log file

    Hi All,
    I have requirement Program to be written that will go through a log file and look for following key words.
    Unexpected Essbase error
    And also it will count the # of times the word error appear in a log file.
    You may use batch file or Perl script to complete this task.
    e.g. in the log file - It will flag yes that keyword "Unexpected Essbase error" found and word error occurs 9 times.
    Pls help me in know process to achieve above requirement.
    and pls let me know what is perl scripting ?
    Thanks in Advance
    Regards,
    SM

    Sorry but it sounds like you have been asked to do something and you have pasted the requirement on the forum, have you done any research to find out which scripting language you are going to use or any find examples, there are so many differents examples and help on the internet it just takes a little bit of time and investment.
    Cheers
    John
    http://john-goodwin.blogspot.com/

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

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

    To search local files of a Defined Site in DW...
    Open the Find & Replace tool with Ctrl + F
    Change the Find In dropdown to Entire Current Local Site
    Change the Search dropdown to Text or Source code
    Add the text to find in the Find field
    Add the text to replace in the Replace field (or nothing if you just want to delete the text)
    Hit Replace All

  • When using spotlight search on my 5s it will not show past text messages that haven't even been deleted even if I type a specific word that I know is in a message I want to search for. I have message search turned on in the spotlight settings.

    When using spotlight search my phone will not show all text messages with a common word even though I have not deleted any messages from my phone and I have the message search turned on in settings under spotlight search. The search only shows the messages that are recent within the past day or so. Why won't it show the other messages when I search for them even using a specific word that I know was in the message I'm searching for.

    Hello ChiomaM,
    It sounds like you are not getting notifications for new text messages that are coming in, and you must manually check the app. I recommend checking the Notification settings to see if they are configured correctly:
    iOS: Understanding notifications
    http://support.apple.com/kb/ht3576
    iOS apps can provide three types of notifications:
    Sounds: An audible alert plays.
    Alerts/Banners: An alert or banner appears on the screen.
    Badges: An image or number appears on the application icon.
    You can view which apps provide notifications and adjust notification settings using Settings > Notification Center. For additional information, refer to the user guide for your device.
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • HT5176 Can i teach dictation specific words, since i want to use it for some technical things???

    I think that dictation is the most useful tool in iOS, but I want to teach some specific words that it doesn't recognize me. Specifically some medical words. How do I do that?
    Thanks for the help.

    The password  you need to use is your admin password you set up for your user account on your computer.

  • EXIF plugin for Photoshop CS3 MAC version

    Hello everyone,
    Question: Does anyone know of an industry-standard, reliable EXIF plugin for Photoshop CS3 for MAC? I already have an EXIF tab in my File > File Info tab, but I specifically need a plugin that reads Shutter Actuations from an image. I need to know how many times a camera I just bought has been fired.
    Rambling Backstory:
    I just bought a used Canon 1d Mark II on eBay, and I think it may have been misrepresented in the auction. The seller claimed that the camera only had around 29,000 shutter actuations.
    She based this number on a program called "Cancount." When I received the camera, I took a test shot, and attempted to download cancount. Unfortunately, I ended up on some German web site, which asked me for 13 euros to download it.
    Instead, I downloaded the free, and much more detailed Simple EXIF reader for Mac. This program said the camera was closer to 160,000 shutter actuations.
    Here's the screenshot:
    http://farm4.static.flickr.com/3295/2681473080_c22f82591f_o.png
    All I want to know is which program is more reliable, Cancount or Simple EXIF reader. OR, does anyone know of an industry-standard EXIF reader that everyone agrees gives a reliable shutter actuation count? Thanks everyone.

    Maybe i am looking at something different here,but i usually check my frame count under photoshops file- info ,and once there i go to advanced,and under the fourth arrow called http-exif, i can see my frame count. it says aux-image number. not sure if that will help you.

  • InDesign won't count my words

    I'm using ID CS3 5.0.4 on a MacBook running OS 10.5.8.
    I go to info to get the word count of my text, but it won't give me the entire word count. I can select some text and it will count the words. BUT, if I select the entire text of the story it won't cound the words. It gives blank results for charaters, lines, words, and paragraphs. Same results in Story Editor. It won't give me any information if I select all. Can anyone help?

    For a long text it may take a moment to count. If that isn't it, try trashing the prefs. see Replace Your Preferences

  • Use AppleScript to remove a specific word/phrase from Multiple Folder names

    Within one of my folders I have hundreds of Folders that have specific words or phrases in the names I would like to remove using apple script.
    For instance if the folder names all contain the word "Default" what script could I write to remove "Default" from the names of all folders with it in the name.
    So, if folder is named "bobDefault"  how could I get it to remove Default and keep bob and then continue on the rest of the folder names within the main folder.  I appreciate any help you may provide.

    The following should do the trick (if there's always a space before the left parenthesis):
    set theFolder to choose folder
    tell application "Finder" to set theNames to name of folders of theFolder
    set theNewNames to {}
    repeat with thisName in theNames
         set P1 to offset of "(" in thisName
         set P2 to offset of ")" in thisName
         if P1 * P2 > 0 then
               try
                     get (text (P1 + 1) thru (P2 - 1) of thisName) as integer
                     set theString to text P1 thru P2 of thisName
                     set thisName to replace(space & theString, "", thisName)
               on error
                     -- no change
               end try
         end if
         copy thisName to the end of theNewNames
    end repeat
    tell application "Finder" to repeat with k from 1 to (count theNames)
         try
               set name of folder (item k of theNames) of theFolder to (item k of theNewNames)
         end try
    end repeat
    on replace(A, B, theText)
         set {TID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {A}}
         set {theTextItems, AppleScript's text item delimiters} to {text items of theText, {B}}
         set {theText, AppleScript's text item delimiters} to {theTextItems as text, TID}
         return theText
    end replace

  • How to find a specific word in sentence in each line?

    How to find a specific word in sentence in each line and output will show start from the beginning from specific word plus with small description from each sentence?
    For example: I need to find a "+Wednesday+" and "+Thursday+" word in each sentence by line by line from "myfile.txt".
    Go ballet class next Wednesday.
    On the Wednesday is going to swim class.
    We have a meeting on Thursday at Panda's.
    Then it will show the output:
    Wednesday : ballet class
    Wednesday : swim class
    Thursday: meeting at Panda's
    I am going to figure out in Java console to read from a file for specific word from each line and how to make it output in correct way. I know already to make input/file codes.

    I got it and understand much better. Thank you very much. There is a problem with it because I knew how to make
    a specific word in sentence but how I should make Output for specific word and some words from sentence.
    For example:
    Input:
    +"On Thursday go to ballet class"+
    +"Swim class on Friday one time a month at 2 p.m."+
    I used the codes for that:
    class FindSchedule{
         String firstline = "On Thursday go to ballet class ";
         String secondline = "Swim class on Friday one time a month ";
         FindSchedule(){
              System.out.println(firstline + findTheIndex("Thursday", firstline));
              System.out.println(secondline + findTheIndex("Friday", secondline));
         public int findTheIndex(String word, String sentence){
              int index;
              index = sentence.indexOf(word);
              return index;
         public static void main (String[] args){
              new FindSchedule();
    }The output will be:
    Thursday: ballet class
    Friday: 14:00 swim class one time a week
    Notice that time is changing in output complete different from input.
    I need to find out how to extract some words from each sentence for output. Do you know how to do it?

  • Can't Place a specific Word 2010 docx into InDesign CS4

    I'm trying to use the Place command to bring the text from a specific Word 2010 docx into InDesign CS4.
    I've successfully brought in several Word 2010 documents (docx extention) to InDesign CS4 documents using the place command.
    I have one specific 30 page document (which is no loarger than others which have been successful), and when I use the place command with this file, nothing happens (and no text gets loaded onto the cursor for placement.
    I've tried re-saving the word doc, even pasted its contents into a new Word doc and still can't get the Place command to work.
    THere's nothing particularly unique about the file - doesn't have any odd embedded content, just a 30 page text document writtin in word.
    Any ideas what could be going wrong or how to fix it?
    I've tried restarting both Word and InDesign without any change (and the rest of my word files can be Placed without problem, so I imagine it's something specific to that file.
    NOTE - re-saving in RTF format lets the Place command work but leaves a bunch of empty squares/boxes (not sure if these were for tabs or empty spaces or what really??)
    Can work around this for now, but would like to know how to get the place command working with decent size Word Docs( docx for word 2010 if that matters).
    Thanks for any help.

    It turned out that for at least one particular document the OP had used some blank paragraphs as spacers at the start of the text, and that the style assigned to the second paragraph used a combination of left and right paragraph indents that was more than the width of the document page, sending the entire document (except for the empty first paragraph) into overset. I can't say for sure, but I think the Word styles might have been mapped to ID styles because I found no trace of the indents in the Word file itself, only in the ID document, and I had no trouble placing that Word file in my own ID test document. I did have some trouble placing another .docx file supplied by the OP in CS4, but not in later versions, and conversion to .doc solved that problem.

  • How to highlight specific words in the Reader

    Hi!
    I am new to the Acrobat SDK and could need some guidance on how to solve the following problem:
    I need a plug-in that is able to highlight specific words in a pdf file (e.g. by underlining it or changing the background color) and offers a context menu with futher actions when the user clicks on a highlighted word. The first step would be searching the text to find the word that should be marked. I think that should not be that hard but how can I highlight specific words? I first thought of annotations but I need it in the Reader and I should not change the pdf file itself (just the view of it).
    The idea is similar to the skype plug-in for Firefox or IE. The skype plug-in highlights phone numbers. We need to highlight specific words.
    Thanks for every hint on how to achieve this!
    Fabian

    >The documentation says that AVPageViewHilightText is supposed to use >the current color set with AVPageViewSetColor - so it should work. >What version of Acrobat are you working with?
    Yes that how understood the documentation too. I tried the following:
    //Define red
    red.space = PDDeviceRGB;
    red.value[0] = ASInt32ToFixed(1);
    red.value[1] = 0;
    red.value[2] = 0;
    // highlight
    AVPageViewSetColor(pageView, &red);
    PDTextSelect pdTextSelect = PDDocCreateTextSelect(pdDoc, pageNum, &bbox);
    AVPageViewHighlightText(pageView, pdTextSelect);
    I am using Acrobat 7.0.9.
    >Drawing an image would be done with AVPageViewDrawCosObj
    >- which means you'll need to bring the image in as a PDF
    > object and then render it.
    Oh I should have seen that. Thanks for the hint!!
    >Interesting, there should be a way to get transparency,
    > but I am not seeing it at the moment.
    As far as I understood it, it is possible to set the color to transparent but thats not what I am looking for. I would like to have a way of changing the alpha channel of the color.
    Thanks!
    Fabian

  • How do you find a table that doesn't have a specific word in it.

    I have two questions.
    questions 1
    How do you find a table that doesn't have a specific word in it by using a query on the whole database?
    questions 2
    How would i list all of my cars names in my database not showing duplicates?
    I have tried, tried and tried some more to get both of these, but I guess i don't know how to query a specific word.
    I also don't know how to query everything in just 1 column name.
    If anyone could help with these that would be great I have been trying queries for over an hour now and no luck.
    Thanks

    798837 wrote:
    I tried the all_tab_columns, just like you did it, however that just gives me the column name I am looking for what is not in a column.
    For example I need to find all the tables where mustang is not = 'red' but using a single query i need to find all of the tables.
    As for number 2
    I am looking for something like this
    select distinct column_name
    from all_tab_columns
    where column_name ='AcertainColumn';Now I'm even more confused. In your example, is MUSTANG a column name? Or is it the value of a MODEL column in the CARS table? And how could that possibly relate to something that exists in multiple tables?
    If your data model is at all reasonable, I would expect that you would just want
    SELECT *
      FROM cars
    WHERE model = 'Mustang'
       AND color != 'Red'but I can't see how this would relate to data stored in multiple tables.
    Justin

  • Find a specific word in a directory

    Hi Folks:
    I am trying to develop a apps, with the following functionality:
    To find for a specific word, like S010101, into a specific directory, saying something like: c:\Docs.
    And return, the number of ocurrences or, true if the string was found into a directory files or the name of the files wich include the string.....
    Can be possible with Oracle Forms or maybe with webtoolkit or with java and forms implementation?
    any ideas?
    Thanks a lot in advance
    Abdel Miranda
    Panama
    Edited by: aemsmeg on Jan 7, 2009 8:30 AM

    Hi Francois:
    Maybe I am trying to do something wrong, so let me give you a picture about my requirements and see if what I'm trying to do is on the rigth way.
    In my work, we have 4 environments: DEV, SYS, PRE and PROD. All of them has its own Schema and Objects, which are the same but they can have [and it is usual] different data stored.
    And, for every environment we have a migration directory with a tree like this:
    M:\\Apps\Request\S0001\DB\S0001_db.zip
    M:\\Apps\Request\S0002\DB\S0002_db.zip
    M:\\Apps\Request\S0003\DB\S0003_db.zip
    ................. and so far.
    Those zip files can have a sql files with a scripts which creates, modify, database objects and, the main issue, creates a customize user errors like: USR-xxxxx, VTM-xxxxx.
    As I wrote before, we have four environments, and I need to have track of which user errors codes are created and which one are available to use.
    By example, in DEV, the last user error code is USR-0005. If one of my developer need to generated the next user error code, he can select the max code where error type like USR. But maybe, another developer can generate the next user error code, in this case USR-0006. The developer team will not know where is the last error code generated, unless it find into the migration directory inside all of the zip files to see if exist in one of them, the insert for the next error code.
    I was thinking to develope a automatic ganeration form, where the developer, press a button. See the last error code and next error code related to a error type [USR, VTM].
    And then, press another button, select the migration directory [DEV, SYS or PRE] and find the string "USR-xxxxx" only in the qms_message.sql only in the _db.zip in the migration directory and all its sub directories.
    I am not sure If I am explain myself properly.
    Thanks a lot and any help, I will appreciated.
    Abdel Miranda
    Panama
    Edited by: aemsmeg on Jan 15, 2009 1:56 PM

  • How do I select a specific word inside a TextFrame?

    I want to highlight a word inside a TextFrame, but I'm only able to select the entire frame.
    I have tried something (and several related version) like this:
    var textFrames:com.adobe.indesign.TextFrames = activeDocument.textFrames;
      for(var i:int = 0; i < textFrames.length; i++){
      var t:com.adobe.indesign.TextFrame = textFrames.item(i);
      var texts:com.adobe.indesign.Texts = t.texts;
        for(var j:int = 0; j < texts.length; j++){
          var text:com.adobe.indesign.Text = texts.item(j);
          app.select(text);
    This selects the entire content of the area, instead of just a specific word.
    How do I proceed? Thanks

    To clarify: I dont know which TextFrame the string is within - hence i look through all frames.
    I have tried implementing the suggested ideas - mainly doc.findText() as:
    app.findTextPreferences.findWhat = word;
    var w:Object = doc.findText();
    The problem is the findText() returns object of all types, and I cannot figure how to get it working. Below is my current solution, working like a charm, though probably not the most efficient implementation.
    public static function select(word:String):void{
      var app:Application = InDesign.app;
      var activeDocument:Document = app.activeDocument;
      if (!activeDocument){
      return;
      var textFrames:com.adobe.indesign.TextFrames = activeDocument.textFrames;
      for(var i:int = 0; i < textFrames.length; i++){
      var t:com.adobe.indesign.TextFrame = textFrames.item(i);
      var words:Words = t.words;
      for(var j:int = 0; j < words.length; j++){
      var selector:Word = words.item(j);
      if(selector.contents.toString() == word){
      selector.select();
      return;

Maybe you are looking for