SizeLabels

Installing

To install SizeLabels, you first need to download the free PluginInstaller application.

The PluginInstaller application is somewhat similar to Adobe’s Creative Cloud app – it manages downloading, installing, activating, purchasing… of third party scripts and plug-ins.

See further for detailed instructions (heading ‘Installation‘)

We also have a YouTube demo-video. Visit https://www.youtube.com/watch?v=PEJnxxF0JnA

Purchasing Process

To enable to ‘pro’ features, you need to purchase a US$4 license: for more info on the purchasing process, see https://www.rorohiko.com/wordpress/plugininstaller/

What is it?

SizeLabels is a script for Adobe InDesign. We’ve tested it with InDesign 2023 and above.

SizeLabels looks at all the frames in your document, adds a small label frame next to each frame it finds, and sets the content of the added label frame to the size of the associated frame.

Suppose you have some very precise specifications for the sizes for the individual frames in your document.

You could work your way through the document frame by frame and verify all the sizes. Or print a proof of the document, and then someone could sit down and verify each printed frame with a ruler to make sure the size is correct. But why not let InDesign do the work?

So here is our document:

I have already installed SizeLabels on my computer. When I bring up the Scripts palette (via the Window – Utilities – Scripts menu):

I can see the SizeLabels.jsx script sitting on the Scripts palette.

I now double-click the SizeLabels.jsx script on the palette to set things in motion.

A few seconds later, my layout looks like this:

As you can see, a small text frame has been added in the top left corner of every frame. In the small text frame you can see the width and height of the corresponding frame.

In the default configuration, the frame size is expressed in inches. If you don’t want inches – don’t despair! I’ll explain how to configure the script to use another measurement unit later.

Note: the size labels are not ‘live’: if you move one or more frames, the associated size labels won’t auto-adjust or stay attached to their associated frame.

Instead, you should double-click the script on the Scripts panel again. The script will then re-generate and reposition the labels as needed.

In other words: each time you modify the layout you should re-run the script to update the labels.

At some point in time you’ll want to take away those added text frames.

Easy: the script has put all these label frames on a separate layer, named SizeLabels. To delete all the added labels in one go, simply delete the layer.

Bring up the Layers panel via the Window – Layers menu:

Select the SizeLabels layer, then click the little trash can icon:

InDesign will show an alert – proceed by clicking OK.

All the size labels will disappear.

Using a different text style

Changing the text style in the size labels is easy.

SizeLabels.jsx will try and find a paragraph style SizeLabelStyle in the document, and when it finds such a style by that name, it will apply it to the text in the size labels as it creates them.

If you don’t have a paragraph style by that name, SizeLabels.jsx will use whatever is the default style for your document.

Let’s create a style that makes those labels use Comic Sans, 12 pt.

Bring up the Paragraph Style palette via the Type – Paragraph Styles menu.

On the Paragraph Style panel, you need a style named SizeLabelStyle. If you have copied the sample frame from our sample document, that style will already be present. If not, create a new style by that name.

The name must be SizeLabelStyle. Don’t add any spaces anywhere in the style name – it has to be exactly right.

In the Basic Character Formats, you can adjust the font and size:

You can adjust any style setting you like in this dialog; for example, you could pick a different character color if you wanted, or you could have the text centered instead of left-aligned. Feel free to experiment. Click OK when you’re done.

Now run the script, exactly as shown before (i.e. double-click the SizeLabel.jsx on the Scripts palette).

And thanks to the power of paragraph styles, once the paragraph style is in place, you can continue to modify the paragraph style SizeLabelStyle to your liking after you’ve run the script.

All size labels will immediately pick up those changes, without needing to re-run the script.

Using a different text frame style

If you wanted to make the size label have a background color, and , say, apply a small text inset, you can do that by means of an object style.

Just like the SizeLabelStyle paragraph style, the SizeLabels.jsx script will also look for an object style by the name SizeLabelObjectStyle. If that style exists, the script will apply that object style to all the size labels.

Using different units

Now, you would prefer centimeters instead of inches? That’s possible too.

The easiest is to use the sample document that comes with the script.

On your scripts panel, you should see an entry Copy Sample File with Documentation to Desktop.jsx

Double-click it to open the sample document.

On the pasteboard of that document, you should find are three frames. Two large ones and a small one.

One is a text frame with explanatory text, the second is a frame that lists the configuration settings for the SizeLabels script, and the third is a small ‘template’ for the SizeLabel frames.

The easiest way to set up your own documents, is to simply copy the frame with configuration data as well as the template SizeLabel frame, and paste both of them onto the pasteboard of your own document.

