What could block a script, when there is nothing wrong with that?

Hello, once again

I just lost a few hours trying to get a script to run. It threw an error saying that the "object was not valid" I decided to give up, Wen home and later started home again see if I could sort.

He did well in the first round.

Same computer. No change to the script. ESTK has been set at 5 InDesign, I checked it a million times.

What could cause this do? Caches overflowing? 'Blocks' between InDesign and ESTK?
The script is not download for any URI or such.

Here's the bit that I have problems with:

app.activeDocument.groups.everyItem () .ungroup ();

app.activeDocument.layers.everyItem (.locked = false);

app.activeDocument.pageItems.everyItem (.locked = false);

MoveTextFrame();

function MoveTextFrame() {}

var doc = app.activeDocument;

stories of var = doc.stories;

var STYLE = doc.paragraphStyles.item ("some Style");

for (var i = stories.length - 1; i > = 0; i--) {}

If (.appliedParagraphStyle [i] stories == STYLE & & stories [i] .paragraphs [0] .parentTextFrames [0].parentPage.name == 1) stories [i] .paragraphs [0] .parentTextFrames [0] .geometricBounds = ([38.8, 15, 48.249, 130]);

If (.appliedParagraphStyle [i] stories == STYLE & & stories [i] .paragraphs [0] .parentTextFrames [0].parentPage.name == 2) stories [i] .paragraphs [0] .parentTextFrames [0] .geometricBounds = ([9.2, 15, 18.6, 130]);

If (.appliedParagraphStyle [i] stories == STYLE & & stories [i] .paragraphs [0] .parentTextFrames [0].parentPage.name == 3 & & app.activeDocument.documentPreferences.facingPages == true) stories [i] .paragraphs [0] .parentTextFrames [0] .geometricBounds = ([9.2,225, 18.6, 340]);

If (.appliedParagraphStyle [i] stories == STYLE & & stories [i] .paragraphs [0] .parentTextFrames [0].parentPage.name == 3 & & app.activeDocument.documentPreferences.facingPages == false) stories [i] .paragraphs [0] .parentTextFrames [0] .geometricBounds = ([9.2,15, 18.6, 130]);

If (.appliedParagraphStyle [i] stories == STYLE & & stories [i] .paragraphs [0] .parentTextFrames [0].parentPage.name == 4) stories [i] .paragraphs [0] .parentTextFrames [0].move([15,9.2]);

}

}

You are probably trying to separate groups that do not exist. Once you separated from everything, there is no groups, so that app.activeDocument.groups.everyItem () is invalid...

Substances

Tags: InDesign

Similar Questions

Maybe you are looking for