Find specific word in MS Word, copy containing paragraph, paste to Excel

Hi, I'm a complete newbie to programming and scripting, and I searched a bunch of forums for this question and found something similar, but never the full answer neither for automator nor Applescript.
Please help me do this kind of operation.
1.Search a 200-page MS Word document for a specific word.
2.Select the whole paragraph containing the word and copy it to clipboard.
3.Paste this paragraph to Excel document(the next cell in the column)
Basically, I need to analyze the mood of the paragraph with mentioned word in a massive of irrelevant info. And I want to get a nice column in Excel so I could filter all the useless information.
Please help me create this script and/or give me some links where I can read something similar.
Thanks in advance.

Hello, I'm also a total newbie to scripting (started about a week ago).
I tried to work out how to do what you asked using my very limited knowledge and managed to create a script that it very long and clumsy and only works half the time. I'm not certain it does exactly what you want either..
set x to text returned of (display dialog "What word would you like to search for?" default answer "")
tell application "Microsoft Word"
activate
tell application "System Events"
set CR to ASCII character of 13
keystroke "f" using command down
keystroke x & CR
delay 1
keystroke "w" using command down
delay 1
key code 126 using {command down, shift down}
delay 1
keystroke "c" using command down
delay 1
end tell
tell application "TextEdit"
activate
tell application "System Events"
keystroke "n" using command down
keystroke "v" using command down
tell application "Microsoft Word"
activate
tell application "System Events"
key code 125 using {command down, shift down}
delay 1
keystroke "c" using command down
end tell
tell application "TextEdit"
activate
tell application "System Events"
keystroke "v" using command down
keystroke "a" using command down
keystroke "c" using command down
tell application "Microsoft Excel"
activate
delay 3
tell application "System Events"
set CR to ASCII character of 13
keystroke "v" using command down
CR
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
Haha I doubt that helps but I felt like trying anyway...
Other stuff:
When the dialog box comes up at the beginning, for some reason it wont run the script properly if you press enter so you have to actually click continue.
Also I made it copy to TextEdit instead of clipboard as I cant seem to find that on my computer.
I hope someone with more knowledge than me comes along soon!