Then tweak the config data, the paragraph style and the object style as desired.

Configuration

You can change the behavior of the script by modifying the configuration data in the text frame on the pasteboard.

INI configuration frame

The format is pretty self-explanatory; skip over this section if too much info.

The detailed TL;DR information for the formatting rules:

The text frame is formatted in a format similar to the old-style Windows INI format, with some additional flexibility built-in.

The advantages of this approach is that each document can ‘carry’ its own configuration and the configuration is plain for everyone to see, in a human-readable form, rather than being hidden away on some preferences dialog.

  • The information is spread over multiple paragraphs or lines.
  • There are two types of relevant lines: [SECTION] or name=value. Any lines that do not consist of either a name in square brackets or a name, an equal sign and a value are ignored.
  • The information within the square brackets (the SECTION) or information to the left of the equal signs should not be edited (the name).
  • The name to the left of the = are case-insensitive and only letters a-z and digits 0-9 are taken into account. Names like abc, a B c, or A'b'c are all interpreted as the same thing – abc
  • The information to the right of the equal signs can be freely edited
  • By default, leading and trailing spaces are ignored.
    someData =some Value
    someData=       some Value
          someData      =        some Value

    are all equivalent – they all mean someData="some Value"

  • Quotes can be used to express leading or trailing spaces. Curly quotes are seen as equivalent to regular quotes.
    someData = "  some Value  "
    someData= “  some Value  ”

    both indicate that someData="  some Value  " including the leading and trailing spaces.

  • Numeric values can have units and the script will auto-convert between units as needed. If the horizontal unit is cm and the label frame width is written as 1 inch, the width will automatically be interpreted as 2.54 cm

Description of the options

horizontal unit

(Standard Feature). This is the unit to be used for the frame width info. If the frame is 1" wide, and the horizontal unit is cm then the value shown will be 2.54

vertical unit

(Standard Feature). This is the unit to be used for the frame height info. If the frame is 0.25" wide, and the vertical unit is point then the value shown will be 18

label frame width

(Standard Feature). The fixed width of each label frame. This value can have a unit. If no unit is present, then the value is assumed to be in horizontal unit

label frame height

(Standard Feature). The fixed height of each label frame. This value can have a unit. If no unit is present, then the value is assumed to be in vertical unit

dont label frames below width

(Standard Feature). The minimum width a frame needs to have before it can get a size label. If no unit is present, then the value is assumed to be in horizontal unit

dont label frames below height

(Standard Feature). The minimum height a frame needs to have before it can get a size label. If no unit is present, then the value is assumed to be in vertical unit

add image filename to label

(Standard Feature). A yes/no value. If this is set to yes, any size label for an image frame will also get the image file name, in addition to the frame size.

lock layer

(Pro feature). A yes/no value. If this is set to yes, the SizeLabels layer will be locked after running the script.

That way, it helps avoid inadvertent use of this layer. You don’t want to add items to it, as the layer is a throw-away layer that can be deleted in order to get rid of all size labels. Locking it avoids accidentally placing items on the layer.

scale

(Pro feature). A floating point number. All frame sizes are multiplied by this number before being added to the size label. This is useful if the layout is scaled down – e.g. if the layout is 1/10th scale, you would set the scale to 10. A frame that is 1" on the page would then be labeled as 10".

add unit names

(Pro feature). Append the unit names to the sizes on the size label.

override horizontal unit name

(Pro feature). Use this for the horizontal unit name. For example, if you have a layout that is 1/100 scale and a 1 cm wide frame represents a 1 m actual size, you could set horizontal unit to cm and then also override horizontal unit name to m. The 1 cm frame would then be labelled as being 1 m wide.

override vertical unit name

(Pro feature). Use this for the vertical unit name. For example, if you have a layout that is 1/100 scale and a 1 cm high frame represents a 1 m actual size, you could set vertical unit to cm and then also override vertical unit name to m. The 1 cm frame would then be labelled as being 1 m high.

prefix horizontal with

(Pro feature). Add a prefix before the width of the frame. Example: prefix horizontal with = "W="

prefix vertical with

(Pro feature). Add a prefix before the height of the frame. Example: prefix vertical with = "H="

label nested frames

(Pro feature). A yes/no value. Normally, frames that are nested within larger frames are not labelled. By setting this to yes such frames will be labelled.

omit image frames

(Pro feature). A yes/no value. Don’t label any image frames if this is set to no.

omit text frames

(Pro feature). A yes/no value. Don’t label any text frames if this is set to no.

omit other frames

