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

How to find Superscript using FindChangeByList?

Return to Member Forum

  • Author
    Posts
    • #62072
      Matt Mayerchak
      Participant

      I’ve been using RecordFindChange.jsx with FindChangebyList etc. . . for quite a while. But I’ve noticed that RecordFindChange.jsx records the find query, but not all of the formatting specified in the search. I.e. if I want to do a GREP search for superscripted #s and apply a character style, it ignores the “superscript” setting. If I try using the text tab to find the superscripted text, again it ignores the character formatting in the line of script it exports.

      It does recognize Underlining (records this as “Undersline: true”) – my guess is that the settings that have checkboxes work but not the ones with mini-dropdown menus. I tried typing “Position:Superscript” and “Superscript:True” in the search field of the script line, but the first crashed the script and the 2nd was ignored.

      Anyone know how to include superscripting in scripted find/change? I know I can do this with regular find/change or Multi-find/change but I like FindChangebyList because it’s easier to look at your queries if there is a problem and fine tune them instead of having to re- create them. With Multi-FindChange it's more work to see what each search is doing and you can only view them one at a time by going to the F/C dialog box. I have to run about 30 Find/Change queries at a time on batches of about 100 pages of raw text.

      I looked at the javascript Indesign Scripting Reference for Indesign online https://indesignscriptingrefere…..m and see that in the category “Position” ther options are NORMAL, SUPERSCRIPT, SUBSCRIPT etc. . . does this mean I should be able to use these, and do they have to be in all caps?

      And, is there any way to tweak the RecordFindChange script so it will include ALL of the formatting attributes?

    • #62118

      This works for me:

      grep tab {findWhat:”\d+”, position:Position.SUPERSCRIPT} tab {appliedCharacterStyle:”Superscript”}

    • #62119
      Matt Mayerchak
      Participant

      Kasyan – thanks a million! I will test that out immediately.

    • #62180

      I looked at the javascript Indesign Scripting Reference for Indesign online …

      “THE”!? That's not THE Javascript ref online, it's an advertisement-riddled pirated copy of one of the first versions of the HTML I made, and without any acknowlegdement of any kind.

      My revenge was sweet, though. Driven by fury, I made “the” (my) version even better .. faster .. stronger .. and still without any advertisements. Download from https://www.jongware.com/idjshelp.html, or, with thanks to John Hawkinson of MIT, browse on-line at https://jongware.mit.edu (click one of the folders for your version).

      </rant>

    • #62181
      Matt Mayerchak
      Participant

      Thanks, Jongware. I did not realize I was posting a link to a pirated version. I look forward to perusing your reference files.

    • #62184

      Yeah well. As such things go, it has greatly reduced my faith in the decency of my fellow men.

      I have been working on a truly fantastic script for the past three months, one that lots of InDesigners would welcome as a valuable addition to their tool set — but then again, why should I bother if all it takes is one ingrate to put his own name under it (“Amit Verma”, in this case) and then sell it as his own creation? Keeping in mind that I don't do it for the money, I do it for the fun of it. Now that's a real party pooper.

    • #62185
      Matt Mayerchak
      Participant

      Well, I for one would be really interested to see what you're working on. Learning Javascript is high on my priority list . . . but even when I do I know I will continue to be deeply indebted to people such as yourself who do it for the challenge of it.

      I agree that it's fun to solve problems and find ways to get the computer to do things for us. That's the whole point, isn't it? My rule of thumb is that anytime I do the same thing 3 times in a row I think, “there must be a way to have the computer do it for me.”

      Thanks for all your great [free] scripting.

    • #70983

      Hi all,

      I have doubt in find and replace,

      How to find a space before superscript characters.

      Thanks

      Jeeva

    • #71083
      Matt Mayerchak
      Participant

      I don’t know of a way to find a space before superscript, because superscript is a formatting attribute and you can’t find mixed formatting attributes (assuming you mean that the space is NOT superscripted).

      But, you can use a 2-step workaround:

      Step 1 is to find all superscript characters that have a space before them with GREP, using positive look behind for space characters, and in the Change field, you can insert something unique (like 2 bullets ••) before whatever is found without changing what is found. So, space+(superscript)9 would change to space••9

      (i.e. you don’t look for the space – you look for the superscript characters that are preceded by a space)

      Then, if you want to remove all of those spaces, you can just find all space+•• and remove them all.

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