Script to hyphenate footnotes

hi,
I have text importaded in indesign cs6 (mac os x yosemite) from word with hundreds of footnotes.
In the paragraph style "notes" the hyphenation is turned on but the footnotes are not hyphenated.
I tried solution with "find-change": find "paragraph style notes" - change "hyphenation on", but in the field change option to choose hyphenation does not exist .
Is there any way to solve this problem (with grep, script ...) or I will have to apply hyphenation to each footnote individually?
Thanks in advance
oscar

Hi Jump_Over,
- the para style "notes" are applied to footnotes;
- there is "+" nearby a style name (I not force the style with "alt"  to not lose local italics, small caps, bold etc.);
- this style is applied automaticly (I made it in indesign befor imported text from word);
- para style "notes" is created in indesign.
Text in word had footnotes not hyphenated and obviously this has remained in indesign.
I could solve the problem by setting the hyphenation in word (you can select  all notes and set hyphenation) and after importing the text in indesign.
The problem is that the text in indesign is practically in final phase and now in not convenient to start again from Word and import the text again.
In indesign I could select the notes one at a time and apply hyphenation, but there are a hundreds of footnotes.
I thought there is a mode to change all automatically.
Thank you

Similar Messages

  • Script for Document Footnote options change before first footnote above space.

    Hi hope u r all fine,
    Please help for this. I want to change the space in Document footnote option.
    That is Minimum space before first footnote = "12 pt"; and Rule above of First Footnote in Column should be Rule off.
    I need script for this.

    @hasvi – look up the properties and methods here:
    Jongware
    InDesign JavaScript Reference Guide
    http://www.jongware.com/idjshelp.html
    I recommend the chm files listed there for easy searchability.
    There is also a HTML version and a online version in HTML.
    Properties like footnoteFirstBaselineOffset, footnoteMinimumFirstBaselineOffset, ruleOn and ruleOffset with their possible values are documented here:
    http://jongware.mit.edu/idcs6js/pc_FootnoteOption.html
    To set the properties and their values you have to address the document.footnoteOptions:
    var myDoc = app.documents[0];
    myDoc.footnoteOptions.properties = {
        footnoteFirstBaselineOffset : FootnoteFirstBaseline.X_HEIGHT,
        footnoteMinimumFirstBaselineOffset : "12 pt",
        ruleOn : false
    Uwe

  • Footnotes Indesign

    Hi!
    I have a problem with the footnotes. When i create a footnote in the text that footnote appears automatically at the end of the page but i want that footnotes appears at the end of the book, in other chapter.
    Somebody knows how can i do that automatically? i really need to do that...
    If is not possible do that i must do this manually and i´m gonna lose a lot of time...
    tank you all!
    ps-sorry my english...

    Don't worry, your English is fine!
    You don't mention the version of InDesign, and that's quite important here. There are scripts to convert footnotes to endnotes, but they depend highly on that version. In earlier versions (CS2 -- the first with footnotes -- and CS3), you can only convert them to static text: if you insert or delete a note, you have to rebuild the notes section.
    For CS4, it's possible to convert them to dynamic endnotes instead. A recent script from Peter Kahrel does that: see http://www.kahrel.plus.com/indesign/dynamic_endnotes.html

  • Endnotes for multiple  files in book

    I have  reviewed  several of the  posts about endnotes and now  am not sure which method to follow. I have  a book file with more than 70  files. Each of these files [a chapter] has endnotes which are to appear all at the end in one chapter called endnotes. they restart numbering  for every chapter [i.e. chapter 1 has  endnotes 1-5, chapter 2 has endotes 1-9, etc]
    The problem is that the text  has already been carefully formatted  and I don't want ot lose the formattign - so I cannot  simply reimport the word file- which  has the endnotes  manually  with numbers like 3, 4, 4.1, 4.2, etc.] I'd liek to make the endnotes dynamic as I must  prepare teh document for  Kindle and epub as well.
    i mus t now insert the  endnotes manually in each chapter - i know  of the script to convert footnotes ot endnotes. But it is my understanding that  teh  script will place teh endnotes at teh end of each chapter/file. If I then try to copy  these all into one file at teh end - I'm pretty sure I will lose the  dynamic links.
    I could try  to  do this using cross-reference but from what i've read it's pretty flaky across multiple  documents and prone to crashing.
    I could also  combine all my  separate chapters into one humongous file - using the  "move" pages command.
    This will be  very tedious and seems to defeat teh whole purpose of the  book but will enable me to use the  footnotes to endnotes  script.
    Which is the lesser of 2 evils -or is there something else I can do?

    Hmmm... if you're not using a script to do this conversion, you might need to do this by hand. Have a look at this tip I just wrote-up for a previous question. It might give you an idea. See: http://forums.adobe.com/message/5923811#5923811
    In your case you'd only continue the numbering across stories, not documents in a book.
    Cari

  • Span Graphics across THREADED text frames

    Hello there,
    I am working at a 60 page document that includes plenty of footnotes, graphics and tables.
    I have a 2 column layout. I need the graphics and the tables to span across the 2 columns.
    I need the footnotes on each page to span across 2 columns.
    Now.
    Indesign puts the footnotes into their own separate column. I found a script that will correct this but will only work if the 2 columns are not part of the same text field.
    In other words, to have a 2 column layout I would need 2 threaded text fields onto 1 page, instead of 1 single text field with 2 columns.
    The problem is that once I have 2 different text frames, all the graphics and table will not span across the columns.
    I need a fix!
    Either a new way of dealing with footnotes spanning across columns, or a way of having tables and graphs spanning across threaded frames.
    Thanks!
    Federico

    There is no easy way to span footnotes across several columns.
    I had to do it several times in the last month and I did following:
    Work consequent with paragraph, character and object styles.
    Create an Object Style for your 2 column text.
    Finish your article with your normal footnotes.
    Try to find a scipt which converts footnotes to endnotes (and the other way too). There are several for free download available
    Install that script.
    Convert footnotes into endnotes
    Create for the first endnote a flair of the paragraph style which will start in a new frame (not necessary, but makes things much easier).
    Now you have at the end of the story a + which indidcates a text overflow. Click on this.
    Now create a new layer above the text and lock the text and draw a rectangle on the bottom of the page where the first footnote number (now endnote number) is found.
    For this reference text frame create  now (or do it before) an object style which will wrap text away to make place for the "footnotes" and let the text vertically align at the bottom. Apply this style to the "footnote" frames.
    Drag the frame as high as all footnotes of that page are found in this frame.
    Click on the overflow indicator and follow up with the previous steps until the last footnote.
    For graphics and tables spanning accross the columns I don’t anchor them in a multiple column layout out because if the anchor is in the right column, text wrapping will not work properly.

  • Hiding or untag element (ID CS3 JS)

    Hi<br /><br />In Xml file  <br /><br />.... percent.<xref type="fn" rid="fn1"><sup>1</sup></xref>.....<br /><br />I want to insert footnote through script. The footnote is inserted but the numbers are occuring twice (one is the number in <xref> and other is automatic footnote insertion number by the script).<br /><br />Is there any possibility to hide <xref> through script?<br /><br />I tried the following<br /><br />function xref(){<br />this.name = "xref";<br />this.xpath = "//xref/sup";<br />this.apply = function(myElement, myRuleProcessor){<br />with(myElement){<br />     try{ <br />myElement.parent.xmlElements.item("sup").convertToAttribute("sup");<br />}<br />catch (e) {}<br />}<br />return true;<br />} <br />}<br /><br />But error is thrown.<br /><br />Uncaught javascript exception: Invalid structure iterator for the current XML rules process detected! Please modify the rules so the structural changes happen after the children nodes have processed (or skipped).<br /><br />Thanks in advance

    Hi
    Is there any possibility to hide the contents of an element?

  • Looking for a script to connect bodytext to footnote and cross-references

    Hi,
    Need to do the following:
    I was provided with separate (tagged-text) files: bodytext, (foot)notes and cross-references. Now I am looking for a solution (script?) that can do the following:
    to restore the connection between the body-text, the footnotes and te cross-references after placing these in a document in Indesign.
    The cross-references should appear (in anchored text-frames) in the margin and the notes in a separate frame at the bottom of the page. If possible in the same way as footnotes in Indesign appear, but in a separate frame to be able to do some more formatting than native footnotes would accept.
    I have tested the plugin: Side Heads from InTools, and tis works well with Indesign files tthat contain footnotes. But this doesn't work with separately placed footnotes from a tagged-text-file, as they re not knotted together.
    I can't do any scripting myself.
    I would appreciate any help, and I am looking forward to your response...
    Regards,
    kkingg

    The first thing to do is:
    regexp "match regexp = ([0-9]+)" $_cli_result match count
    if $count eq 0
    exit 0
    end
    The second is a bit more challenging.  I think this will work:
    cli command "show call active voice br"
    foreach line $_cli_result "\n"
    regexp "^([0-9a-zA-Z]+) : " $line match callid
    if $_regexp_result eq 1
      continue
    end
    regexp "^dur 1d" $line
    if $_regexp_result eq 1
      cli command "show call active voice br | section $callid"
      syslog msg "$_cli_result"
    end
    end

  • Bug: Setting "Don't include footnotes" via scripting doesn't change the find/change dialog

    Hi,
    Small bug, but can be confusing. Whether you write this line:
    app.findChangeTextOptions.includeFootnotes = false;
    or this line:
    app.findChangeTextOptions.includeFootnotes = true;
    ... you won't see any different in the little footnotes button in the
    find/replace dialog, even though the setting does work via scripting.
    More testing is needed to see what can be done to get the UI in sync
    with the setting...
    Ariel

    The dialog isn't updated while it's displayed. But hiding the dialog and displaying it again (twice Ctrl+F) shows that the script did do its thing.
    Peter

  • Any way (or script) to add a point-numbered footnote?

    (This is a cross-post from the Mac forum ... really need help here ... AM)
    A recent ID client who does heavy-duty legal publishing asked me this question, I didn't have an answer, but told her I'd post it here to see what the great minds have to say. (She wasn't sure she could explain it well enough.)
    They used to use Word to publish their tomes, huge loose-leaf ring binders, and moved to ID recently. They're missing an important Word feature (which may force them to abandon ID for this pub! Ack!) of being able to insert a "special" footnote that doesn't force subsequent footnotes to increment up in number.
    In other words, on a page with footnotes numberedd 15, 16, and 17, they need to be able to add a "15.1" footnote (and reference) after 15, leaving footnotes 16 and 17 etc. as is. Apparently this is a long-time practice in legal publishing. Word will continue to update all footnotes as necessary but skips the special ones, which need to be hand-updated. Not ideal, but workable.
    As far as I know, there's no way to do this in ID, nor any plug-in that will do that. (You can do this with numbered lists ... convert one of the numbered grafs to text and set the next one to start at the right number ... but not with footnotes.)
    Before you suggest that they fake it (hit a return after footnote 15 and manually enter/format a 15.1 footnote ... they've thought of that), the problem is what to do when the special footnote needs to be the first one in a list of footnotes, or the only one on a page.
    I would love to find a solution for them ... hate to see users have to move from InDesign *back* to Word!
    Edit: They're using InDesign CS4 but could use ID CS3 if necessary.

    this could be easily scripted - everything depend on the way they prepare texts
    robin
    www.adobescripts.com

  • Is there a script to make automatic footnotes?

    Yeasterday my boss gave me a book to lay out.
    I must do alphabetic index and over 1200 footnotes. If I imagine this proccess, it makes me sad
    The first part of this job isn't hard, because I plan to use two brilliant scripts to make index: IndexBrutal and IndexMatic.
    You can download  them from this website http://marcautret.free.fr
    But I need and plead for your help with footnotes. Is there a script to make automatic footnotes?
    Or, maybe, you know the faster way to do this boring repeating of mouse cliks?????
    Thanks a lot.

    Depends on what you mean by "make" footnotes. What are you making them from? I used a script from http://www.adobescripts.com/modules/mydownloads/viewcat.php?cid=9 once to convert thousands of endnotes back to into footnotes. And I'm sure there's a similar way to automate the process (either through scripting or a find/replace) if your footnotes are embedded in text but marked some way. For instance, if your footnotes look like this at the moment:
    text more text footnote number comes next (22) text of footnote here end of footnote comes next\ more text following footnote
    In this case, all footnote numbers show up between parentheses and all footnotes end with a backslash. If your footnotes are marked beginning and end in some similar fashion, then there's hope.
    Ken Benson

  • Indesign scripting for footnote

    Hi all,
    We got request from our team to develop footnote handling in XML workflow.
    I need your thoughts to automate the footnote process.
    As you aware that auto footnote cannot handle XML tags. We are planning to have two text streams.
    One for "Text" and other for "Footnote", is that possible to automate this process.
    Searching the Text part for footnote tag and resizing the footnote frame as per footnote citation.
    I need expertise input to complete this task.
    Attached screenshot of page for reference.
    Ranjan

    Hi all,
    We got request from our team to develop footnote handling in XML workflow.
    I need your thoughts to automate the footnote process.
    As you aware that auto footnote cannot handle XML tags. We are planning to have two text streams.
    One for "Text" and other for "Footnote", is that possible to automate this process.
    Searching the Text part for footnote tag and resizing the footnote frame as per footnote citation.
    I need expertise input to complete this task.
    Attached screenshot of page for reference.
    Ranjan

  • Newbie question on FindChangeByList script (REVISED)

    Hi...I'm using FindChangeByList (the Javascript version) and I have a question. The default behavior of this script seems to be the following:
    1. If text is selected, then run the script on the text
    2. Otherwise, run the script on the entire document.
    By looking at the script (which I'm pasting below), I can see that the script is intentionally set up this way. I'm totally new to scritping, but by reading the remarks I think these are the relevent lines:
    //Something was selected, but it wasn't a text object, so search the document.
         myFindChangeByList(app.documents.item(0));
    and
    //Nothing was selected, so simply search the document.
       myFindChangeByList(app.documents.item(0));
    MY GOAL:  I want to prevent the script running on my entire document by mistake if I mistakenly don't have the Text tool active.
    I have a feeling that would be very easy to write, but since I know nothing about scripting, I appeal to this forum. Thanks.
    If you need it, the entire script is pasted below. (It's also a standard sample script built into CS4).
    //FindChangeByList.jsx
    //An InDesign CS4 JavaScript
    @@@BUILDINFO@@@ "FindChangeByList.jsx" 2.0.0.0 10-January-2008
    //Loads a series of tab-delimited strings from a text file, then performs a series
    //of find/change operations based on the strings read from the file.
    //The data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text {findWhat:"--"} {changeTo:"^_"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double dashes and replace with an em dash.
    //More complex example:
    //text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    //For more on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //or visit the InDesign Scripting User to User forum at http://www.adobeforums.com
    main();
    function main(){
    var myObject;
    //Make certain that user interaction (display of dialogs, etc.) is turned on.
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    if(app.documents.length > 0){
      if(app.selection.length > 0){
       switch(app.selection[0].constructor.name){
        case "InsertionPoint":
        case "Character":
        case "Word":
        case "TextStyleRange":
        case "Line":
        case "Paragraph":
        case "TextColumn":
        case "Text":
        case "Cell":
        case "Column":
        case "Row":
        case "Table":
         myDisplayDialog();
         break;
        default:
         //Something was selected, but it wasn't a text object, so search the document.
         myFindChangeByList(app.documents.item(0));
      else{
       //Nothing was selected, so simply search the document.
       myFindChangeByList(app.documents.item(0));
    else{
      alert("No documents are open. Please open a document and try again.");
    function myDisplayDialog(){
    var myObject;
    var myDialog = app.dialogs.add({name:"FindChangeByList"});
    with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
       with(dialogColumns.add()){
        staticTexts.add({staticLabel:"Search Range:"});
       var myRangeButtons = radiobuttonGroups.add();
       with(myRangeButtons){
        radiobuttonControls.add({staticLabel:"Document"});
        radiobuttonControls.add({staticLabel:"Selected Story", checkedState:true});
        if(app.selection[0].contents != ""){
         radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
    var myResult = myDialog.show();
    if(myResult == true){
      switch(myRangeButtons.selectedButton){
       case 0:
        myObject = app.documents.item(0);
        break;
       case 1:
        myObject = app.selection[0].parentStory;
        break;
       case 2:
        myObject = app.selection[0];
        break;
      myDialog.destroy();
      myFindChangeByList(myObject);
    else{
      myDialog.destroy();
    function myFindChangeByList(myObject){
    var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, myResult;
    var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, myStory;
    var myStartCharacter, myEndCharacter;
    var myFindChangeFile = myFindFile("/FindChangeSupport/FindChangeList.txt")
    if(myFindChangeFile != null){
      myFindChangeFile = File(myFindChangeFile);
      var myResult = myFindChangeFile.open("r", undefined, undefined);
      if(myResult == true){
       //Loop through the find/change operations.
       do{
        myLine = myFindChangeFile.readln();
        //Ignore comment lines and blank lines.
        if((myLine.substring(0,4)=="text")||(myLine.substring(0,4)=="grep")||(myLine.substring(0,5)=="glyph")){
         myFindChangeArray = myLine.split("\t");
         //The first field in the line is the findType string.
         myFindType = myFindChangeArray[0];
         //The second field in the line is the FindPreferences string.
         myFindPreferences = myFindChangeArray[1];
         //The second field in the line is the ChangePreferences string.
         myChangePreferences = myFindChangeArray[2];
         //The fourth field is the range--used only by text find/change.
         myFindChangeOptions = myFindChangeArray[3];
         switch(myFindType){
          case "text":
           myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "grep":
           myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "glyph":
           myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
       } while(myFindChangeFile.eof == false);
       myFindChangeFile.close();
    function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change preferences before each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    var myString = "app.findTextPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeTextPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeTextOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    myFoundItems = myObject.changeText();
    //Reset the find/change preferences after each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    function myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change grep preferences before each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    var myString = "app.findGrepPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGrepPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGrepOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGrep();
    //Reset the find/change grep preferences after each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    function myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change glyph preferences before each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    var myString = "app.findGlyphPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGlyphPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGlyphOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGlyph();
    //Reset the find/change glyph preferences after each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    function myFindFile(myFilePath){
    var myScriptFile = myGetScriptPath();
    var myScriptFile = File(myScriptFile);
    var myScriptFolder = myScriptFile.path;
    myFilePath = myScriptFolder + myFilePath;
    if(File(myFilePath).exists == false){
      //Display a dialog.
      myFilePath = File.openDialog("Choose the file containing your find/change list");
    return myFilePath;
    function myGetScriptPath(){
    try{
      myFile = app.activeScript;
    catch(myError){
      myFile = myError.fileName;
    return myFile;
    Message was edited by: JoJo Jenkins. Proper script formatting was used and the question was revised and made more concise.

    You can't check which instrument is active in InDesign by script (although you can select it, but it's not useful in your case).
    I suggest you  the following approach: check if a single object is selected and if it's a text frame — if so, make a search without showing the dialog.
    Notice that use
    myFindChangeByList(app.selection[0].parentStory.texts[0]);
    instead of
    myFindChangeByList(app.selection[0]);
    this allows me to process threaded and overset text.
    function main(){
         var myObject;
         //Make certain that user interaction (display of dialogs, etc.) is turned on.
         app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
         if(app.documents.length > 0){
              if(app.selection.length == 1 && app.selection[0].constructor.name == "TextFrame"){
                   myFindChangeByList(app.selection[0].parentStory.texts[0]);
              else if(app.selection.length > 0){
                   switch(app.selection[0].constructor.name){
                        case "InsertionPoint":
                        case "Character":
                        case "Word":
                        case "TextStyleRange":
                        case "Line":
                        case "Paragraph":
                        case "TextColumn":
                        case "Text":
                        case "Cell":
                        case "Column":
                        case "Row":
                        case "Table":
                             myDisplayDialog();
                             break;
                        default:
                             //Something was selected, but it wasn't a text object, so search the document.
                             myFindChangeByList(app.documents.item(0));
              else{
                   //Nothing was selected, so simply search the document.
                   myFindChangeByList(app.documents.item(0));
         else{
              alert("No documents are open. Please open a document and try again.");

  • Epub: Footnotes go to wrong location

    I am on Indesign CS5. I have managed to make an ebook that is perfect apart for one thing:
    the footnotes do not take me to the desired note, but to the last pages of the final chapter. If I browse a few more pages then I can see the note. Clicking on the note number then neatly takes me back. Apparently  Indesign sees no division between the end of the chapter (or of the book) and the starting of the footnotes.
    (NB: I already use the Teus de Jong script to against the footnotes/crossrefs bug).
    Thanks for your time.

    I have the google app, so I can go there, go to Maps and enter it in there and it works fine, but that seems like a lot of extra work. Anyone find a fix?
    I just tried this ("5410 Wilshire Blvd, 90036") and a red pin drops down to a precise street address (looks to be over Vince). Where does your red pin fall?
    Also, I'm finding it near impossible to view traffic on the map if you have a route marked.
    This is a problem I experience as well. Unfortunately the best solution I have found is that once the purple route line has been drawn after tapping Route, to just toggle over to Search and the purple will go away. This way you can see traffic conditions as you have a general idea of where the purple is.
    -SM

  • Text find and change problem in CS3 and CS4 script

    I use the script below to find some text and change into others.
    There is one thing the script can't do it for me.
    Example:
    (g) Management
    (1) that no law which is enacted in the Cayman Islands imposing any tax to be levied on profits, income, gains or appreciation shall apply to the Company or its operations; and
    (2) that the aforesaid tax or any tax in the nature of estate duty or inheritance tax shall not be payable on or in respect of the shares, debentures or other obligations of the Company.
    Example:(END)
    I got a lot of topics or points in the passage. And I want to change the space between '(g)' and 'Management' into a tab character. So I revised the plain text file 1text.
    PS: 1text.txt is filled with what to change.
    text {findWhat:"^p(^?) "} {changeTo:"^p(^?)^t"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all space-dash-space and replace with an en dash.
    The result is:
    (^?)^tManagement
    (^?)^tthat no law which is enacted in the Cayman Islands imposing any tax to be levied on profits, income, gains or appreciation shall apply to the Company or its operations; and
    (^?)^tthat the aforesaid tax or any tax in the nature of estate duty or inheritance tax shall not be payable on or in respect of the shares, debentures or other obligations of the Company.
    PS: ^t is a tab character.
    result (END)
    This is not what I want.
    It should be '(g)^tManagement'.
    PS: ^t is a tab character.
    Please someboady help me out to revised the script below to change the text into what I want. Thanks so much.
    Here is the script.
    //FindChangeByList.jsx
    //An InDesign CS4 JavaScript
    @@@BUILDINFO@@@ "FindChangeByList.jsx" 2.0.0.0 10-January-2008
    //Loads a series of tab-delimited strings from a text file, then performs a series
    //of find/change operations based on the strings read from the file.
    //The data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text {findWhat:"--"} {changeTo:"^_"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double dashes and replace with an em dash.
    //More complex example:
    //text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    //For more on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //or visit the InDesign Scripting User to User forum at http://www.adobeforums.com
    main();
    function main(){
    var myObject;
    //Make certain that user interaction (display of dialogs, etc.) is turned on.
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    if(app.documents.length > 0){
      if(app.selection.length > 0){
       switch(app.selection[0].constructor.name){
        case "InsertionPoint":
        case "Character":
        case "Word":
        case "TextStyleRange":
        case "Line":
        case "Paragraph":
        case "TextColumn":
        case "Text":
        case "Cell":
        case "Column":
        case "Row":
        case "Table":
         myDisplayDialog();
         break;
        default:
         //Something was selected, but it wasn't a text object, so search the document.
         myFindChangeByList(app.documents.item(0));
      else{
       //Nothing was selected, so simply search the document.
       myFindChangeByList(app.documents.item(0));
    else{
      alert("No documents are open. Please open a document and try again.");
    function myDisplayDialog(){
    var myObject;
    var myDialog = app.dialogs.add({name:"FindChangeByList"});
    with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
       with(dialogColumns.add()){
        staticTexts.add({staticLabel:"Search Range:"});
       var myRangeButtons = radiobuttonGroups.add();
       with(myRangeButtons){
        radiobuttonControls.add({staticLabel:"Document", checkedState:true});
        radiobuttonControls.add({staticLabel:"Selected Story"});
        if(app.selection[0].contents != ""){
         radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
    var myResult = myDialog.show();
    if(myResult == true){
      switch(myRangeButtons.selectedButton){
       case 0:
        myObject = app.documents.item(0);
        break;
       case 1:
        myObject = app.selection[0].parentStory;
        break;
       case 2:
        myObject = app.selection[0];
        break;
      myDialog.destroy();
      myFindChangeByList(myObject);
    else{
      myDialog.destroy();
    function myFindChangeByList(myObject){
    var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, myResult;
    var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, myStory;
    var myStartCharacter, myEndCharacter;
    var myFindChangeFile = myFindFile("/FindChangeSupport/1test.txt")
    if(myFindChangeFile != null){
      myFindChangeFile = File(myFindChangeFile);
      var myResult = myFindChangeFile.open("r", undefined, undefined);
      if(myResult == true){
       //Loop through the find/change operations.
       do{
        myLine = myFindChangeFile.readln();
        //Ignore comment lines and blank lines.
        if((myLine.substring(0,4)=="text")||(myLine.substring(0,4)=="grep")||(myLine.substring(0, 5)=="glyph")){
         myFindChangeArray = myLine.split("\t");
         //The first field in the line is the findType string.
         myFindType = myFindChangeArray[0];
         //The second field in the line is the FindPreferences string.
         myFindPreferences = myFindChangeArray[1];
         //The second field in the line is the ChangePreferences string.
         myChangePreferences = myFindChangeArray[2];
         //The fourth field is the range--used only by text find/change.
         myFindChangeOptions = myFindChangeArray[3];
         switch(myFindType){
          case "text":
           myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "grep":
           myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "glyph":
           myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
       } while(myFindChangeFile.eof == false);
       myFindChangeFile.close();
    function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change preferences before each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    var myString = "app.findTextPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeTextPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeTextOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    myFoundItems = myObject.changeText();
    //Reset the find/change preferences after each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    function myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change grep preferences before each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    var myString = "app.findGrepPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGrepPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGrepOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGrep();
    //Reset the find/change grep preferences after each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    function myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change glyph preferences before each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    var myString = "app.findGlyphPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGlyphPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGlyphOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGlyph();
    //Reset the find/change glyph preferences after each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    function myFindFile(myFilePath){
    var myScriptFile = myGetScriptPath();
    var myScriptFile = File(myScriptFile);
    var myScriptFolder = myScriptFile.path;
    myFilePath = myScriptFolder + myFilePath;
    if(File(myFilePath).exists == false){
      //Display a dialog.
      myFilePath = File.openDialog("Choose the file containing your find/change list");
    return myFilePath;
    function myGetScriptPath(){
    try{
      myFile = app.activeScript;
    catch(myError){
      myFile = myError.fileName;
    return myFile;

    It takes me a lof of time to comprehend the sentence you write. Cause I am a Chinese. My poor English.
    I have to say "you are genius". I used to use the indesign CS2. There is no GREP function in CS2. When I get the new script, I do not know how to use it. Just when I saw the
    'grep {findWhat:"  +"} {changeTo:" "} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces.'
    Being confused.
    Thanks so much. It seems I have to relearn the advanced Indesign.

  • How renumber footnotes at the beginning of each chapter?

    Hi!
    I work in Indesign 6 with very large books in which the author continually add text and pages make me travel pages, each chapter should begin with footnote number 1.
    If I do with these sections do not move when I add pages and I have to update a one to hand.
    You could do something by script?
    Thank you very much in advance

    http://www.id-extras.com/products/sections-stuff

Maybe you are looking for