Forum Replies Created
-
AuthorPosts
-
Theunis De Jong
MemberColly, no need to despair (yet). It seems the buggy Index is strongly linked to the Book function — InDesign “just” forgets to update the index per each file, it seems. I read on another forum it should be possible to manually update the index in each file, to force all index entries to be current when the Index Book function gets activated.
I don't have my 50 MB/53 files with me — it's a weekend! — but I'll try that for sure. Shame about the work day I spend writing scripts … Perhaps I can send Adobe a bill for the hours spend debugging.
The Javascript Help lists “update” under “Index”, but with this rather puzzling note:
Updates the index preview pane. Note: Does not update the index.
— so it might be scriptable to semi-automatically update all, or it might not.
Theunis De Jong
MemberCS4 — ouch! Did you read my post CS4: The dreaded index …? That was on a just slightly larger document (and, from the complaints I have read on Adobe's Indesign Forum, I think index troubles are not even related to document size).
To get my index up and running, I had to write lots of custom scripts, so at least I now know how to gather all entries into a file, for example.
The tour de farce (so to speak) I mention at the end — a fully custom script that gathers index entries and their page numbers by itself, sorted & all — worked for me and my index; but that was only an easy one, relatively speaking, consisting only of single-level entries. It won't work for you without some serious re-writing, I'm afraid.
(I also don't feel like picking up the slack where Adobe fails to get it right! It's their job, and they ought to do something about it, what with us being paying clients suffering under some serious bugs that virtually makes the index function useless.)
(I'm fuming — sorry, I know.)
Theunis De Jong
MemberWhat you describe works just fine for me … If I select one single Index marker (using shift-arrows and a little try-and-error, or the Story Editor), the selected entry in the Index panel will be the reference to that marker.
Perhaps you could try exporting the document to IDML and re-opening that — it might clear some gunk from the corners of your file.
May 21, 2010 at 8:00 am in reply to: Define table row heights, column widths in styles somehow? #55803Theunis De Jong
MemberOkay — perhaps this javascript is all you need. It will change the first row of each table in your entire document to the height you specify (in regular shorthand notation, e.g., “0.125in” or “1.2cm”). Fortunately — or not –, it doesn't matter whether it's a “header” row or a regular one.
Pay attention now, because last time I inserted a script of this length it was completely overlooked. (…)
Ready?
app.activeDocument.stories.everyItem().tables.everyItem().rows[0].height = “12mm”; // <- Change me!
Okay — that was it. Don't let its length fool you; a lot of thought went into it :-)
Copy, paste into a plain text editor (Notepad, Textedit — in plain text mode — or Adobe's own ESTK Editor), and save as “ChangeFirstRowsTo20mm.jsx” into your User Scripts folder. You don't have to do anything but double-click the script and sit back.
(Given the speed it works at, you might not even have time to sit back.)
Theunis De Jong
MemberCS4 — ouch! Did you read my post CS4: The dreaded index …? That was on a just slightly larger document (and, from the complaints I have read on Adobe's Indesign Forum, I think index troubles are not even related to document size).
To get my index up and running, I had to write lots of custom scripts, so at least I now know how to gather all entries into a file, for example.
The tour de farce (so to speak) I mention at the end — a fully custom script that gathers index entries and their page numbers by itself, sorted & all — worked for me and my index; but that was only an easy one, relatively speaking, consisting only of single-level entries. It won't work for you without some serious re-writing, I'm afraid.
(I also don't feel like picking up the slack where Adobe fails to get it right! It's their job, and they ought to do something about it, what with us being paying clients suffering under some serious bugs that virtually makes the index function useless.)
(I'm fuming — sorry, I know.)
Theunis De Jong
MemberWhat you describe works just fine for me … If I select one single Index marker (using shift-arrows and a little try-and-error, or the Story Editor), the selected entry in the Index panel will be the reference to that marker.
Perhaps you could try exporting the document to IDML and re-opening that — it might clear some gunk from the corners of your file.
May 21, 2010 at 5:43 am in reply to: Define table row heights, column widths in styles somehow? #55794Theunis De Jong
MemberIt would seem you set your row heights to be of a fixed height. In hindsight, you would have been better off if you used the “Automatic” setting, together with the right cell insets on top and bottom, to get the height you wanted. Ahhh … the benefits of hindsight :-)
A simple javascript can set all header row heights to the same value.
The downside is, well, it would set all header row heights to the same value. If you have a few tables where this should not happen, you'd have to run the script and then restore these tables. If you have a mixed set, where some need changing and others do not, a script cannot help at all …
That header: is that just one row? Is it just the top row for each table, or did you actually converted them to Header Rows?
May 21, 2010 at 1:00 am in reply to: Define table row heights, column widths in styles somehow? #52816Theunis De Jong
MemberOkay — perhaps this javascript is all you need. It will change the first row of each table in your entire document to the height you specify (in regular shorthand notation, e.g., “0.125in” or “1.2cm”). Fortunately — or not –, it doesn't matter whether it's a “header” row or a regular one.
Pay attention now, because last time I inserted a script of this length it was completely overlooked. (…)
Ready?
app.activeDocument.stories.everyItem().tables.everyItem().rows[0].height = “12mm”; // <- Change me!
Okay — that was it. Don't let its length fool you; a lot of thought went into it :-)
Copy, paste into a plain text editor (Notepad, Textedit — in plain text mode — or Adobe's own ESTK Editor), and save as “ChangeFirstRowsTo20mm.jsx” into your User Scripts folder. You don't have to do anything but double-click the script and sit back.
(Given the speed it works at, you might not even have time to sit back.)
May 20, 2010 at 10:43 pm in reply to: Define table row heights, column widths in styles somehow? #52813Theunis De Jong
MemberIt would seem you set your row heights to be of a fixed height. In hindsight, you would have been better off if you used the “Automatic” setting, together with the right cell insets on top and bottom, to get the height you wanted. Ahhh … the benefits of hindsight :-)
A simple javascript can set all header row heights to the same value.
The downside is, well, it would set all header row heights to the same value. If you have a few tables where this should not happen, you'd have to run the script and then restore these tables. If you have a mixed set, where some need changing and others do not, a script cannot help at all …
That header: is that just one row? Is it just the top row for each table, or did you actually converted them to Header Rows?
Theunis De Jong
MemberTry this script. It will create a NON-PRINTING layer “ImageScales” — just to remind you have to manually switch between printing and non-printing! — as well as a paragraph style “ImageScales”. If the layer and/or style already exist, you can adjust them to what you want; it won't change them any further.
Then it goes over all images and inserts their scale.
Make a version with the ImageScales layer set to printable for your clients, and one with the layer non-printable for production (don't do it the other way around, or you'll make your clients less happy, rather than more).
Written on a CS4 machine but it ought to work, methinks.
(Edit: changed 'horizontalScale' to 'absoluteHorizontalScale, and the same for vertical.) (!)
//DESCRIPTION:Label Images with their Scale
// Jongware, 20-May-2010
// No Guarantees, Etc.
try {
app.activeDocument.layers.add({name:”ImageScales”, layerColor: [255,192,0], printable: false});
} catch (_) { }
try {
app.activeDocument.paragraphStyles.add({name:”ImageScales”, justification: Justification.CENTER_ALIGN});
} catch (_) { }
reportLayer = app.activeDocument.layers.item(“ImageScales”);
reportStyle = app.activeDocument.paragraphStyles.item(“ImageScales”);
imageList = app.activeDocument.allGraphics;
for (im=0; im<imageList.length; im++)
{
try { showScaleFor (imageList[im]); } catch (_) {}
}
function showScaleFor (anImage)
{
var gb,fr,pg;
gb = anImage.parent.geometricBounds;
pg = anImage.parent;
while (1)
{
if (pg instanceof InsertionPoint)
pg = pg.parentTextframes[0];
if (pg instanceof Document || pg instanceof Spread || pg instanceof Page)
break;
pg = pg.parent;
}
fr = pg.textFrames.add(reportLayer, {geometricBounds: gb, textFramePreferences: {verticalJustification: VerticalJustification.CENTER_ALIGN}});
fr.insertionPoints[0].appliedParagraphStyle = reportStyle;
if (anImage.absoluteHorizontalScale == anImage.absoluteVerticalScale)
fr.contents = twoDec(anImage.absoluteHorizontalScale)+”%”;
else
fr.contents = twoDec(anImage.absoluteHorizontalScale) + “%/” + twoDec(anImage.absoluteVerticalScale) + “%”;
}
function twoDec(x)
{
return Math.round(x*100)/100;
}
Theunis De Jong
MemberTry this script. It will create a NON-PRINTING layer “ImageScales” — just to remind you have to manually switch between printing and non-printing! — as well as a paragraph style “ImageScales”. If the layer and/or style already exist, you can adjust them to what you want; it won't change them any further.
Then it goes over all images and inserts their scale.
Make a version with the ImageScales layer set to printable for your clients, and one with the layer non-printable for production (don't do it the other way around, or you'll make your clients less happy, rather than more).
Written on a CS4 machine but it ought to work, methinks.
(Edit: changed 'horizontalScale' to 'absoluteHorizontalScale, and the same for vertical.) (!)
//DESCRIPTION:Label Images with their Scale
// Jongware, 20-May-2010
// No Guarantees, Etc.
try {
app.activeDocument.layers.add({name:”ImageScales”, layerColor: [255,192,0], printable: false});
} catch (_) { }
try {
app.activeDocument.paragraphStyles.add({name:”ImageScales”, justification: Justification.CENTER_ALIGN});
} catch (_) { }
reportLayer = app.activeDocument.layers.item(“ImageScales”);
reportStyle = app.activeDocument.paragraphStyles.item(“ImageScales”);
imageList = app.activeDocument.allGraphics;
for (im=0; im<imageList.length; im++)
{
try { showScaleFor (imageList[im]); } catch (_) {}
}
function showScaleFor (anImage)
{
var gb,fr,pg;
gb = anImage.parent.geometricBounds;
pg = anImage.parent;
while (1)
{
if (pg instanceof InsertionPoint)
pg = pg.parentTextframes[0];
if (pg instanceof Document || pg instanceof Spread || pg instanceof Page)
break;
pg = pg.parent;
}
fr = pg.textFrames.add(reportLayer, {geometricBounds: gb, textFramePreferences: {verticalJustification: VerticalJustification.CENTER_ALIGN}});
fr.insertionPoints[0].appliedParagraphStyle = reportStyle;
if (anImage.absoluteHorizontalScale == anImage.absoluteVerticalScale)
fr.contents = twoDec(anImage.absoluteHorizontalScale)+”%”;
else
fr.contents = twoDec(anImage.absoluteHorizontalScale) + “%/” + twoDec(anImage.absoluteVerticalScale) + “%”;
}
function twoDec(x)
{
return Math.round(x*100)/100;
}
Theunis De Jong
MemberIt's possible, but it highly depends on your InDesign version how easy it is.
For CS4 and later, check the Help on Cross-References. That's one way to do it.
Theunis De Jong
MemberApparently, none of the “entire range of our user base” (quoth Michael Ninness) are using indexes :-(
Oh — and I said
For me it's a snap to re-write those scripts to “manually” generate a correct index, sorted and all.
… well … Besides being +700 pp., it's also about Eastern European writers. After I finally had generated a correct index, with all the right page numbers in the right order (and even concatenated ranges like “11,12,13” into “11-13” — another trick that might leave Adobe engineers baffled by my ingenuity) … entries such as “?apek, Karel” (the Czech playwright that coined the term “robot” for a 'mechanical worker') appeared at the very end of the index. Javascript is not good at Unicode sorting …
So I had to implement on-the-fly removing of accents as well as a custom “sort-by” … But I think I got it, after several hours of frantic trying. There are still a few weird cases but at least everything seems to be there.
Theunis De Jong
MemberIn the Help?
But … you're in for some treats! (Well — as long as you don't need indexes …)
* GREP is a programmers' way of finding text; it's vastly superior to ID's “normal” searching (it takes some time to get the basics, but after that …)
* You can even apply character styles automatically. Imagine every time you see a word “Wow!” you have to make it Comic Sans. Put this in a GREP style and ID will automatically do that for you!
* Ehm. … Did you read all of InDesignSecrets.com of the past 5 years?
Theunis De Jong
MemberIt's possible, but it highly depends on your InDesign version how easy it is.
For CS4 and later, check the Help on Cross-References. That's one way to do it.
-
AuthorPosts
