Number of the page of search results

Hello

Can anyone help me please with a problem that has me pulling my hair right now. I googled extensively and had no joy. My Indesign Scripting experience is pretty weak, but I spend a lot of time in VBA and PHP then coding and objects are not foreign to me.

I'm modyfing the existing (and excellent) script to cover my needs. I need to find each instance of a paragraph style, then use the page number and the text to build a content page later. The original script achieved via an index, but it is not convinient for me in this case that I need to first make a change more.

I successfully converted the original script to search all text that has a special paragraph on her style. I'm so succsefully entering the text. I just can't do, is to enter the number of the search result page. I understand that I probably need to look at the parent page of tags, but I don't see how. If there is no help, the paragraph style is likely to be nested within two or three tags embedded in a text box.

Any help would be greatly appreciated.

JavaScript document

/*

Based on the "marking of the character style index words" of Josha Hubbers who was based on the "Marking of the color index words" script by Thomas Silkjær

http://indesigning.net/

*/

var result_words_found = 0;

var curr_document = 0;

var my_document = app.documents.item (curr_document);

Create a list of samples

var list_of_paraStyles = my_document.paragraphStyles.everyItem () .name;

var list_of_paraStyles is my_document.paragraphStyleGroups.item("Book").paragraphStyles.everyItem () .name;.

var list_of_paraStyles is my_document. ParagraphStyleGroup.allParagraphStyles)

var yesNoDialog = ['Yes', 'No'];

That the dialog box to select the style of char at index

var paraStyle_dialog = app.dialogs.add ({name: "Generate index of paragraph style"});

{with (paraStyle_dialog.dialogColumns.Add ())}

{with (borderPanels.Add ())}

{with (dialogRows.Add ())}

{with (dialogColumns.Add ())}

staticTexts.add ({staticLabel: "choose the style of paragraph :"});})

}

{with (dialogColumns.Add ())}

var selected_paraStyle = dropdowns.add ({stringList:list_of_paraStyles, selectedIndex:0});})

}

}

{with (dialogRows.Add ())}

{with (dialogColumns.Add ())}

staticTexts.add ({staticLabel: "search all documents opened :"});})

}

{with (dialogColumns.Add ())}

var selected_search_span = dropdowns.add ({stringList:yesNoDialog, selectedIndex:1});})

}

}

}

}

catch the Cancel button

var doSearch = paraStyle_dialog.show ();

If selected_search_span.selectedIndex == 0 then search for 'all documents '.

other searches only active document.

an active document is element 0 of the array app.documents.item

If {(doSearch)

Set the options to search text to find all words with the selected character style

app.findChangeTextOptions.caseSensitive = false;

app.findChangeTextOptions.wholeWord = false;

app.findChangeTextOptions.includeFootnotes = false;

app.findChangeTextOptions.includeHiddenLayers = false;

app.findChangeTextOptions.includeLockedLayersForFind = false;

app.findChangeTextOptions.includeLockedStoriesForFind = false;

app.findChangeTextOptions.includeMasterPages = false;

app.findTextPreferences = NothingEnum.nothing;

app.findTextPreferences.appliedParagraphStyle = my_document.paragraphStyleGroups.item("Book").paragraphStyles.item (selected_paraStyle.sel ectedIndex);

Browse open documents to index all the...

{}

my_document = app.documents.item (curr_document);

Search in the document

var found_words = my_document.findText ();

Make index

var my_contents

check if words are found

If (found_words.length > 0) {}

To loop through the paragraphs, create a list of words and mark them as index words

myCounter = found_words.length - 1;

{}

var found_word = found_words [myCounter];

var my_topic_name = found_word.contents;

check if the subject is not empty

If (my_topic_name.length > 1) {}

items have been found

result_words_found += 1;

/ / Need to retrieve the page number as a variable here.

Create the page reference

my_topic.pageReferences.Add (found_word);

}

-myCounter;

} While (myCounter > = 0);

}

remove unused topics from the index, just for cleaning

break if a single active document is extended search

If (selected_search_span.selectedIndex == 1) {}

break;

}

curr_document += 1;

} While (curr_document < app.documents.count ());

display the dialog result...

If (result_words_found == 0) {}

Nothing found alert

Alert ("nothing has been found, try again...");

} else {}

