Article View: adobe.scripting.indesign
Article #9726Re: applying label to a spread
From: Martin Fischer*
Date: Fri, 21 Jul 2006 15:29
Date: Fri, 21 Jul 2006 15:29
66 lines
2144 bytes
2144 bytes
Ole,
thanks for your code.
But labeling a spread didn't have been my problem.
Yesterday I did this with the following code:
// Col2LabelOfSpread.jsx
var myDoc = app.activeDocument;
var mySpread = app.layoutWindows[0].activeSpread;
myCol = displayDialog(mySpread);
mySpread.label = myCol;
mySpread.pages[0].label = myCol;
function displayDialog(theSpread)
{
var theFieldWidth = 150;
var theCols = myDoc.swatches.everyItem().name;
if (theSpread.label !="")
{
for (oneCol = 0; oneCol < theCols.length; oneCol ++ )
{
if (theCols[oneCol] == theSpread.label)
break;
}
}
else
oneCol = theCols.length-1;
var myDialog = app.dialogs.add({name:"watch for active spread"});
with(myDialog.dialogColumns.add())
{
with(dialogRows.add())
{
with(dialogColumns.add())
{
staticTexts.add({staticLabel:"Swatch:", minWidth:theFieldWidth});
}
with(dialogColumns.add())
{
var myColsDropDown = dropdowns.add({stringList:theCols, selectedIndex:oneCol});
}
}
}
var myResult = myDialog.show();
if(myResult == true)
{
var theColName = theCols[myColsDropDown.selectedIndex];
myDialog.destroy();
}
else
{
myDialog.destroy();
exit();
}
return theColName;
}
Anyhow I have got another solution yet (storing page numbers and the swatches which should be applied to special paragraphs of a spread into a textFrame with a significant label).
Thanks
Martin
Technical Details
Message-ID:
<3bc0fbdf.4@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!news.ecp.fr!news.stben.net!webcrossingReferences:
<3bc0fbdf.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,d90bcf137b1933fc X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Martin Fischer*" <martin.fischer@online.de> Newsgroups: adobe.scripting.indesign Subject: Re: applying label to a spread Message-ID: <3bc0fbdf.4@webcrossing.la2eafNXanI> Date: Fri, 21 Jul 2006 08:29:40 -0700 References: <3bc0fbdf.-1@webcrossing.la2eafNXanI> Lines: 66 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!news.ecp.fr!news.stben.net!webcrossing