Hi Kenneth,
Thanks for reporting back. (Sometimes I wonder if people care that I
post these scripts...) :(
The script is missing some error checking. This should work better:
if(app.documents.length>0)
RoundNumbers(app.documents[0]);
function RoundNumbers(doc){
var err;
try{var theParas =
doc.stories.everyItem().paragraphs.everyItem().getElements().slice(0)}
catch(err){var theParas = []}
try{var theFootnotes =
doc.stories.everyItem().footnotes.everyItem().paragraphs.everyItem().getElements().slice(0)}
catch(err){var theFootnotes = []}
//var theStories=doc.stories;
for (var i=0;i<theParas.length;i++){
try{
var theText = theParas[i];
theText.spaceBefore = Math.round(theText.spaceBefore*10)/10;
theText.spaceAfter = Math.round(theText.spaceAfter*10)/10;
theText.leftIndent = Math.round(theText.leftIndent*10)/10;
theText.rightIndent = Math.round(theText.rightIndent*10)/10;
theText.firstLineIndent =
Math.round(theText.firstLineIndent*10)/10;
for (var j=0;j<theText.textStyleRanges.length;j++){
if(Math.round(theText.textStyleRanges[j].pointSize*10)/10==11.3){
theText.textStyleRanges[j].pointSize=11.3;
}
}
}catch(e){}
}
for (var i=0;i<theFootnotes.length;i++){
try{
var theText = theFootnotes[i];
theText.spaceBefore = Math.round(theText.spaceBefore*10)/10;
theText.spaceAfter = Math.round(theText.spaceAfter*10)/10;
theText.leftIndent = Math.round(theText.leftIndent*10)/10;
theText.rightIndent = Math.round(theText.rightIndent*10)/10;
theText.firstLineIndent =
Math.round(theText.firstLineIndent*10)/10;
for (var j=0;j<theText.textStyleRanges.length;j++){
if(Math.round(theText.textStyleRanges[j].pointSize*10)/10==11.3){
theText.textStyleRanges[j].pointSize=11.3;
}
}
}catch(e){}
}
}
--
Harbs
http://www.in-tools.com