The Problem:
I ran into the following known bug/difficulty recently, when laying out a graphic-rich book in InDesign.
The book had many photos with captions, and I had grouped the photos and the captions together.
But now, after the photos and captions were grouped, I wanted to apply an object style to the group only – the group needed some text wrap, and since there were many such groups in the book, the correct way to do this was to create and apply an object style to each group.
This is where the trouble started.
When you apply an object style to a group of objects in InDesign, that object style is applied to all elements inside the group.
So, if, as in my case, the object style applied 20pt of text wrap below the group, each element inside the group will also have 20pt of text wrap applied below.
In my case, this meant that the picture above the caption was pushing the text of the caption away and causing it to go into overset!
Clearly not desirable.
(For more discussion of this problem, check out this thread from 2008 (!) on InDesignSecrets.com.)
The Solution (A Script!)
The only solution I could come up with was the following script.
Apply Object Style to Group Silently (snappy name, I know!) will let you apply an object style to a group without changing any element inside that group.
So you can apply a style to the group, and it will be applied only to the group itself and not to anything inside the group.
Seems a bit crazy that Adobe expects us to resort to a script for such an obvious need! But at least with this script, imperfect as it is, there is a partial solution.
How to Use the Script
After downloading and adding it to your scripts folder as usual, select a group in InDesign and run the script.
Select the object style you would like to apply to that group.
Click OK, and the style will be applied only to the group. Nothing else should change!
P.S. This is a free script, and it has not been thoroughly tested. I’ve been using it myself on a real-world project and it seems to work fine in many cases. Sometimes, the properties of some things inside the group change unwantedly.
USE WITH CARE!
TIP: For the most predictable results, make sure that all the items in the group have an object style applied, and that none of the object styles have local overrides.
Have fun – and do please post below if you find any issues with the script or have any comments!
Candace
October 19, 2020 7:20 pmHi Ariel,
Thank you for sharing this script and pointers! I’m attempting to use it for a logo lockup from a provided CC library (there are 20 versions total – one for each business). It consists of a logo, a vertical rule, and a block of text grouped together. Each element has the Object style ‘None’ applied to it with overrides. I’m assuming it’s not working for me due to the overrides, as you mentioned. Is there any other work around for this?
For one thing, clearing the override for the logo works fine, but when clearing it on the rule it changes the appearance, and I’m not even able to clear it on the block of text. Also, it would be time consuming to ungroup all of the logo lockups to clear overrides each time, to then regroup and then run the script. I imagine I should just type in the coordinates for the lockups as I’ve been doing, and reserve your script for simpler groups?
Thanks in advance!
Candace
molly
August 6, 2020 1:11 am-Lol it just made everything invisible.
Guess I’ll just go manual unless??….
Ariel
August 6, 2020 2:23 pmHi Molly,
It works best if there are no object style overrides on anything inside the group.
Ariel
Lukas
March 24, 2020 10:26 amDid not work in my initial test, is it OK if I try to modify it? I’ll let you know if I get success. First I’m on 2020 version, then also my objects in group were redistributed in some random ways, I was hoping they would retain their initials and specific object styles, which may be the intent but was not happening.
Ariel
March 24, 2020 1:30 pmGo ahead and modify and post back. It uses the “properties” shortcut to reapply all properties on the items in the group, but that doesn’t work for everything. As mentioned above, I find it works best if all objects inside the group themselves have an object style applied without any overrides.
Ariel
July 28, 2017 1:41 amHi Oleg,
It sounds like one of the objects has auto-resizing on. Of course, that shouldn’t really be a problem, but the thing is the script takes a shortcut in restoring the properties of the objects inside the group, and that shortcut doesn’t work for everything.
Ariel
Oleg
July 26, 2017 9:42 amHello.
Thank you for script. Unfortunately there is one bug.
My data are: Windows 7 professional, InDesign CS6 (8.0.1). First object–rectangle with Object Style 1, second object–text frame filled by text with Object Style 2; there are no local overrides; objects grouped together. After applying Object Style 3 to group second object (text frame) shrinks on 1 pixel in width and height relatively frame center (and text overflow).
Best Regards
Oleg Eltsov