Overridden master item not positioning correctly

Copy link to clipboard
Copied
Hello All,
I'm not sure I can explain this, but here goes.
I wrote a script in VB 6 that we've been using for years in CS3, for the past 6 months (after some updates) in CS6. It "autoflows" the text at the end of an InDesign file until the text no longer overflows. It does this by overriding a particular text frame from the master.
I have one file on which the master frames do not override to the correct position, they should be exactally on the margins on all sides, as they are on the master. On the right pages the frame sits up higher than the top and bottom margins, on the left pages it sits higher than the top and bottom margins (in the same incorrect position as the right page) AND shifted to the left of the margins.. Stepping through the execution of the code I can see the frame become overridden to the wrong position when the below line executes, what I can't figure out is WHY! TempFrame is defined as a TextFrame, SrchPg is defined as a Page.
Set TempFrame = SrchPg.MasterPageItems(i%).Override(SrchPg)
If I insert a page manully and continue the text flow manually by clicking the overridden text red plus sight and just click in the next frame it comes off in the correct positon. However, doing it manually and using Ctrl+Shift+Click to make it autoflow that first frame comes off the master in the wrong position, like the script does it. On the subseqent pages that get created without the script, the overridden text frames are in the correct position, on the margins on all sides.
Layout adjustment is on, but snapping to any grids is not.
Any ideas?
Many thanks,
Ken

Copy link to clipboard
Copied
UPDATE 6/16
My operator showed me another thing that's been happening with the particular file / project, and I think its related to the items coming of the master incorrectly.
On the master pages, on a locked layer, we have a frame whose content is set to "Undefined" that is sized to exactly match the page size.
This is so the page trim can easily be seen and measured in PDF and when printed and we've never had any troble with it before. If we change the starting page number of one of these problematic files that frame goes out of position by 9 pts toward the outside of the pages. When we reapply a master to that page (even if its the SAME master) we get the message "Page ## has a custom page size. This page can retain its current size or be resized to match the new master."
If we select "Keep current size" the outter frame to mark the page trim stays in the wrong position. If we select "Use master page size" that frame gets set correctly.
Checking the page size of that problematic page shows it to be exactly what the rest of the pages and the document is set to be so I don't understand why I'm getting this message.
Thanks again,
Ken
Copy link to clipboard
Copied
Hello Ken.
Those problems can be caused by a lot of things.
First, try turning on or off the "Layout Adjustment" option. It worked for me sometimes.
Second, try exporting the file as IDML and opening the said IDML. Your file might be corrupted because of a bad save (a indesign document is actualy a database).
If nothing else works, try rebuilding the document form scratch. From what i understand your documents were created with CS3 and then converted to CS6. Maby it's a conversion error.

Copy link to clipboard
Copied
Nothing I seem to do on the Layout Adjustment dialog makes a difference.
Gave the IDML a shot as well, but no dice.
Thanks for posting!
Copy link to clipboard
Copied
I experienced similar problems from VB.NET with all overruled master items from a particular template being shifted after using .Override. When the page is building you can see that first all elements are positioned at the original (correct) position, but immediately after they are shifted by a fixed amount. I checked the values for this shift and it seemed to be derived from obects that were extending outside the bleed area on that specific masterpage. So I made sure no elements extended beyond the bleed area, saved as IDML, imported but the problem remained. Then checked all elements on all master and document pages and made sure they were completely inside the bleed area. Saved as IDML, imported, problem remained. Then used another master page, problem solved. So I concluded that the master page is somehow trashed (all visible settings equal between the working and problem master) so I rebuild the master from scratch.
Clearly there is a difference between manually overriding elements from a master page and doing this by script in .Override (it seems as if the latter one performs another irreversible step which is shifting everything for some unknown reason to compenate for elements placed outside the bleed area). Possibly the dimensions of the master page are different from those of the document and can never be changed back in the InDesign internal datastructure.
Copy link to clipboard
Copied
See Marc Autret's blog post about a related problem here:
Indiscripts :: InDesign Scripting Forum Roundup #6
Detecting and Fixing Corrupted Page Matrix
Marc Autret
Also this thread here:
Override elements by script problems
tomas8 Apr 21, 2014 12:41 PM
Override elements by script problems
Uwe