Alert ("made of indexing! \n"+ result_words_found +" items found.\n\nNow choose \"Generate index\"in the Panel Index to update your index.")" ;

}

}

The number of the page on which there is a text is the name of the parent of the text of the parent text block page (if you know what I mean):

var found_words = my_document.findText ();

$.writeln (found_words [0] .parentTextFrames [0].parentPage.name);

Is CS5 and later versions. In CS4, it's a little different, I forgot the details.

Peter

Tags: InDesign

Similar Questions

  • How to format the page of search results?

    How can I Format search result page? Thank you!

    You need to put in shape on this page? Also, would what type of research you customize? You can also use custom templates with search results to customize how search results are displayed - custom templates | Developers of enterprise catalyst

    Kind regards

    Mihai

  • Number of the page to start from another field

    Hi all

    I have a RTF model that shows a few bills. I have the invoice number and the page number that appear correctly. So if my report back 5 invoices I want for each bill page from 1 number. Currently, he does not like that.

    Now as a result:

    Invoice: has

    Page NUM:1

    Line: 1

    Invoice: has

    Page number: 2

    Line 2

    Invoice: B

    Page NUM:3

    Line 1

    Can begin it of Bill B by Page number 1 instead of 3?

    Kind regards

    Stoyanov

    Thank you for using for-each@section:G_INVOICE, instead of just for each.

    This will reset the page numbers for each invoice.

    Replace G_INVOICE with your actual bill group name.

  • Search only to hide resulted pdf pages when search results will require a readjustment

    Hi all

    I have a pdf of dynamic xml form, when open the pdf doc, only one page will be visible on this page I have search features. Once I do a search on this page according to research he reveals these pages (which are satisfied with the search conditions). In each page of search results I have a "Return to Homepage" button, when the user click of button on the search results needs to be reset (need to hide all no hidden page and update should come to the search page).

    Actually, I got this feature but here when the user clicks on the "Back to Home Page" button, I'm hidding all the pages in pdf doc. Here, I need to hide only the pages that are displayed not all pages in pdf format. My code snippet as follows (assume that doc pdf has 8 pages)

    topmostSubform.Page1.presence = 'hidden ';
    topmostSubform.Page2.presence = 'hidden ';
    topmostSubform.Page3.presence = 'hidden ';
    topmostSubform.Page4.presence = 'hidden ';
    topmostSubform.Page5.presence = 'hidden ';
    topmostSubform.Page6.presence = 'hidden ';
    topmostSubform.Page7.presence = 'hidden ';
    topmostSubform.Page8.presence = 'hidden ';

    How to hide only search pages has resulted. Because if I have 500 pages in pdf doc, I need to write to hide for each page. I need to avoid this.

    Thanks in advance

    Prasad Salvan

    Hi Prasad,

    Since you had the search criteria to make the required pages visible, I would put in place a global variable (in the file / form properties / Variables tab) and then the search script put the search criteria in the global variable (when accessing the global variable, you must only .value, instead of .rawValue).

    When you set the global variable you must give a name and an initial value of "0".

    Then the button "go to the search page" would include script to hide the page references in the global variable.

    Good luck

    Niall

  • Page of search results on the Web App

    I'm not new to BC - but I have to be over looking something. I have a Web App form search on a page, I removed the module of results, I've swapped the new results page for the oid {module} (or whatever it is) and placed the tag search results on the search page to what I'm pointing...

    The feature works fine ON the same page-, but the system can't find the page (i.e. Page not found) when I try to move the search results to the new page. Please help me! I'm sure it's something stupid that I am- but I'm going nuts! Thank you!

    Hey there,

    You do not replace the action of the form with this module your which replaces with this pageID with a right to the url of the page id...

    & ID = /-search results-page

  • Cannot follow the links Google search result from this morning

    Kubuntu 11.10
    10 Firefox

    Windows 7
    Firefox 7.0.1

    Google has made a change that makes the object, you must enable cookies and make sure they are not blocked

    (From discussion/forums/contributors/708153 )

     Sometime last night, Google updated its search results page. We are seeing some reports that search results when clicked take you to a blank interstitial page rather than the final result.
    
    The issue is that if you don't have cookies enabled or working (blocked by extensions/privacy settings), the links don't work. The only workaround is to enable cookies, use a different search engine or use Chrome (which somehow works even with cookies disabled).
    
    The bug is bug 725634. I'm posting here to let you all know that we're working with Google on this and it should hopefully be resolved shortly.
    

    Update
    Google expect to have this problem in a few hours.

  • How to restore the size of the screen of search results? The place of departure of research is fine, but the results are so tiny that I can't read. Thank you.

    After the firefox search page appears and I launched a search, the results are back in very small print. If I have something to randomly select the page that opens is fine. The problem is only with the search results page.

    See this:
    https://support.Mozilla.com/en-us/KB/page+zoom

  • Can you add the checkbox to search results point at exit Responsive HTML5?

    The Webhelp output has a checkbox to highlight search results like this:

    Highlight search results CB.PNG

    But the release of Responsive HTML5 does not have this option despite highlighting the results:

    Highlight search results CB 2.PNG

    I don't see any way to add this in the page layout customization window:

    Highlight search results CB 3.PNG

    Is it possible to add a checkbox to disable the highlighting? We recently had to sensitive HTML5 and we have been asked how to disable highlighting.

    Thank you.

    I found a partial solution to this. I found that if you build the sensitive HTML5 output, you can edit the html code for the main subject under the research section. The checkbox code to highlight is there, but it is set to hidden. You can view it. The problem is while the box does not resemble the box "display results with all the words. You can work on some issues of style, if you get creative. It is nowhere near perfect, but we should be able to disable highlighting.

  • 10 HTML HR &gt; WebHelp &gt; limited to 10 per page of search results

    There is a problem with displaying more of 10 search results per page in IE9 webhelp.  I updated whform.js to show the 99 results per page as follows:

    var gnMaxRslt = 99;

    After turning to whform.js it shows 99 in the text box, but shows only 10 in the search results below .

    Can anyone suggest a solution?

    RH10, you need to edit the file whfhost.js and the whform.js file. Descend to the bottom of the whfhost.js file and change the following statement:

    var nMaxResult =

    for example

    var nMaxResult = 99

    Don't forget that every time you build the project files by default HR will be added. So I think that it is better to keep a copy of the modified files and copy them on the project and prior to publication.

    I hope this helps.

    Chris

  • The Google web search results 'not fair' in Firefox

    I'm having a problem using Google search on the web (toolbar and directly from google.com) in Firefox. When I search a keyword, lets say a company name and you wait to make appear the company Web site, the results include videos, articles, news, etc. None of the main company Web site are included in search results. There is no problem with Google web search in IE or Chrome.

    Here's a specific example: "Mozilla Firefox" in Google search you use Firefox there are some 31,600,000 results with the top 10 being random sites on Firefox browsers. When I search "Mozilla Firefox" in Google using IE, there are only some 130,000,000 (4 times more), with the best results being www.mozilla.org/and other Mozilla sites 'main '.

    I ran all the patches malware/Antivirus software recommended, reinstalled Firefox, update of a few add-ons/plug-ins I have, and made sure that Google search parameters are exactly the same for all browsers. Nothing works.

    Did anyone else encounter this problem or have a guess at what may be the cause of this? I have spent a few hours trying to fix it and am willing to give up Firefox, so far that is (was) my go to the browser.

    Hello, google is tracking and customization of your search history even when you are not logged in - maybe you will have to remove or erase all cookies from Google.com and see if the results change...

    http://support.Google.com/accounts/bi.../answer.py?hl=en & Answer = 54048

    Delete cookies to remove the information from Web sites is stored on your computer

  • How can I change the display of search results format?

    My default folder view is "details" for all folders. But search results always happens to "Tiles", which makes me go to discover details manually I have to search for a file each time. Is there an easy way to change the default display of search results?

    To remember. Try to remove all the parameters.
    Menu Tools (on the keyboard ALT + T) - Folder Options - view - reset records
    --
    ..
    --
    "Teun Spaans" wrote in message news: 7eca660e-c0c7-4 c 58-abfa-ff558257bbe8...
    > My default folder view is "details" for all folders. But still
    > search results comes to "Tiles", which makes me go to the details view
    > manually whenever I have to search for a file. Y at - it an easy way to change the
    > default search results display?

  • Could not open the file of search results

    I can't find my file in foder, but it is visible in the search results. When I try to open it is showing an error indicating the name of the file can be renamed or deleted.

    Help, please. I use windows 7

    It seems that the file you are trying to open is a shortcut file and the original file is deleted or moved to another location. When you open the shortcut file, it locates the file to the path where it is saved. If the file is moved or deleted, then you will not be able to open the file using the shortcut. Use the Fix - it provided in the below provided link and check if this helps solve your problem:
    http://support.Microsoft.com/mats/windows_file_and_folder_diag

    GuruAid

  • How can I make the files hidden, not available in the default windows search results?

    Original title: windows search

    How can I make hidden files in the windows 8 not available in window by default search results?

    Hi Bonesh,

    Thanks for choosing Microsoft Community to post your question.

    I was able to help a user with a similar question. Please see my suggestions, through the following link.

    https://answers.Microsoft.com/en-us/Windows/Forum/windows8_1-TMS/how-to-turn-off-showing-hidden-document-in-search/f847c342-9084-4ecc-A2EA-3efe9aea684f

    If you would like more information, please answer and we will be happy to help you.

  • The value of search results all words searched as a default value in the sensitive help

    HI - can someone help me on this please? Posted on August 24, but no response.

    Thank you

    search.png

    Hello

    I use HTML5 in 2015 of Robohelp sensitive help. There is an option for users to check a box to find all words for a search AND otherwise, the default value is OR.

    This is default - adjustable so that the box is automatically checked for a search AND?

    It is not an option for this so I suppose he will have to change the code but I failed to locate the code again.

    Thank you

    * I see the same question has been asked for Robohelp 11 but the given solution doesn't seem to work for 2015 of Robohelp.

    http://forums.Adobe.com/message/7733536#7733536

    I looked in the output and it seems that the definition of the value still doesn't properly change the value of the checkbox. But there is a 'solution '. Imitating a user interaction, you can define the search AND when the page is loaded.

    In the file usersettings.js of page layouts, go to line 35, with the text rh.model.publish (xxxx

    Add a new line below that and add the code:

    {setTimeout (function ()}

    var window.rh = HR;

    isAND var = rh.model.get (rh.consts ('KEY_AND_SEARCH'));

    If (isAND! = 1) {}

    checkbox var = document.getElementById ('andsearch');

    CheckBox.Click ();

    }

    (}, 1000);

  • Display the first designated search results

    Hello

    We have a web search application implemented for one of our distributors.

    http://www.amscowindows.com/Dealer-Locator

    Within the 'Dealers' Web application, there is a checkbox which has been implemented to allow us to activate for dealers who are 'flagship '.

    Is it possible to allow manufacturers to display at the top rather than alphabetical first search results?

    Any help is greatly appreciated.

    Screen Shot 2016-04-25 at 1.56.36 PM.png

    You can't do that at this time in British Colombia and the web apps.

