Copy link to clipboard
Copied
I have columns of placed graphics that I would like to add a horizontal line between, much like adding a vertical line between columns using Text Frame Options or the Object Style Optons dialog.
I have looked for a script with no luck and I can't seem to figure out if object styles will apply a horizontal line only between objects.
Any ideas would be greatly appreciated.
Copy link to clipboard
Copied
I'm not sure this can be done with any ID feature other than drawing a rule under each frame... which might be scriptable. The only features to add either a rule above/below, or a border that's zero on three sides, is in Paragraph Styles, so I am not sure there's anything to leverage there, either — it would have to be a script to draw a rule of X dimensions.
But maybe I'm missing something that would make it easier.
Copy link to clipboard
Copied
You could use paragraph rules if the images are placed as anchored objects...
Copy link to clipboard
Copied
I thought of that, but it's only a half-step of "automation" with a fair amount of layout effort required.
There are any number of approaches to get IMAGE-LINE-IMAGE. But all those I can think of require it to be a largely manual process, with or without a little help from things such as paragraph and object styles.
Copy link to clipboard
Copied
You could find an anchored object insertion, then add a new paragraph with a paragraph rule style, with F/C
Copy link to clipboard
Copied
Or add an underline to the object's containing pstyle.
Copy link to clipboard
Copied
Are the placed graphics anchored in a text flow, or standalone?
Copy link to clipboard
Copied
At present all items are standalone.
Copy link to clipboard
Copied
Something like this could work.
var d = app.activeDocument;
var allgs = d.allGraphics;
var i = allgs.length;
var os = d.objectStyles.itemByName("LineObj");
var offset = 3;
var r, gb, l, p;
while(i--) {
p = allgs[i].parent;
gb = p.geometricBounds;
l = p.graphicLines.add(undefined, undefined, undefined, {appliedObjectStyle: os});
l.geometricBounds = [gb[2] + offset, gb[1], gb[2] + offset, gb[3]];
}
Copy link to clipboard
Copied
I have named my object style "LineObj" and I've selected the 5 placed images that I have applied the object style to, but when I run the script nothing occurs. Any hints or direction you can impart is greatly appreciated.
Copy link to clipboard
Copied
The object style is for the line object. If you need a way to target specific frames, then give them a different object style, and run this:
var d = app.activeDocument;
var allgs = d.allGraphics;
var i = allgs.length;
var os = d.objectStyles.itemByName("LineObj");
var offset = 3;
var r, gb, l, p;
while(i--) {
p = allgs[i].parent;
if (p.appliedObjectStyle.name !== "YourOtherName") { continue; }
gb = p.geometricBounds;
l = p.graphicLines.add(undefined, undefined, undefined, {appliedObjectStyle: os});
l.geometricBounds = [gb[2] + offset, gb[1], gb[2] + offset, gb[3]];
}
Check your layers panel for the image rectangles, and see if there is a line object attached.
Copy link to clipboard
Copied
You could set up a table to contain the images, and set borders only on the strokes between frames.
Copy link to clipboard
Copied
Given the subsequent issues of getting tables to flow across pages, I'd say the better solution is something attached to the anchor paragraph style. If the existing work doesn't use anchored frames, it will take some time to go through and anchor each to a specific paragraph style... but once that's done, it will be easy to experiment with that style to achieve the desired effect. I'd suggst Rule Below is the right approach, and for bottom (of page, or stack) images, a secondary style that has no rule below.
But pretty much every good solution has to start with the image frames cleanly anchored to a specific para style, and a good object style definition wouldn't hurt.
Copy link to clipboard
Copied
"You could set up a table to contain the images, and set borders only on the strokes between frames."
I thought the same. I did a test now creating a 1x1 table with border only on the bottom and it worked well, but the whole idea of it is a bit unwieldy. Might be time for a feature request to add such borders to Object Styles!!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more