(Pro feature). A yes/no value. Don’t label any frames that are neither text nor image frame if this is set to no.

ignore frame with script label

(Standard feature) By default, any frame that carries a script label ignore will not be labelled.
(Pro feature) If you want to use a different string instead of ignore, you tell SizeLabels what that string is – e.g. ignore frame with script label = nolabel will not label any frames that carry a script label nolabel.

round to decimals

(Standard feature) By default, all numerical values are rounded to 2 decimals.

(Pro feature) You can change the rounding by changing this value

swap width and height

(Standard feature) By default, the size label contains height, then width.

(Pro feature) Yes/no value. You can swap things around, and have width, then height.

separator between image name and size

(Standard feature) By default, the image file name is separated from the width and height by  - 

(Pro feature) You can change the separator string to something else.

separator between width and height

(Standard feature) By default, the height and width are separated by  x 

(Pro feature) You can change the separator string to something else.

layer name for labels

(Standard feature) By default, the layer that carries the size labels is called SizeLabels

(Pro feature) You can change the name of the layer being added. For example, you could run the script, then change some settings and change the layer name, and run the script again to add a second layer.

apply label style name

(Standard feature) By default, the paragraph style SizeLabelStyle, if present, will be applied to the content of the size labels.

(Pro feature) You can change the name of the style to be applied on the next script run.

apply label style name

(Standard feature) By default, the object style SizeLabelObjectStyle, if present, will be applied to the size labels.

(Pro feature) You can change the name of the object style to be applied on the next script run.

Installation

PluginInstaller

The PluginInstaller is a tool to download/install/uninstall various scripts. SizeLabels needs to be downloaded and installed by way of PluginInstaller.

You can download PluginInstaller here:

https://store.tgrg.net/

PluginInstaller is a stand-alone application.

After downloading and unzipping, you can move the PluginInstaller folder to some convenient location on your hard drive (e.g. /Applications on Mac, or C:\Program Files on Windows).

After you have moved the PluginInstaller folder, you need to open the PluginInstaller folder and launch/quit the PluginInstaller application by double-clicking its icon. Doing this allows it to auto-configure itself to its new surroundings.

Store

On your hard disk, PluginInstaller maintains a local catalog of various software products you might want to download/install/uninstall.

Initially, this local catalog is empty. We need to add to it by visiting the Store.

Once the PluginInstaller is up and running, use the Windows – Browse the Store for Software menu to visit the Store.

In the Store, visit the Rorohiko offerings by clicking the Catalog of Rorohiko Licensed Products link.

Then click the entry for SizeLabels for InDesign.

This will add SizeLabels to the local catalog and provide the PluginInstaller with the necessary data it needs to download/install/uninstall/update… the SizeLabels script.

Downloading the Script

Now that PluginInstaller has an entry for SizeLabels, it can now download and install the software.

Use the Window menu to open the Installing and Ordering window, select the SizeLabels entry, then click the Download button.

Wait until the download completes – a message To install/uninstall… appears at the bottom of the window once the download has completed.

Next, use the Install Target dropdown menu and pick a target. If you have multiple copies of InDesign installed (different version and/or language), this menu will allow you to pick where to install the script.

Then click the Install button. The script is now installed into the targeted version of InDesign, and becomes available on the InDesign Scripts panel (Window – Utilities – Scripts). 

The Install button becomes disabled and the Uninstall button becomes enabled – this indicates that the script is currently installed in the selected install target.

Later on, if you want to update the script, you’ll have to first click Uninstall, then click Install.

Purchasing

To retain access to the ‘Pro’ features, you need to purchase a US$4 activation.

Activations are ordered by way of the PluginInstaller.

Please read the ‘how-to’ instructions here: https://www.rorohiko.com/wordpress/plugininstaller/

Version history

Version 1.0.2: March 26, 2024
– Small bug fixes, first public release of the rewrite

Version 1.0.1: March 20, 2024
– Rewrote script using CRDT_ES
– Moved configuration into pasteboard frame
– Added a bunch of new features: custom units, properly handle picas and ciceros…

Version 0.0.4: July 25th, 2012:
– Added support for EPS files

Version 0.0.3: July 24th, 2012:
– Added option to include image file name in labels.
– Fixed possible conflict with a character style inadvertently overriding the SizeLabelStyle.
– Made label separators configurable (default separators are ” – ” and ” x “, e.g. “MyImage.jpg – 12.02 x 4.23”)

Version 0.0.2: June 23rd, 2012:
– Version 0.0.1 did not handle anchored or inline frames correctly. Now fixed.

Version 0.0.1: June 3rd, 2012:
– Initial release