Script to apply Italics to your word choice

Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Script to apply Italics to your word choice

Viewing 8 reply threads
  • Author
    Posts
    • #94324
      Kelli Fleck
      Member

      I am wondering if someone could help me write a script for applying a character style “italics” to a list of words. I want to use this to apply italics to species names and I have a list of common names that need to be italicized. For example “E. Coli” is always italics.

    • #94326

      Kelli, this is possible with minor effort. But it’s not good practice (anymore) to call for a script and someone will write it for free. So if you interested in a paid version, mail me at [email protected]

      Kai

    • #94327
      Masood Ahmad
      Participant

      Kelli, you don’t need a script for this simple task. Try GREP styles…

      Sorry Kai :)

    • #94328

      Masood, no problem, but this will not work in a good way with GREP-Styles. The reason is simple: I assume, that Kelli have a long list and if it should work with a Grep-Style, you need a alternation. This can slow down the performance of the doc, so I would do it with find/change. Of couse, this can work with a alternation (Kelli|Masood|Kai) too, but is maybe confusing.

    • #94329
      Masood Ahmad
      Participant

      Well that depends how you take it. For me I will go for GREP styles. At least you don’t have to verify whether the style has been applied or not.

    • #94330

      Hi all!

      Kai is totally right!

      Just [and only] for comment:

      I’ve written a script for that one year ago! [ 0006_ApplyCharStyleByList_MichelAllio.jsx ]

      It’s very cool because it plays with x different lists with x char styles to be applied!

      Masood, maybe a video!? ;-)

      (^/)

    • #94337
      Kelli Fleck
      Member

      I will just use the GREP styles and I have the “chainGREP” script that will combine the greps into one click, for now. I wanted to learn how to write a script so I could easily edit the script with the term list rather than create a GREP command each time. I think it would be fairly easy to write this script, so I will research it. Thanks all!

    • #94353
      David Blatner
      Keymaster

      Hi Kelli, that’s awesome that you want to learn how to script InDesign! This sounds like a great example of something that could be scripted.

      (As others have said: If it were just 4 or 5 words, then grep styles would be okay. But if you had 20 or 200 or more words, then a script is the way to go!)

      Here are some resources for learning scripting:
      https://creativepro.com/learn-to-automate-indesign-by-scripting.php
      https://creativepro.com/javascript-for-the-absolute-beginner.php

      Learn InDesign Script with new Lynda.com course

    • #94356
      Kelli Fleck
      Member

      Thanks David!

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