Peter Kahrel
Community Expert
Peter Kahrel
Community Expert
Activity
‎Mar 07, 2025
10:30 AM
1 Upvote
Find what: (\d+),(\d+)\s?\$
Change to: $$1.$2
... View more
‎Mar 05, 2025
12:00 PM
Granted. But when I flowed the story (in the uploaded document) the numbering was fine.
... View more
‎Mar 05, 2025
06:53 AM
@Abhishek Rao -- The OP already set up heir document correctly (I tried). I don't know how they managed to restart the numbering on following pages.
... View more
‎Mar 05, 2025
06:09 AM
character.remove() and character.contents = '' are equivalent. They have the same effect. It won't cause any problems. Just try it.
... View more
‎Mar 05, 2025
06:05 AM
1 Upvote
Did you check the 'Include Hyperlinks' checkbox in the Export PDF window?
... View more
‎Mar 05, 2025
05:57 AM
When you flow the text to the next pages, numbering continues as expected. Make sure the story is threaded properly.
... View more
‎Mar 05, 2025
05:30 AM
2 Upvotes
I've seen this a few times at the level of story, maybe the underltying problem is the same as with character. Anyway, try
foundItems[i].contents = ''
... View more
‎Mar 04, 2025
01:14 AM
3 Upvotes
This goes back at least to CS6. A bug was posted back then. No idea what happened to it.
... View more
‎Mar 03, 2025
10:50 AM
1 Upvote
It's normal text, so you can edit it like any other text. Just be aware that you'll lose all your changes when you re-generate the TOC.
... View more
‎Mar 03, 2025
10:49 AM
I can confirm that the problem doesn't occur in Affinity, so it looks as if this is an Adobe problem.
@Holger Walter34008837xo0j : Go to https://indesign.uservoice.com to log a bug.
... View more
‎Mar 03, 2025
08:12 AM
I tried with the font you use (Montserrat) and I can see the same problem, in the place, with the same characters. The kerning of the characters does not change, it's really a display problem. When you use other fonts you'll see the same, though with different characters.
It's not necessarily an InDesign problem, I've seen this happen when you zoom in and out, also in e.g. Acrobat.
... View more
‎Mar 03, 2025
07:09 AM
> yes, it does shift, and it's indeed a display-bug.
Well, if those other pairs really shift then it's not a display bug, but a kerning bug.
The shift probably doesn't occur when you zoom out a bit. Did you try that?
... View more
‎Mar 03, 2025
06:32 AM
1 Upvote
This looks like a display problem. You can check whether the space between the p and the r (in your example) really changes by taking the horizontal position of the r before and after applying the kerning. The cursor position's horizontal position is shown in the Info panel (F8 or Window > Info).
... View more
‎Mar 01, 2025
12:59 PM
2 Upvotes
That should be
app.selection[0].parentStory etc.
... View more
‎Feb 28, 2025
07:42 AM
2 Upvotes
@Flo_8580
As described on the script's web page, you should wrap your script in/as an anonymous function. This one should work:
(function () {
var allAssignments = app.activeDocument.assignments;
for ( var i = allAssignments.length-1; i >= 0 ; i-- ) {
// the current assignment
var curAssignment = allAssignments[i];
// alle content of the assignment
var allLinkedStories = curAssignment.assignedStories;
for ( var j = allLinkedStories.length-1; j >= 0 ; j-- ) {
// the current content
var curLinkedStory = allLinkedStories[j];
// the link …
var storyLink = curLinkedStory.storyReference.itemLink;
// … unlinking
storyLink.unlink();
}
// delete assignment
if ( curAssignment.name != "Unassigned InCopy Content" ) {
curAssignment.remove();
}
}
}());
... View more
‎Feb 27, 2025
06:17 AM
1 Upvote
You can try that in he interface: type abc-def in a frame, enter abc-def in the Find what field, enable whole word, and start the search. What happens in the interface is wha happens with the script.
Be aware that if the text uses a non-breaking hyphen, and you type a normal hyphen in the Find/Change window, you won't find it.
... View more
‎Feb 27, 2025
05:36 AM
1 Upvote
Sorry, it's not a preference, but an option. You can use this
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html
site to browse InDesign's object model. Look for findchangetextoptions and you'll hit upon this, which tells you how to set it:
... View more
‎Feb 27, 2025
04:38 AM
Ally you need to do is enable the whole-words-only preference.
... View more
‎Feb 27, 2025
04:06 AM
1 Upvote
Duplicate page numbers are not a problem, each page number is printed only once. In fact, you want to keep those 'duplicates' because if an item occurs twice on a page, after some changes in the text they may be on different pages.
You see all instances of 'duplicate' pages in the Index panel, but when you generate the index they're filtered out.
... View more
‎Feb 27, 2025
03:02 AM
1 Upvote
Then you probably don't have an object style defined. The error message is too general, it's not just about the selection. So here is a different version of the script.
Again, insert the name of your object style. Where it says van name = 'xyz' replace xyz with the name of your style.
(function () {
var name = 'xyz';
var ostyle = app.activeDocument.objectStyles.item (name);
if (!ostyle.isValid) {
alert ('The object style ' + name + ' does not exist');
exit();
}
if (app.selection.length === 0
|| !(app.selection[0] instanceof InsertionPoint)) {
alert ('Select an insertion point');
exit();
}
var tf = app.selection[0].textFrames.add ({
appliedObjectStyle: ostyle
});
tf.insertionPoints[0].select();
}());
... View more
‎Feb 27, 2025
02:00 AM
As the message says: select an insertion point. In other words, click in the text where the anchor should be placed.
... View more
‎Feb 27, 2025
01:57 AM
1 Upvote
> Is there another, more simple way to avoid duplicates?
The script deals with (tries to, anyway) potentially ambiguous entries, especially in a name index. If the list contains two or more entries for Smith, as in
Smith, John
Smith, James
It looks for 'Smith' in the text and notices that there are more Smiths. So these are special cases.
If you're worried about a full entry occurring twice or more, e.g. 'border collie', then don't worry. There's no need to check for duplicates because InDesign checks for them internally (one of the very few clever features of InDesign's index).
... View more
‎Feb 26, 2025
02:16 PM
1 Upvote
There's another problem. I'd forgotten how those tags should be scripted. You should use this format:
app.documents[0].paragraphStyles.item('H1').styleExportTagMaps.add (
'PDF', // exportType
'H1', // exportTag
'', // exportClass
'' //exportAttributes
);
... View more
‎Feb 26, 2025
08:57 AM
If your styles are in style groups, then your script doesn't see them. Change this line:
var styles = doc.paragraphStyles;
to:
var styles = doc.allParagraphStyles;
and see if it makes a difference.
... View more
‎Feb 26, 2025
07:33 AM
1 Upvote
Barb nailed it: a script can place a frame and apply an object style. Here's the script. Where it says 'xyz' enter the name of your object style.
(function () {
try {
var tf = app.selection[0].textFrames.add ({
appliedObjectStyle: app.activeDocument.objectStyles.item ('xyz')
});
tf.insertionPoints[0].select();
} catch (_) {
alert ('Select an insertion point');
}
}());
The anchored frame is inserted and the cursor is placed in the frame so you can type away straight away.
Apply the script to a shortcut key in the keyboard editor.
... View more
‎Feb 26, 2025
01:20 AM
> I know what "count" means, but the double underline confused me.
It's just part of the script language's formalism.
... View more
‎Feb 25, 2025
03:41 AM
1 Upvote
You say 'cross-references', but I assume you mean 'page references'.
In your sample the topics have the same pattern: two digits, dot, two digits, dot, four digits. So you can find them all and create topics and page references. A simple script can handle that:
d = app.activeDocument;
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = /\d\d\.\d\d\.\d\d\d\d/.source;
found = d.findGrep();
if (found.length > 0) {
if (d.indexes.length === 0) {
d.indexes.add();
}
index = d.indexes[0];
for (i = found.length-1; i >= 0; i--) {
topic = index.topics.add (found[i].contents);
topic.pageReferences.add (
found[i].insertionPoints[-1],
PageReferenceType.CURRENT_PAGE
);
}
}
... View more
‎Feb 24, 2025
12:32 PM
> (I still wonder why they use "about half" rather than the same font size as the text).
It's something that should be fixed by Adobe. There's a lot to fix still.
> But that still doesn't work when updating the MathML.
For now the situation seems to be that to update an eqn, you have to delete the image and place & generate it again.
... View more
‎Feb 24, 2025
08:47 AM
1 Upvote
The ones I tried worked fine, e.g.
ID doesn't add enough space before and no space at all after the line with the equation, but the alignment of the eqn in the line is ok.
... View more
‎Feb 24, 2025
08:15 AM
In my experience InDesign places the equation correctly relastive to the baseline, but the type is too big. When you reduce the type size, the equation is misaligned. So the thing to do is to determine (once) the correct type size (it'll be about half the textt's type size) and use that value while you place the equation. That works.
... View more