Maybe you are looking for

  • HP laptop: keyboard

    Something wrong with my HP laptop keyboard. When I want to type in a s, he returned in place of the ctrl + s and don't did me not s. When I want to type a capital letter and hold the SHIFT key shift, tap an x instead. What should I do?

  • Variant for ActiveX/COM adapter (HyperAccess)

    Hello Have automate Terminal VT100 emulation. For this task is my preferred choice Hilgraeve (thanks Dennis Knutson who recommended in several Threads-LV). It provides an OLE Interface. So I'm able to use it with the TS ActiveX Apadater. Unfortunatel

  • Rome Total war: Barbarian Invasion error missing MSS32.dll

    Rome Total war: Barbarian Invasion, I just installed this game on my laptop, but ever time I try to play, said "the program can't start because MSS32." DLL is missing from your computer"can we all help!

  • OfficeJet Pro 8620: Part number for second paper for Officejet Pro 8620 tray?

    I'll try to find the good second tray paper for this printer. Some documents quote Ref CN548A HP and others quote A8Z70A. The two look alike, and both refers to the range of 8600. I bought the CN548A and 'almost' fits, it doesn't seem to work Anyone

  • Jerky video even with 4 GB of RAM

    When I try to watch video on the TNT network I get spurts.  Have a system Dell 2.4 GHz, 4 gig RAM Vista Intel Core 2 Quad Q6600.  Usually isn't the problem, but sometimes have problems with some other videos.  Some on YouTube (not often).  Thank you.