-
1. Re: Cleaning up (not only) text frames, Pt. 2
Laubender Jan 14, 2014 9:16 AM (in response to winterm)@Winterm – hah!
Finally a real-world example…For testing reasons I think we need an IDML, an InDesign file or at least a snippet (IDMS) file.
Can you share a download?
Or at least send me a zipped IDML via mail.
Just send me a personal message before.Uwe
-
2. Re: Cleaning up (not only) text frames, Pt. 2
Laubender Jan 14, 2014 9:26 AM (in response to winterm)Ah. I know why it would fail.
The rectangle (you name it "Graphic Container") has an object added with "Copy"+"Paste Inside".
So the test of emptyness of a graphic frame is not sufficient.(At least) one test is missing:
if(myGraphicFrame.pageItems.length !== 0){ /*do nothing*/ };We should test on the pageItems length of every frame.
Not only of the length of the graphics objects of a frame.Uwe
-
3. Re: Cleaning up (not only) text frames, Pt. 2
Laubender Jan 14, 2014 9:29 AM (in response to Laubender)But this provokes the question: what if that pageItem is empty?
Should we consider its parent frame empty?Yeah. I know…
Endless questions and recursiveness go together.Uwe
-
4. Re: Cleaning up (not only) text frames, Pt. 2
winterm Jan 14, 2014 9:45 AM (in response to Laubender)well, actually that's not exactly 'real-world' sample... I don't think it's good idea to publish here commercial materials, even a screenshots. I just recreated situation from the 'real'.
I see, you went far enough in your thoughts already, however, there's an idml:
https://www.mediafire.com/?vjqacu9m399tp32
and yes, the problem is about objects, pasted into...
it happens, and shouldn't be ignored, I think.
-
5. Re: Cleaning up (not only) text frames, Pt. 2
winterm Jan 14, 2014 10:05 AM (in response to Laubender)Laubender wrote:
But this provokes the question: what if that pageItem is empty?
I think, in uncertain situations objects in question better should be left alone... otherwise we risk throw out the baby with the bath water...
-
6. Re: Cleaning up (not only) text frames, Pt. 2
Laubender Jan 14, 2014 10:49 AM (in response to winterm)@Winterm – in that case the question is already answered.
Just remove:
myGraphicFrames[i].graphics.length < 1
and write instead:
myGraphicFrames[i].pageItems.length === 0
That would test for pageItems inside myGraphicFrame.
Regardless of type.Uwe
-
7. Re: Cleaning up (not only) text frames, Pt. 2
winterm Jan 14, 2014 12:02 PM (in response to Laubender)well, seems like it was A Touch of a Master
just tried improved script on a 'real', lenghty and complex, but not very accurate mastered project - it seems OK so far...
Thank You, Uwe!




