Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

adding a period to the end of every footnote

Return to Member Forum

  • Author
    Posts
    • #76582
      Anonymous
      Inactive

      Hi, is there a way (I’m assuming with GREP) to add a period to the end of every single footnote in my document?
      many thanks

    • #76585
      David Blatner
      Keymaster

      I can’t think of any way to search for “only text that is in a footnote.”

    • #76614

      You can search for the Footnote Number code, but that will only locate the first character position, not the last. So I would suggest a Javascript:

      for (st=0; st<app.activeDocument.stories.length; st++)
        for (fn=0; fn<app.activeDocument.stories[st].footnotes.length; fn++)
          app.activeDocument.stories[st].footnotes[fn].texts[0].insertionPoints[-1].contents = ‘.’;
      

      This loops over all ‘stories’ (continuous text threads), and inside each story over all of the footnotes. The insertionPoints property points to possible cursor positions (i.e., ‘between’ characters), and the shortcut [-1] is to set it to the very last position. Setting its contents to something is the same as inserting a character on that position.

    • #76617
      Anonymous
      Inactive

      thank you. I also just got this reply from a colleague (in case it helps anyone else)
      You simply say $0. which means “found text” followed by a period. Obviously this depends on you really having what you find be accurate. You can search for any end letter of digit [[:alnum:]]
      that is located at the end of a paragraph $
      thus your search would be this [[:alnum:]]$

      This would mean that the last letter or digit in a sentence without punctuation would come up and then you do replace with $0. and it will keep what you found and add a period. If you want it only to search the footnotes, just have it search for only the footnotes paragraph style.

    • #76621
      David Blatner
      Keymaster

      Ah! Rayzel, I did not think to limit the scope based on the paragraph style. Yes, of course that is a great solution…

      Slightly easier is to search for .$ which just means ‘the last character in the paragraph.’ Then you can replace with $0., as you suggested.

    • #76877

      Hi, if several lines or sometimes any punctuation, a research based on the para style with this regex:
      Find: [^.?!~e]\z
      Replace by: $0.
      Could be cool! ;-)

Viewing 5 reply threads
  • You must be logged in to reply to this topic.
Forum Ads