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.

Have you ever considered how your numbers look in your table of contents, in your tables, or in your running text? Most modern typefaces (OpenType) contains different figures for different purposes - learn to master them to make a subtle but important facelift of your design.

The most obvious figures are the lining figures and the hanging (Oldstyle) figures - lining being where the figures "stands" on the baseline with equal height, and hanging being the figures positioned relatively to the baseline and x-height.

A table of contents using proportionally spaced hanging figures.

A table of contents using proportionally spaced hanging figures.

The spacing between the figures are really important, either you choose them to be tabularly or proportionally spaced. The default setting in most modern fonts are proportionally, since it is the pretties when the figures are written in context with other text - but as soon as the figures are placed as a part of a table with many numbers, or in this case a table of content, tabular is the way to go.

The same table of contents, but with tabularly lining figures instead.

The same table of contents, but with tabularly lining figures instead.

Tabular figures are always the same width, so they as illustrated are placed right on top of each others, but not as beautifully spaced next to each others.

In many fonts, this width is equal to an EN, but since this is not always the case, you in InDesign have the Figure space available, so that you in a text with many numbers on top of each others, can use figure spaces instead of word spaces to match the exact width of the figure.

Using figure spaces to indent tabular figures. Also illustrated here, the slashed zero figure.

Using figure spaces to indent tabular figures. Also illustrated here, the slashed zero figure.

In the previous illustration you can also see another type of figure type available in many modern fonts, the slashed zeros.

There are several ways of discovering what types of figures are available in a specific font through OpenType:

  1. Check the font specimen where this always is detailed - it is of course a selling point.
  2. You can check the glyph palette for alternative figures (as with stylistic sets).
  3. You can open the character panel (CMD+T/CTRL+T) and check the OpenType menu item - if an option is unavailable it will be surrounded by square brackets.

The character panel with the OpenType menu open.

The character panel with the OpenType menu open.

For instance, turning on Fractions will make sure that numbers written like 1/100 will be using a real fraction slash, and real numerators and denominators, which separately also are available in the OpenType settings for text.

A fraction with real numerators and denominators.

A fraction with real numerators and denominators.

Be sure to also read the earlier guides in the Better typography series: The right quotation marks, Using the baseline grid, Optical alignment and Creating and organising styles.

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.

In my dream world, all received texts for books etc. is marked up using styles from e.g MS Word. In my real world, that is unfortunately rarely the case.

I have written this script to help in the situations where a long text is formatted quite consistently, different headings are perhaps marked with bold and in a bigger font size, quotations are italic etc.

Walkthrough

I have imported a text file in InDesign, but it is not marked up with styles correctly, and there would be no reason to reuse the current styles. So I will just delete all the imported styles, but preserve the formatting, so the style panels are all clean.

Text is imported and all styles are deleted.

Text is imported and all styles are deleted

Placing the cursor in the text flow somewhere will let the script know what story I want it to work with. Now, activating the script, it will automatically run through all paragraphs in the story, check how they differ from the Basic Paragraph style, and create new one's where needed.

In this case, the only differing thing is the oblique font style.

In this case, the only differing thing is the oblique font style

Each time it has created a new style, it will also check if that style will apply to the paragraph it is checking, ensuring that all the paragraphs with the same text formatting will end up having the same paragraph style.

Furthermore it will also check all text for any local formatting within the paragraphs, so bold text will get a character style, italic text, coloured text etc. Also these will be reused, so where its applicable the same style will be used.

An example of an automatically created paragraph and character style.

An example of an automatically created paragraph and character style

Where you go from the result of a lot of AutoStyles is up to you. I prefer to create new styles, then delete the AutoStyles one by one from the panel, replacing them with the new styles.

The script will unfortunately not do all the hard work for you, but is a great tool in cleaning up messy documents!

The script

The JavaScript can be downloaded here: auto_create_p_c_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.

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

Known bugs:

  • If the first word of a paragraph is "locally formatted", the script will think that is the "general formatting" of the whole paragraph.