Copy link to clipboard
Copied
But you can't apply a stroke to part of a frame in an object style (or even on a frame directly), so you'll have to place separate rules on the frames.
Copy link to clipboard
Copied
Paragraph borders (and paragraph rules) are not spine-relative, so, no, you can't get what you showed.
The only way to deal with this is not to use paragraph borders (or paragraph rules), but instead use a script to place the rules when all margin frames have been placed.
Copy link to clipboard
Copied
Hi @Peter Kahrel Thank you very much for your reply.
"Find all text frames for the script and apply object style 1 if they are on the right of the page, apply object style 2 if they are on the left of the page." I will try to develop a code with this logic. Does anyone have a better idea?
Copy link to clipboard
Copied
But you can't apply a stroke to part of a frame in an object style (or even on a frame directly), so you'll have to place separate rules on the frames.
Copy link to clipboard
Copied
Hi everyone,
Hi everyone;
....
var allDocPages = app.documents[0].pages.everyItem().getElements();
// Loop all pages:
for (var n = 0; n < allDocPages.length; n++)
{
// Test Left or Right Hand side of page:
//if (allDocPages[n].side == PageSideOptions.LEFT_HAND) { //Left (Odd)
if (allDocPages[n].side == PageSideOptions.RIGHT_HAND)
{ //Right (Even)
// Get all items on the current page:
var mySelection = allDocPages[n].allPageItems;
for (var i = 0; i < mySelection.length; i++)
{
if ((mySelection[i].constructor.name == "TextFrame") && (mySelection[i].appliedObjectStyle == myOs1_O))
....
I solved the problem with the script I prepared using this logic. Thanks @Peter Kahrel
Copy link to clipboard
Copied
As your TFs are Anchored - you don't have to check all TFs on all Pages - you could just iterate TFs collection of the Story.
It will be quicker / more efficient.
Copy link to clipboard
Copied
And a version that doesn't require scripting knowledge:
BEFORE:
AFTER:
(those thick green and red lines are for better visibility)
Right now it needs few runs to complete - change from "...is EVEN" to "...is ODD" in the 1st Task and re-run - but it will be just one task with 2nd and 3rd Tasks run as a sub-Tasks.
And then it could be run in BatchMode on a multiple folders full of INDD files...
Copy link to clipboard
Copied
And that's an example of a single, fully automatic Task:
Copy link to clipboard
Copied
Good job. Tip for the future: when you place text frames (like your margin frames) always label them on the Layers panel. That way they easy to find so that when you go looking for frames in a script, the script uses less code and is more efficient (and quicker too, usually).
Copy link to clipboard
Copied
Sometimes, complex things just need InDesign basic features as 2 object styles and a simplistic regex! …
Screenshots previously posted not allowed.
(^/) The Jedi
Copy link to clipboard
Copied
Clever, mon brave. So you paste an object into the anchored frames. And how do you get the arrows to point into the correct direction?
Another thing is that the rules should be the length of the height of the boxes. How would you adjust the height of the objects you paste?