Some of my posts on the blog are tagged with "wishlist", obviously because it explains some of my feature wishes for future versions of InDesign. One of the posts explains my wish for being able to mark up the same text with multiple character styles, and also explains some of the workarounds that could be used achieve it.

The need for tagging things with multiple character styles has for me not always just been to apply styling, but also for using the style as a "marker" for future reference. E.g. in a specific project I am currently planning, where we are preparing a huge launch of a new Bible translation with many different editions. Here we wan't to prepare the InDesign files for new different future editions as well, tagging all kinds of different text. E.g. "words of Jesus", "words of God", "names", "places" etc.

Digging into InDesign's different possibilities for marking up text - XML tags, character styles, color swatches, conditional text - only conditional text allow you to mark up the same text with more "tags" of the same kind.

For multiple index purposes, the best solution is "nesting" the indexes, by creating "level 1 topics" for each index, and adding the index references under them. Then by generating the index all the indexes will be generated, and you can just delete the ones you don't want in the edition.

Script for marking text with multiple character styles

To make an alternate solution for applying multiple character styles to the same text, other than nested styles, grep styles etc. as mentioned in the wishlist post, I have prepared a script to apply character style formatting to text with specific conditional text tags applied.

First of all, prepare your document with conditional text tags for the styles you want to apply, and for each tag create a character style with the same name.

Preparing the document for multiple character styles by creating conditional text tags and character style pairs.

Preparing the document for multiple character styles

Next you want to apply the conditional text tags to the text you want to format. In this case I have only prepared a "Red" style, and a "Small-caps" style. In addition to these I have made a "Italic" style, which is already applied to some text.

Notice especially the words "voluptatem" and "lacerfernam" that has the italic style already applied, and the word "accus" which is both marked up with the "Red" and "Small-caps" conditional text tag.

The only thing left is running the script, which will result in this:

Result after running the multiple character styles script.

Result after running the multiple character styles script

To explain what just happened - the script finds all text with the conditional text tags applied, in the order of the tags in the conditional text panel. Then the styling of the character style is applied, but the style itself is not applied - so basically the styling is added "locally" and will be removed if the style is later overridden.

Knowing the process can explain issues you might experience - if you make a style/tag pair called "Red" and one called "Yellow", in that order, the "Red" style formatting will applied first, and then the "Yellow", making the text yellow, and not red.

Running the script will not remove the tagging of the text, so if you "run it to soon" and override some styles, you can always run the script again to re-apply the local formatting.

I hope you find use of the script, at least until Adobe hopefully adds real support for multiple character styles!

The script

The JavaScript can be downloaded here: multiple_character_styles.jsx.

You can add it to your Scripts palette and run it from there. To do that, place the file inside the "~/Library/Preferences/Adobe InDesign/Version 6.0/Scripts/Scripts Panel" folder.

As I wrote about back in march I was wishing for inline text boxes. Boxes flowing with the text, that also should be able to "break" across text columns etc.

To fulfill my wish I wrote a small script, creating a more flexible workaround. Other workarounds was also mentioned in the old article, but this is an automated alternative to another manual approach, drawing a frame behind the given text.

An example of the automatic result.

An example of the automatic result

How the frame is supposed to look is defined by an object style, but furthermore it allows you to add a padding around the the box, so you are not limited by the text frame the text is in.

To make sure the frame is placed behind the text, they are all put in their own layer.

The layer palette with the required layer.

The layer palette with the required layer

The script also allows you to have more than one kind of box texts, you just have to set up your document correctly. For it to work it will need the following:

  • A layer with the name "Boxes" placed lower than the text
  • For each text box style, an object style named like "Box: Blue boxes"
  • A paragraph style with the same name as the object style, but without the "Box: " prefix

For an example of this setup, please download the sample document from this page.

Paragraphs and object styles.

Paragraphs and object styles

The object style you define are applied to the boxes, this allows you to define e.g. fill color, transparency, strokes etc.

To add a padding to the box, define an inset spacing in the the object styles Text Frame General OptionsCrop Amount in Frame Fitting Options.

Defining the padding as Crop Amount

Defining the padding as Inset Spacing

When you run the script, the boxes will be added behind all the text marked up with one of your box text paragraph styles, but please note that they will not "follow" the text as you type. Don't worry though, you can always run the script again, and it will rearrange the boxes.

The script

The JavaScript can be downloaded here: automatic_text_boxes_1.1.zip.

You can add it to your Scripts palette and run it from there. To do that, place the file inside the "~/Library/Preferences/Adobe InDesign/Version 6.0/Scripts/Scripts Panel" folder.

Changelog

1.1: Added support for "negative padding" - making the boxes smaller than the width of the column.

I was asked on Twitter if I could throw together a small script to resize a text selection by a defined amount of points.

If you have a text selection with various sizes of text, you can't quickly resize it by a few points, without resizing all text to the same point size. This script allows you to resize the text selection, and handles the different sized text in the selection.

The dialog box that opens when activating the script.

The dialog box that opens when activating the script

The script supports both positive and negative values, so you can both decrease and increase the sizes.

The script

The JavaScript can be downloaded here: resize_selected_text.jsx.

You can add it to your Scripts palette and run it from there. To do that, place the file inside the "~/Library/Preferences/Adobe InDesign/Version 6.0/Scripts/Scripts Panel" folder.

Note that depending on the length of your document, the script might take a while to run.

I have uploaded an updated version of the Search and change case script so it now supports a couple of extra features.

In addition to changing the case you can now apply a character style to the found text or make a local formatting change to "Small Caps" or "OpenType All Small Caps". Keep in mind that if you apply a character style, it will override the current character style of found items, if any.

Thanks to David Blatner for the idea.

The script is written in JavaScript and should work on both Windows and Mac in CS3 and CS4. You can download it from here.

Related to my guide regarding on using GREP styles to change words to small caps, I recently wrote this small script to let you really change case in a search.

The dialog box that opens when activating the script.

The dialog box that opens when activating the script

Activating the script lets you type in a search string, which also accepts GREP, and selecting which of the four cases you want the text transformed to, UPPERCASE, lowercase, Title Case or Sentence case. The script also lets you search a single story or a whole document.

The end result.

The end result

The script

The JavaScript can be downloaded here: search_change_case.jsx.

You can add it to your Scripts palette and run it from there. To do that, place the file inside the "~/Library/Preferences/Adobe InDesign/Version 6.0/Scripts/Scripts Panel" folder.
Note that depending on the length of your document, the script might take a while to run.

Changelog

1.5: Added options for applying a character style or local small caps formatting for the found text.