Article View: adobe.scripting.indesign
Article #10076Re: How to begin scripting?
From: Dave_Saunders
Date: Fri, 07 Jul 2006 16:34
Date: Fri, 07 Jul 2006 16:34
36 lines
1843 bytes
1843 bytes
Bret,
It's been a long time, so I can't recall exactly what it should like, but what you have can't be right. You have a function definition inside an if statement, and while that might be valid JavaScript, it is not something I'd teach a beginner.
The if statement looks incomplete, also. It is referring to a member of a list, so it should at least have [j] after the name of the list to indicate you're examining the j-th item.
if (app.documents.length == 0) {
alert("There are no open documents.");
exit();
}
myDoc = app.activeDocument;
myOsetList = myDoc.stories.everyItem().overflows;
for (j = 0; myOsetList.length > j; j++) {
if (myOsetList[j]) {
------ There's a bunch of stuff missing from here
function selectIt(theObj){
// Selects object, turns to page and zooms in on it
app.select(theObj,SelectionOptions.replaceWith);
app.activeWindow.zoom = ZoomOptions.fitPage;
app.activeWindow.zoomPercentage = 200;
// j-th story is overset; tell the user and exit
selectIt(myDoc.stories.textFrames[-1]);
exit();
}
And what follows ought not to be after the function.
alert("No stories are overset");
}
}
Can you give me a link to where you copied this?
Dave
Technical Details
Message-ID:
<3bbd759f.104@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!feeder.news-service.com!syros.belnet.be!news.belnet.be!news.stben.net!webcrossingReferences:
<3bbd759f.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,dd9eb181c1e6fc23 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Dave_Saunders@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: How to begin scripting? Message-ID: <3bbd759f.104@webcrossing.la2eafNXanI> Date: Fri, 7 Jul 2006 09:34:19 -0700 References: <3bbd759f.-1@webcrossing.la2eafNXanI> Lines: 41 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!feeder.news-service.com!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing