Grep search only on the current page, return array "search everything".

Hello

Is there a way to grep search only the current page, or any page chosen in my paper (myDocument.pages [i])?

I can only manage to search for in the document.

app.findGrepPreferences = app.changeGrepPreferences = null;

app.findGrepPreferences.findWhat = "Chapter (\d+)";

myDocument.findGrep)

Also, is there a way to return the content to find? In this case, I want the $1 this research...

var a = myDocument.findGrep (). ?

Thank you

Christopher

the error is because you have not initialized the tabular myRet variable.

Another problem is the use of textframes.everyItem (), because that returns a different object.

and another is what happens if a textframe is empty you will get an error on the meaning of "object has no text for find/replace.

Here is the fixed code:

var myRet=[]
var myDocument=app.activeDocument;
var tf = myDocument.pages[0].textFrames.everyItem().getElements(),
tf1 = myDocument.pages[0].textFrames.count();
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "Chapter";
for (var i = 0; i < tf1; i++){
 if (tf[i].characters.length){
myRet=myRet.concat(tf[i].findGrep());
}
}
alert(myRet)

Tags: InDesign

Similar Questions

  • Overview - but only the current page

    Is it possible to enter the preview of the overlay creator where it jumps immediately to the current page - or even just previews the current page only? For example, there is a modifier key such as Alt/Opt + Preview? If this isn't the case, should not be a?

    For example, I'm working on the last page of a photo-lourds document and I want to get a glimpse just this page that I make changes to an HTML animation or other. Currently I have to wait for the entire document to be delivered and then drag to the bottom. Maybe there will be unexpected results if the rendering could be circumvented, but wouldn't make sense to go automatically to the current page?

    But please, tell me that there is a way.

    John

    No, it's not a way at this time, but this is a good feature request.

  • Links tool &gt; select all selects links on the current page only

    Using the link tool and choosing Select all to select all links in the document. Something has changed so that now it selects only the links on the current page only. Is there a preference setting that controls the selection (current page or document)? If there is, I changed it by mistake and need to know how to change back. If this is not a setting, preferably, is - that someone had the same problem?

    It depends on the display mode. If you visit the pages in the form of simple pages,

    Only links on the current page are selected.

    If you use modes of vision continues, all the links of the

    document will be selected.

  • stay on the current page. When the user presses ESCAP.

    int

    if (type1 is Dialog.OK)

    {

    intask (Dialog.D_YES_NO, "Please confirm");

        if (type is Dialog.YES)

    {

    perform your task if yes

    ClearAll();

    Login_Screen.disconnect ();

    UiApplication.getUiApplication () .pushScreen (new L_Screen());

    }

    }

    if (type1 is Dialog.CANCEL)

    {

    What should the code because I want to stay on the page current user //press whe cancel but

    }

    Type1 = Dialog.ask (Dialog.D_OK_CANCEL, "Do you want to disconnect now?");

    Hello friends,

    I do the page to disconnect. I want to give confurmation beform logout. Everthing is working. but

    Aler dialogue ask first you want to disconnect or not?

    If he says cancle I want to stay on the current page. but still he go on the back. When your press esce I check everything.

    Please tell me what is the code to stay on the current page when the user press cancle alser dialogue?

    That's what I understood.

    I don't think you understood what I was saying. so here's an example of code:

        protected boolean keyChar(char character, int status, int time) {
            switch (character) {
                case Characters.ESCAPE:
                    confirmClose();
                    return true;
                default:
                    return super.keyChar(character, status, time);
            }
    
        }
    
        private void confirmClose() {
            int resp = Dialog.ask(Dialog.D_YES_NO,"Do you really want to Quit",Dialog.NO);
            if ( resp == Dialog.YES ) {
                resp = Dialog.ask(Dialog.D_YES_NO,"Do you really, really want to Quit",Dialog.YES);
                if ( resp == Dialog.YES ) {
                    // Close the screen as you currently do it
                }
            }
        }
    

    If you don't mind asking me, please use English. for example, the letter "y" is, is not the question why.  I recommend this spell check you your messages also, don't forget that a lot of people who use these forums are not native English speakers, so we use English must be as clear as possible.

  • How can I change the current page on Acrobat Pro DC?

    I'm trying to change the current page in MS Pro, but instead of giving me an option to change only the current page, that he "convert" all pages of the pdf document scanned to make "editable". I wouldn't have a problem with Acrobat do this put that he significantly enlarged the size of the file when it does.

    Extract a page into a separate file. Edit and OCR only one page, backup and replace the original page with the newly edited page.

  • Get the index of the current page?

    Hello, I can't understand, how to get the index of the current Page in a document. I can't use "activePage.name" as the name cannot show the actual number of the current page. In the forums, I found the following function for javascripts indexOf() function.

    If (!.) Array.prototype.indexOf) {}

    Array.prototype.indexOf = function (searchElement / *, fromIndex * /) {}

    "use strict";

    If (this == null) {}

    throw new TypeError();

    }

    var t = Object (this);

    var len = Extremity > > > 0;

    If (len = 0) {}

    Returns - 1;

    }

    var n = 0;

    If (arguments.length > 0) {}

    n = Number (arguments [1]);

    If (n! = n) {/ / shortcut to check if it is NaN}

    n = 0;

    } Else if (n! = 0 & & n! = Infinity & & n! = - infinite) {}

    n = (n > 0 |-1) * Math.floor (Math.abs (n));

    }

    }

    If (n > = len) {}

    Returns - 1;

    }

    var k = n > = 0? n: Math.max (len - Math.abs (n), 0);

    for (; k < len; k ++) {}

    If (k t & & t [k] = searchElement) {}

    return k;

    }

    }

    Returns - 1;

    }

    }

    With that, I then wrote the following code:

    myDocument var = app.activeDocument;

    myPages var = myDocument.pages;

    var number = myPages.indexOf(myDocument.layoutWindows[0].activePage);

    Unfortunately, it does not work. When I warn "myPages" I can see, I get the pages object. I know somehow get just the array with the values of the present?

    Thank you in advance! Appreciate any help!

    app.activeWindow [0].activePage.documentOffset

    Of course, documentOffset, no index. Thank you for noticing.

  • RTF model: If condition to test the XML tag exists only on the current XML node

    Hello

    I have a RICH model based on an XML file as follows:
    + < invoice > +.
    + < InvoiceNum >... < / InvoiceNum > +.
    + < ShipAddress >... < / ShipAddress > +.
    + < order > +.
    + < OrderNum >... < / OrderNum > +.
    + < ShipAddress >... < / ShipAddress > +.
    + < / order > +.
    + < order > +.
    + < OrderNum >... < / OrderNum > +.
    + < ShipAddress >... < / ShipAddress > +.
    + < / order > +.
    + < / invoice > +.

    As you can see, the tag * < ShipAddress > * there are two
    -Sub * < invoice > * = > global shipping address
    -Sub * < Order > * = > shipping address to you for Sales Order

    In an XML file, I can only have < ShipAddress > at a certain level, for example
    -the tag * < invoice > < ShipAddress > * appear in XML that if we have a unique address for the invoice
    -the tag * < order > < ShipAddress > * appear in XML that if we have more than one address for the invoice

    Logically, in my RTF model, I want to print the address of delivery at the level if one header tag * < invoice > < ShipAddress > * is in XML format.
    I tried a lot of syntax If but none works according to the needs:
    + <? If.: / ShipAddress? > + = > always returns FALSE
    + <? If: / / ShipAddress? > = > returns TRUE when < order > < ShipAddress > exists
    + <? If: ShipAddress? > = > returns TRUE when < order > < ShipAddress > exists

    The only syntax that seems to work is:
    + <? If: / / Bill/ShipAddress? > +.
    But I prefer not not hardocde the name of the top-level tag.

    Question:
    What si syntax to test the existence of a XML tag only in the current node (recursively)?

    Thanks in advance for helping me.
    K.Helali

    ShipAddress for the invoice

    
    

    ShipAddress order

    
    
  • [CS5.5] how to import a code snippet in the current page

    Hi all

    I got IDOMElement of the document UIDRef and imported to the code snippet. Here's the code-

     InterfacePtr<IDOMElement> documentElement(docRef, UseDefaultIID());
    
     if (documentElement == NULL)
        break; 
    
     if ((status = Utils<ISnippetImport>()->ImportFromStream(tStream, documentElement)) == kSuccess) 
        //success
    

    ( tStream is the IPMStream of the code snippet that I'm importing)

    This code above is able to import the extract with success on the first page of the active document, but I can't be imported into current page instead. So to do this, I tried to get IDOMElement of UIDRef of the current page instead (logically, I thought this will import the excerpt of the current page).

     InterfacePtr<IDOMElement> documentElement(currentPageUIDRef, UseDefaultIID());

    But the result is still - the documentElement is not null, but the code snippet is imported to the first page only.

    Maybe the concept of IDOMElement is not clear to me, but I find that no documentation in the SDK Guide too. Can someone explain to me what is an IDOMElement and how to import a snippet of the current page?

    Any help will be much appreciated. Thank you.

    Hello Shawn,

    have you tried the IDOMElement of the propagation or layer? You can't place items on a page.

    Markus

  • Need a way to clear a form on the current page and not the entire form...

    IM new to Adobe Acrobat and worked on the conversion of some of our OmnForm 5.0 form PDF file, I've created a form that contains a button to clear the form.  It works very well!  Now, I created a template in the PDF of the current page and then created a button to spawn a new page of the model.  Creating the page works as well.  The only problem I have is that the clear form button clears the entire form.  I need the key to erase only the current page.

    I'm a relative newbie when it comes to script.  I can understand generally simple scripts when I see them, but to create new groupings still isn't my forte. HE's researching the resetForm method, but it seems that there is no option to move the current page to him? (As I said I am relatively new to java scripts).  If anyone has the directions on how to do it I would be very happy.

    You can use the code that I posted here: http://forums.adobe.com/message/4234483

  • JavaScript Cancel... stay on the current page.

    Hi all..

    Please help with this question.
    I have a page where there are 2 buttons, I don't want users
    leaving the page by clicking one of the links of the breadcrumbs or tabs.
    I want to show a confirmation message.

    I created a dynamic action with an event "' Unload' ' with the following code
    var req = $v('p_request');
    if (req == 'CANCEL' || req == 'GET_NEXT_DOC_ID')
      {
       alert('ok');
      }
    else
      {
    
       var r=confirm("Are you sure you want to navigate away from this page?");
        if (r==true)
        {
        // They need to go the page that they clicked
        }
       else
        {
        // They need to stay on the current page.
         }
    
      }
    Please let me know, how can I do this.

    Thank you

    Kumar,

    Unfortunately, the unload event means the page closes and there is nothing you can do to change that. However, there is a beforeunload event that allows you to order or not actually leaving the page. In order to use it you need to change your action Dynamics event page load and bind the beforeunload event to the window yourself. Also, in the other post I was referring to obtain the request on behalf of the entry and not the ID. The reference ID is much better, my apologies.

    $(window).bind('beforeunload', function(event){
      var req = $v('pRequest');
    
      if(req === 'CANCEL' || req === 'GET_NEXT_DOC_ID'){
      }else{
          return 'Are you sure you want to navigate away from this page?';
      }
    });
    

    beforeUnload works slightly differently from other events because it can be abused by the person who is to create the Web page. For this reason, all you can do is return a message if you want the user to confirm to leave the page or return nothing to let the user to leave the page. Each browser handles this event in a slightly different way, but the end result will be the user see the message that you return.

    Good luck
    Janet Tyson

  • information on the current page

    Have we not all method/procedure to capture the information of the current page in the printer. After painting before rendering?

    If your output of the EPS/PS has only winners (lines, curves, circles, rectangular etc.)

    You can simply build your release of paths and Postscript command to record the paths of users in different variable names

    This is a possible way to save the graphic content from one page to the other!

    If you want to save the generated raster image it would be impossible that other users notified.

    Adam.

  • How to make the current page menu item displayed in a different font color?

    Hello

    My menu bar works very well. The links I get the text to hover display the desired color. Now I want the item menu of the selected page show a third color.

    With live-code activated in Dreamweaver CS6, I can see the following code is generated by the dynamic menu:

    "< script type =" text/javascript"src="/CatalystScripts/Java_DynMenusSelectedCSS.js "> < / script > <!-dynamic output CSS menu start-> < div id ="cat_549633_divs"> < ul id ="nav_549633">< class li ="selected"> < a href =" / home.html "> home < /a > < /li >< li > < a href =" "/ leistungen.html" > Services < /a > < /li > < li > < a href = "/ uhrenservice.html" > Uhrenservice < /a > < /li " "> < li > < a href =" / versteigerungen.html "> Versteigerungen < /a > < /li > < li > < a href =" / diamanten.html "> Diamanten < /a > < /li > < li > < a href =" / ueber_uns.html "" > Uber each < /a > < /li > < li > < a href = "/ kontakt.html" > Kontakt < /a > < /li > < /ul > < / div > < script type = "text/javascript" > catSetSelectedCSSItem ('nav_549633'); < /script > <! - end of output CSS Dynamic Menu - >

    The .selected class is created in the first element of the list (home) because it is the current page.

    And here is my CSS:

    {#nav_549633}

    float: right;

    list-style-type: none;

    padding-top: 5px;

    }

    #nav_549633 li {}

    float: left;

    text-align: left;

    }

    #nav_549633 li a {}

    color: white;

    text-decoration: none;

    margin: 27px 0 0 0;

    font size: 13px;

    text-transform: uppercase;

    }

    #nav_549633 Li a: hover {}

    color: yellow;

    }

    {.selected

    color: Green;

    }

    The green font color does not appear. It is still white.

    In order to see if the class 'works"I tried a few other attributes that work!

    {.selected

    color: Green;

    padding: 20px

    background-color: blue;

    }

    In this case, the item appears as a blue box with 20px padding, just as expected - but the font color is always white.

    Can someone help me?

    Kind regards

    Herman

    Hello Ginoem50,

    Looking at your css looks like the selected class does not work because the li #nav_549633 one is more specific is the one who is listened to.

    change .selected li.selected a #nav_549633 and it should work.

    Hope this helps,

    Chad Smith | http://bcgurus.com/Business-Catalyst-Templates for only $7

  • using the &amp; lt; body ID = to highlight the current page on the navigation bar

    Hi all, using the method of the body tag of the give an id to the value of the current on the navigation bar page, works very well. but it's not good if you are working from a model as it would mean the < body > being editable on every page (so most of the content then)... I'm wrong? or am I missing something here that will allow me to change the < body > blindingly obvious...

    Many thanks - didn't really want to use the javascript method you see!

    > Hi all, using the delivery mode of the body tag an id to set the current
    > page
    > on the navigation bar, works very well. However, this is not good if you are
    > working from a model because it would mean thebeing editable on each
    > page
    > (so most of the content then)... I'm wrong? or did I miss something
    > blinding here that will allow me to change the...

    Ideally, you would not actually link the item in the menu on the page that you are
    currently. It is one thing to usability and accessibility. If you do this, then
    You can simply the style of elements not linked in the menu differently to highlight
    This page.

    That said, it is often not a practical solution if you use SSIs to load
    the menu.

    In this case, you can simply add the class to a DIV wrapper, or menu
    itself:



    etc.

    OR, Alternatively, give each meny item it of own class and then work around
    only a special class in the HEAD of each page style. That
    said, I don't know how well it would work with DW models.

    -Darrel

  • I want the main tone of take me to the top of the current page, the end key to take me down.

    He was the original key took me to the top of the current page, the end key down. Recently it stopped doing this on the pages of some, not all, sometimes, behavior is used, then stops again. It seems that they take me at the beginning and at the end of the current line instead. "always use the cursor keys to navigate within pages" is always on.

    This seems to solve this - although it was variable. I don't know why I'd start inadvertently, the F7 key substitution - I'm not knocking the other F keys inadvertently. I misinterpreted always "use the cursor keys to navigate through the pages" to designate the behavior I wanted. Change of browsewithcaret turned it off.

  • How can I add reload the current Page in the toolbar Firefox 9?

    Once I have use customize toolbar, reload the current Page is not an option. I got this feature in previous versions of Firefox, and on another computer where Firefox has been updated to 9 the rest feature but I can't understand how to add to this new computer.

    Firefox 4 and later versions use a combined Stop/Reload/Go button that is placed at the right end of the address bar.

    During the process of loading page it shows as a stop button and once the charging button is replaced by a reload button.

    If you type in the address bar this button would then become a button go.

    Click the Reload button to duplicate the current tab in a new tab.

