How do I find a word in all my document, return false if it's not in there.

Hi,
I struggle with something that should be easy, and didn't find any answer on this forum.
I have a list of word that I want to search in a 300 pages catalogue in InDesign. I'd like to know how can i:
1) Look for the word
2) Return true if it's in the document
3) Return false if it's not
FYI, the words i'm searching are product code, so if they're not in the catalogue, the product isn't in the catalogue.
Thanks a lot,
Olivier

Hi Oliver,
Use this,
var doc = app.documents;
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat = "Text";
var foundtext = app.activeDocument.stories.everyItem().paragraphs.everyItem().findText();
for (var i=0;i<foundtext.length;i++){
        if (foundtext[i].length != 0){
            alert("True");
        else{
            alert("False")
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;

Similar Messages

  • HT5312 How do I find pass word to old email address has I cannot down load any apps as it asks for old pass word

    How do I find pass word to my old email address has now I cannot down load any apps because I have changed my email address

    That's because apps are DRM protected & tied to the account used to originally obtain them. They cannot be transferred to another iTunes account. You can contact iTunes support, explain the situation, and request they add these apps to the download queue of your new account:
    http://www.apple.com/support/itunes/contact.html

  • How do you find the word count on MacBook, please?

    How do you find the word count on MacBook, please?

    If you are trying to find word count in a Microsoft Word 2011 documemt, for instance, open the document and go to the Tools menu, selecting Word Count. In Apple's Pages application, open the document and look at the bottom of the page, near the left it will say "X Words" where X is the number.
    Best of luck.

  • How do I find what taking up all my hardrive space on my mac mini running snow leopard ?

    How do I find what taking up all my hardrive space on my mac mini running snow leopard ?

    Hi Gibby,
    How much free space is on the HD, where has all the space gone?
    OmniDiskSweeper is likely the easiest/best, and is now free...
    http://www.omnigroup.com/applications/omnidisksweeper/download/
    And if needed, you can use Terminal to run it in admin mode to see files/folders your user can't see...
    http://www.macobserver.com/tmo/article/how_to_recover_missing_hard_drive_space/

  • How do I find my word program

    how do I find my word program on this macbook pro

    I'm afraid you got ripped off - Microsoft doesn't sell Word as a stand-alone package, just as part of the MS Office bundle. And it's far more than $20 - anywhere from $99-199 usually.
    If you need something right away to use as a text editor, you can always use the free TextEdit (in your Applications folder) or download LibreOffice - http://www.libreoffice.org/ - as mentioned above.
    Clinton

  • How do I find the new U2 album on the music app on my iphone? Is there something I need to do to be able to see it ?

    How do I find the new U2 album on the music app on my iphone? Is there something I need to do to be able to see it ?

    Open iTunes app on your phone.  go to Purchases.  It may be in the more section, (The ellipsis icon over the word More). Tap Purchased.  Tap Music. Tap Recent Purchases.  Tap the iCloud icon next to the tracks you want to download.  On my phone the songs were at the beginning of the list because I haven't purchased anything since it was announced this morning. 

  • I do not know my apple administrator username and password? How do I find out what it is? I am trying to download IBM Notes and Domino onto my MacBook Pro and I cannot download the software without verifying my apple administrator username/password

    I do not know my apple administrator username and password. How do I find out what it is? I am trying to download IBM Notes and Domino onto my MacBook Pro and I cannot download the software without verifying my apple administrator username and password.

    iOS is only for mobile devices, so:
    Resetting or changing a password:
    For Snow Leopard or earlier:  http://support.apple.com/kb/HT1274
    For Lion or later:  http://support.apple.com/kb/HT6022
    For Mavericks users:
    http://www.macworld.co.uk/how-to/mac-software/how-change-admin-password-mac-3535 328/
    This is also useful:
    http://www.macworld.co.uk/ipad-iphone/news/?newsid=3463233&olo=email
    If it's running Mac OS X 10.6.8 or earlier, insert a Mac OS X install DVD, restart with the Option key held down, click on it, and use the Reset Password utility.
    If it's running Mac OS X 10.7 or newer, restart with the Command and R keys held down, open the Terminal, and use the resetpassword command:
    https://discussions.apple.com/docs/DOC-4101

  • How do I find the path (source) of a document in mavericks?

    how do I find the path (source) of a document in mavericks?

    See if you can find the file using this program
    EasyFind – Spotlight Replacement

  • How do I find and launch iTunes radio on my mac pro?  I do not see the radio icon on the top menu in my iTunes.

    How do I find and launch itunes radio on my macbook pro?  I do not see the radio icon in the top banner in itunes.  I am new to this... help!

    http://support.apple.com/kb/PH13697

  • How do I find and manage my iPad on the new iTunes?  It's not there.

    How do I find and manage my iPad on the new iTunes?  It's not there.

    You can have the 'classic' view by clicking on View - Show sidebar. In the new view, your iPad will have a link on the upper right.

  • HT1391 how do I find free downloads that I have added to my library that are not showing up in the library on in icloud?

    How do I find free downloads that I hve added to my library that are not in my library or in icloud?

    Hi revsteph,
    If you have songs that you know you have purchased, but are not showing up in your iTunes Libarary, you may want to see if you can redownload them. You may find the following article helpful:
    Apple Support: Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/ht2519
    Cheers,
    - Brenden

  • When i use the apple tv it puts my computer to sleep.  the last time this happened i lost microsoft word with all the documents.  i'm asked to relaunch, but that step fails.  i'm frantic! can anyone help me see my documents again?

    when i use the apple tv it puts my computer to sleep.  the last time this happened i lost microsoft word with all the documents.  i'm asked to relaunch, but that step fails.  i'm frantic!  can anyone help me see my documents again? this also prevents me from reading attachments in my mail, since they are frequently launched in word.

    There's a whole lot to read in your post, and frankly I have not read it all.
    Having said that, this troubleshooting guide should help:
    http://support.apple.com/kb/TS1538
    In particular, pay attention to the mobile device support sections near the bottom, assuming you have already done the items above it.

  • Different iOS: phone 4 & Iphone 6 Plus how to share same music folder but all the rest of the phone information separated not merge

    I have a iphone 4 (iSO7.1.2) & a iphone 6 plus (iSO 8.1) . 1. Can I use one Apple ID for 2 phones? 2. I want to share only same music but have different Contacts, Emails boxes, Apps, documents etc on each phones. How to make it possible? 3. What should I do the iCloud back-up is lapse. The email address is to the same location. How do i set 2 different iCloud back-up individually on each phone? I'm using Mac OS X. Appreciate, all help. Thank you ... both my iphones are pretty messy up now .....identity crises....one moment its saving back-up or sync to iSO 7.1.2 ... the next moment its iSO 8.1.....

    iphone 4 & Iphone 6 Plus how to share same music folder but all the rest of the phone information separated not merge?
    You already ask this question, why are you asking again.

  • I have updated my iphone and all  data have gone including photos contacts and notes .is there any solution? I am about to syncope!

    I have updated my iphone4 and all  data have gone including photos contacts and notes .is there any solution?

    All data that was on your iPhone should be on your computer.
    All photos that were transferred to your iPhone from your computer should remain on your computer and can be retransferred. Photos/videos captured by the iPhone can and should be imported by your computer as with any other digital camera - especially before installing an iOS update. Re-transfer these photos from your computer as with any other photos available on your computer.
    Contacts and notes are designed to be synced with a supported application on your computer, and there are some free email accounts that support syncing contacts and notes over the air.

  • How can I find the words which spans across end of line to next line in pdf ?

    I am using Acrobat Adobe X Pro version for our form development and maintanence. I am writting a Acrobat JAVA batch script which reads through all the words and execute spell check and reports the mispelled words in a excel sheet. Since I am running this script in batch mode for more than 1000 pdfs - I am getting many words joined together. When I looked in to those pdfs all such words are looking okay because it is appearing in end of right margin and the next word is in the next line. Since there was no space between them it was extracted as a single word. Hence the failure.
    I used wordf = this.getPageNthWordQuads(i,j)  to get the word begin and end coordinates. when I closely observe the values are creating a rectangle and that doesnt span across lines. I got the coordinates for the regular word and the word which span acoross two lines. both of the coordinates are same.
    I think I am screwed - I have 8000 such words and no clue of how to get rid of them from the actual misspelled words.
    please help. let me know if any class /method if I call will give me the end of line or do I need to go to next layer to find this split.
    the addnot is somehow marking the words using this coordinates - please hellp me understand how this works. Thanks.
    // for all pages
    for (var i = 0; i < this.numPages; i++ )
    // For all the words
    pg += 1;
    numWords = this.getPageNumWords(i);
    for ( j = 0; j < numWords; j++)
    //get the spell check 
    ckWord = spell.checkWord(this.getPageNthWord(i,j))
    if ( ckWord != null )
    jn=0
    ml=0
    // if mispelled word found.
    wordf = this.getPageNthWordQuads(i,j)
    swordf = wordf.toString()
    var st = swordf.split(",")
    var diffx0 = parseInt(st[0])-8
    var diffx1 = parseInt(st[1])-8
    var diffx2 = parseInt(st[2])-8
    var diffx3 = parseInt(st[3])-8
    var diffx4 = parseInt(st[4])-8
    var diffx5 = parseInt(st[5])-8
    var diffx6 = parseInt(st[6])-8
    var diffx7 = parseInt(st[7])-8
    if (cWord == csword)
    jn = 1
    if ( st[1] != st[3] )
    ml = 1
    //dataLine += "\r\n write "
    else
    ml=2
    dataLine += "\r\n"+this.documentFileName
    + "\t" + this.getPageNthWord(i,j)
    + "\t" + pg
    + "\t" + j
    + "\t" + ml
    + "\t" + jn
    + "\t st[0] " + diffx0 + "\t st[1] " + diffx1 + "\t st[2] " + diffx2 + "\t st[3] " + diffx3 
    + "\t st[4] " + diffx4 + "\t st[5] " + diffx5 + "\t st[6] " + diffx6 + "\t st[7] " + diffx7 
    ck=1

    If Acrobat is reading each word part as separate words, you have a problem.
    The way I approached it in some of my tools was to check if a word ends
    with a hyphen, and if so, to check if it's the last on the line. If both
    conditions are true, combine with the next word on the next line. This is
    not fool proof, of course, as there are documents with columns are other
    structural elements that prevent this from working. Better than nothing,
    though...
    However, it is also possible that Acrobat does see both parts as parts of
    the same word. In that case, getPageNthWordQuads() will return multiple
    quads arrays. As you know, that method returns an array of quad arrays.
    There's usually only one, but in principle there could be more... Something
    to check before giving up.

Maybe you are looking for

  • How is it possible that i can play music marked with the cloud icon in the music app when i'm not subscribing to itunes match?

    When I'm on the same WiFi network as the computer I sync my iPhone to, I can se a lot of songs in my music app marked with the little cloud icon. And when I leave the network, I can see only the songs with this icon that I have played and therefore p

  • Can't work out how to stop Mac mail from Forwarding to GMail account.

    Okay. This is on behalf of my sister. For whatever reason, when emails are sent to her @mac.com address they get forwarded to her GMail account and deleted from her @mac.com address. So they never appear in her @mac.com inbox. She now wants this rela

  • Error PeopleTools 8.49 help please

    here is the error i received? Message: Object doesn't support this property or method Line: 2325 Char: 13 Code: 0 URI: http://xxxx.xxxx.:8000/psc/xxxx/EMPLOYEE/PT_LOCAL/c/MENUNAME.PERSONNEL_COMP.GBL

  • Japanese language pack for Crystal Report 2008 SP1

    Hi Team, this is SAP Internal IT Support Center. my id is C5101216. just want to know that where i can download the japanese language pack for Crystal Report 2008 SP1. Thanks. もし日本語のバージョンがありましたら.ぜひ教えて頂きたいですが・・・ 宜しくお願い致します. Edited by: Guanghua Li on D

  • Spool for alv

    Hi All, 'A spool for GRID type ALV cannot be generated.' Going by this,  does it mean that when a grid type ALV is submitted for a spool, it wud give just a ALV list display? OR, just that the spool will not take a grid type ALV at all. Thanks.