Similar Messages

  • How to finds specific words in each sentence?

    import java.io.*;
    import java.text.*;
    import java.util.*;
    public class FindingWordsSpecific {
         static String[] days = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "every Tuesday"};
      public static void main( String args[] ) throws IOException {
               // the file must be called 'myfile.txt'
               String s = "myfile.txt";
               File f = new File(s);
               if (!f.exists())
                    System.out.println("\'" + s + "\' does not exit. Bye!");
                    return;
               BufferedReader inputFile = new BufferedReader(new FileReader(s));
               String line;
               int nLines = 0;
               while ((line = inputFile.readLine()) != null)
                    nLines++;
                   System.out.println(findTheIndex(line));     
               inputFile.close();
           public static String findTheIndex(String sentence){
                String result = "";
                String[] s = sentence.split("\\s");
              for (String s1: s){
                   for (String s2: days){
                        if (s1.equalsIgnoreCase(s2)) {
                             if(s2.matches("every Tuesday")){
                                             }else if (s2.matches("every Wednesday")){
                                              }What is wrong with it because I tried to find "every Tuesday" in
    myfile.txt: "Go fishing every Tuesday and every Wednesday"
    There is big problem with split statement because it takes each word not more than a word.
    I need to have "every Tuesday" not "Tuesday". How to make it correct codes?

    I am going to give you a picture of how the output will look.
    Here are two sentences from myfile.txt:
    Go fishing every Tuesday and every Wednesday
    Meet with research students on Thursday
    I need to read from myfile.txt and to find specific words in each sentences like this output:
    Every Tuesday : Go fishing
    Every Wednesday : Go fishing
    Thursday : Meet with research students
    Ok. make sense? Now I am trying to figure out how to find specific words in each sentence from myfile.txt.
    That is why I have difficult with the splits statement and loops. Like this:
           public static String findTheIndex(String sentence){
                String result = "";
                String[] s = sentence.split("\\s");
              for (String s1: s){
                   for (String s2: days){
                        if (s1.equalsIgnoreCase(s2)) {
                             if(s2.matches("every Tuesday")){
                             }else if(s2.matches("every Wednesday")){
                             }else if(s2.matches("Thursday")){
                             }else{
                                  System.out.println("That sentence is not working");
                return result;
      }So look at the "Thursday" it is working the output because I have split statement to give me only one word not more than
    a word in sentence. So there is big problem with more than a word in sentence like this "every Tuesday" and it won't work at all because of split. Could you please help me how to do that? I appreciated for that help. Thanks.

  • Copy dimension and paste in excel

    Hello everyone,<BR>I cannot copy a dimension in EAS console and paste in excel which I can do with App Manager. All I want is to see the members in excel with the parent child relationship. I cannot use outline extractor on this cube for some reason, is there any other way?<BR>Thanks for your great help,<BR>Rama

    why not do a zoom in to all levels on the dimension using navigate without data. If you indent sub totals or totals, you can see the relationship. You can also write a quick macro to move the members to different columns based on the number of space before the member name. <BR><BR>Aside from that you could use the API to go against the grid api to walk through the hierarchy

  • Search & Spotlight not finding specific words

    I have a friend who has a G5 and is running the latest version of Tiger. She has 2 related jpg files---one for the normal size (labeled wallpaper.jpg) and the other is a thumbnail (labeled wallpaperthumb.jpg). When she searches for "wallpaper" both files come up, but when she searches for "thumb" nothing comes up. She's used search and spotlight...both have the same results.
    We've zapped the pram, repaired permissions, trashed the finder, and dragged the volume to the privacy tab in spotlight and then removed it. What's next?????
    Please help! Thanks!

    If you are searching for a string in the filename not set off as a separate word by punctuation, space, or change of case, you need to use ⌘ F Finder search.
    Click on the criteria button (Kind, or Last Modified) and select 'Name'. On the same line (in the space on that line) you can enter the string you are looking for.
    If my post was helpful or solved your issue, please mark it accordingly

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

  • 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

  • The Firefox find function seems to have become CAPS or non-caps specific, so that typing a word in non-caps will not find matching words with one or more capital letter.

    The find function seems to have changed in Firefox. Before, when doing a (CTRL + F) find, the search was not CAPS-specific or non-caps-specific. In other words, if I typed in "firefox" (no caps), it would find the words "firefox", Firefox", or "FIREFOX", regardless of capitalization. Now, however, the find function will only match the exact same capitalization. This totally undermines the usefulness of the function, and is a major hassle. Please fix it.
    == This happened ==
    A few times a week
    == I noticed in in the last two or so weeks.

    I am having a similar problem. The following page has the word Dangerfield in several times. My browser will get to Dang and turns pink
    http://www.genuki.org.uk/big/eng/HEF/ProbateRecords/WillsD.html
    Is it my Browser or is there a problem with Mozilla?
    I have also noted on other Google searches the same problem. Te term is listed in the page but Ctl F will not find the term

  • Need help to find GPOs with a specific word

    Hi Experts,<o:p></o:p>
    In my environment, we have 500+ GPOs and I have been asked to find the GPOs with a specific word like "dns". I believe powershell is the better way to find my requirement and I
    am in KG standard in Powersell :(<o:p></o:p>
    Thanks
    Sajoor

    Get-GPO (From the GroupPolicy module) doesn't allow for wildcards in the -Name parameter, so the best you can do with that cmdlet is something like this:
    Get-Gpo -All | Where {
    $_.DisplayName -match 'dns'
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • 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 can I find a text box with a specific word in it ?

    Hi,
    I have hundreds of settlement names on a map created with the text tool. How can I search on the name of one of them and find it on my map ?
    I am with FH9 but the method would no doubt be backwards compatible from MX. If it isnt I would launch MX just for this exercise.
    Would this also work if the word was part of a text box text ?
    I have the luxury of it being the entire text box !
    Cheers
    Envirographics

    If you have one large text box to search for the word, select it, then go to EDIT>FIND & REPLACE>TEXT...
    Type in your word and click FIND NEXT button.  If you have multiple occurances of the name, keep clicking the FIND NEXT button until the word hilites.
    If you have scattered text boxes on your map, don't select any of them but still go through the EDIT>FIND & REPLACE>TEXT... routine I mentioned. FreeHand will look through all text boxes to find your word.
    Oh yeah, this works the same in FreeHand 8 thru FHMX.

  • 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

  • Find/Change words (with GREP) and apply a style...

    I need a Script for Find/Change words with GREP, and apply a paragraph style...
    Thanks...

    Hi Marcos,
    If you want the script to create character styles: Bold , Italic, Bold Italic, etc, and replace local formatting with these styles, use scripts in post #3.
    But if you want find and change words, or/and replace local formatting with styles defined by you, use FindChangeByList script.
    If the latter, I recommend you to download and install Record Find Change script (written by Martin Fisher).
    Then choose settings you need in Find-Change dialog – make sure they work as expected – and run Record Find Change script. A Notepad/TextEdit file will pop up with a line containing the recorded setting. Copy it, open FindChangeList.txt, delete the contents of this file and paste the line you just copied (or add it to the bottom of the file).
    Repeat the process for all find-change operations you need.
    Finally run FindChangeByList.jsx to make all changes in one go.
    However, while using Record Find Change script, you may encounter a problem: it doesn’t record paragraph and character styles placed inside a group. But you can write references to such styles like so:
    appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Style Group 1"). paragraphStyles.item("Paragraph Style 1")
    Kasyan

  • How to find certain words based on table

    Hello,
    I have a list of words available in one particular table, based on those records i need to match it up with one specific column on another table. Based on that match i need to update the same. Please see the example for your reference in the excel file.
    Please do let me know if you need further clarifications.
    https://www.dropbox.com/s/fy5oj5r4feipqrw/Certain%20word%20sample.xlsx?dl=0
    Vinwin
    VinWin06

    One more question just out of curiosity is it possible to find out any object name or thing based on the text from table 1. Like there is no table 2 available to contain words to find the relevant records, so we have to find the words from the table 1 and
    those words mainly are any objects or a thing like bolts,shaft,spanner etc.
    Is it possible to do, always welcome to your suggestions.
    VinWin06

  • Spotlight can't find a word in an Excel document?

    I'm sure someone has addressed this before, but I'm not sure which search words to even begin to try looking for my answer, so I'm just posting fresh. Apologies if this comes up day in and day out on here!
    Basically, there are several files that I KNOW contain certain words in them, but they remain unseen by Searchlight. I've had my volumes all re-indexed, but still no luck.
    Is it my misunderstanding that Searchlight should be able to find, for example, an Excel document with a particular word in it (not in the filename, but a word IN the Excel doc)? I thought that was the glory of Searchlight as compared to regular ol' Search.
    Anyone?

    Thanks for the link. The case mentioned there is quite similar to mine, with the difference that opening a Word document and selecting a word won't make it visible for Spotlight (unlike the poster's case).
    I tried what you suggested and here's what happened:
    1-Chose the unique word "Splitz" and Spotlighted it. Nothing came up.
    2-Created new Word, Excel, PowerPoint, Pages, and Keynote documents; typed the word "Splitz" at the beginning of each document, and didn't input any more information that the unique word.
    3-Saved all documents under the title "Haravatska" (another unique word) and even made sure their extensions were visible.
    4-Spotlighted the unique title "Haravatska": all documents with that title were found.
    5-Spotlighted the unique word "Splitz": no results.
    6-Opened the Word document titled "Haravatska" with the unique word "Splitz" in it, saved it as a .txt file under the same title. Closed it.
    7-Spotlighted the unique word "Splitz" again: this time only the .txt text file was found.
    Perhaps you could look at the following link:
    http://groups.google.com/group/microsoft.public.mac.of
    fice.word/browse_thread/thread/7abd44e5c3f38b62/a2425e
    610a8781a8%23a2425e610a8781a8
    As you can see your issue may not be new. I do know
    and thus never really felt concern, that the
    Spotlight technology defined limitations to ensure
    that it didn't create indexing issues re storage and
    speed that would be excessively slow or massive.
    As for your problem, it doesn't appear to be common.
    I do know that placing a specific word in a Word or
    Excel will only work if it is positioned up front,
    perhaps before the 100kb mark when Spotlight stops
    reading the file.
    However, having said that, am I to assume that if you
    open a new document in Word, type in the unique word,
    and save the file to the same drive, that the
    filename does not Spotlight list the file name?
    1.25Mhz 15 PowerBook G4   Mac OS X (10.4.7)  

Maybe you are looking for