Maybe you are looking for

  • Post messages for password required

    In the last few days I've been to repeated messages titled 'Mail password required' popup that appears to relate to a POP account I have with BT Internet. If I go on Internet accounts and click this account a dialog asking you for the password of e-m

  • HP Pro 3500 drivers MT/video bad

    I just got my new HP Pro 3500 MT running. I installed Windows 8 Bit Pro64 and then went to the HP site to get the latest drivers. The video driver was dated from 22/04/13. When I try to install this driver it does not work. You have the wrong driver

  • Qwest has stopped supporting my Windows Live Mail.

    MY IP Qwest sent me an email yesterday saying that their meail would be the last to come to my Inbox on my Windows Live Mail program.  I called their tech support and they told me if I didn't the Qwest Hotmail program to get their hands on MS and pay

  • Software BlackBerry BB link for BBQ10 backups?

    Maybe a simple question and I am just something missing: previously, I used the Blackberry Destop software to the data of the backup device in a file on my hard drive, I could then extract later if necessary (SMS, BBM, etc.). I expect to use Blackber

  • The USB 3.0 port no longer works

    Hi all I have a laptop ASUS UX31E running Windows 8.1. WD Elements Portable USB 3.0 external hard drive has been plugged on the USB 3.0 port, the lid of the laptop was closed (the portable computer has entered) and the external hard drive was then de