-
1. Re: What could block a script, when there's nothing wrong with it?
TᴀW Jun 20, 2012 11:52 AM (in response to PrntScr)In ESTK, next to the dropdown where you select which app to target,
there's that little chain icon. If the chain is broken, even if the app
is selected, it won't run. The chain has to be closed. Sometimes (not
sure when) the chain gets broken even if you've got the app targeted.
Might that be it?
Ariel
-
2. Re: What could block a script, when there's nothing wrong with it?
PrntScr Jun 20, 2012 12:30 PM (in response to TᴀW)Hi Ariel,
Thanks! But no, afraid that's not it. Chain is green and not broken.
It seems to happen when I run the loop more than once. But what could be offending about the code being executed again?
The last part of the code is a bunch of ifs. Should I wrap it upp in 'else break' or something?
-
3. Re: What could block a script, when there's nothing wrong with it?
Harbs. Jun 20, 2012 12:38 PM (in response to PrntScr)You're probably trying to ungroup groups that do not exist. Once you ungrouped everything, there are no groups, so app.activeDocument.groups.everyItem() is invalid...
Harbs
-
4. Re: What could block a script, when there's nothing wrong with it?
PrntScr Jun 20, 2012 1:08 PM (in response to Harbs.)Thanks for taking your time Harbs.
Sorry to say, once I escape the ungroup-line, it still won't run. Says line " if (stories[i].appliedParagraphStyle == STYLE && stories[i].paragraphs[0].parentTextFrames[0].parentPage.name == 1) stories[i].paragraphs[0].parentTextFrames[0].geometricBounds = ([38.8, 15, 48.249, 130]);"
..is wrong and that 'null is not an object'.
-
5. Re: What could block a script, when there's nothing wrong with it?
Harbs. Jun 20, 2012 1:43 PM (in response to PrntScr)Is the text frame on the pasteboard?
Do you have an inline frame that's overset?
No need to do a lot more error checking...
Harbs
-
6. Re: What could block a script, when there's nothing wrong with it?
PrntScr Jun 20, 2012 1:47 PM (in response to Harbs.)The frames get overset from some lines I have above the other ones.
"
var myPar = app.activeDocument.paragraphStyles.item("Some Style");
myPar.fillColor = ("Black");
myPar.pointSize = 40;
myPar.justification = 1818584692
"
Increasing the point size will have them overset. In what way does that inhibit the loop from finding the storie and then change the parentTextFrame? And what can I do about it.
-
7. Re: What could block a script, when there's nothing wrong with it?
Harbs. Jun 20, 2012 1:50 PM (in response to PrntScr)If the entire frame is overset, you cannot get its geometricBounds -- because it does not have any...
You'll need to flow your text beforehand if that's the issue.
Harbs
-
8. Re: What could block a script, when there's nothing wrong with it?
PrntScr Jun 20, 2012 1:51 PM (in response to PrntScr)Running the loop now puts ALL stories.parentTextFrames to the geometric bounds in the offending line. With no change to the code.
Have I missunderstood something about parenthesis, closing loops, or the use of &&?
-
9. Re: What could block a script, when there's nothing wrong with it?
Harbs. Jun 20, 2012 1:57 PM (in response to PrntScr)Did not get that...
-
10. Re: What could block a script, when there's nothing wrong with it?
PrntScr Jun 20, 2012 2:51 PM (in response to Harbs.)I mean all textframes literally changed to meet the bounds presented in that line, although the conditions where not met in the individual stories asociated with them. !
It's a start..
-
11. Re: What could block a script, when there's nothing wrong with it?
Harbs. Jun 20, 2012 2:55 PM (in response to PrntScr)Try: var stories = doc.stories.everyItem().getElements();
-
12. Re: What could block a script, when there's nothing wrong with it?
PrntScr Jul 5, 2012 1:30 PM (in response to Harbs.)I'd like to just drop a line to say thanks for the support.
And it deserves to be said, for anyone surfing in, that the obvious is true: No, a script wont stop working even tho you have 'the right code'. It had to to with not knowing about the overset problem.
The second problem "all stories moving up to a certain geobound" was just a result of panic and not putting ; after all lines. (Doesn't show in the post.)