Forum Replies Created
-
AuthorPosts
-
Peter KahrelParticipantIt is indeed dreadful. I’ve no idea whether DTP Tools have a solution for this, you could check their website. But cross-references aren’t unproblematic: you still have to override the running-header frame to make the cross-ref catch its reference, and when text moves around and a heading moves to a different page, you end up with the wrong running header.
Peter KahrelParticipantThis is one of the ugly problems with InDesign’s text variables. It matches the problem that formatting in the source paragraph is ignored (the third problem is that text variables must be on a single line, they can’t break).
There’s a scripted solution to the problem that formatting is ignored, and a variant can handle ignored paragraph numbers. It’s a really ugly workaround in that the running-header frames are overridden and the section number is inserted as plain text.
This approach entails that you must wait until the text is finished, save the document, guard it with your life, run the script, export/print the document, then discard it (or save it under a different name).
Peter KahrelParticipantFirst, to target both opening and closing parentheses, use
[()]
And set the character style in the Change Format panel.It works fine over here. Can you show a screenshot of the Find/Change window as you you it?
Peter KahrelParticipantBrenda: The problem was an empty line in the text file. The script now deals with that. I updated the post where the script was, see below.
Note that you need to override the text frame on to a document page (it’s now only on a parent page).
Peter KahrelParticipantUpdated script to deal with empty lines in the text file.
(function () { var condition; var riskWords; // Remove and recreate the condition if it exists // so that words removed from the list are // 'unrisked' in the text function getCondition () { var c = app.documents[0].conditions.item('Risk word'); if (c.isValid) { var p = c.properties; // This is quicker than removing the highlights in the text c.remove(); c = app.documents[0].conditions.add(p); } else { app.documents[0].conditionalTextPreferences.showConditionIndicators = ConditionIndicatorMode.SHOW_INDICATORS; c = app.documents[0].conditions.add ({ name: 'Risk word', indicatorColor: UIColors.YELLOW, indicatorMethod: ConditionIndicatorMethod.useHighlight, }); } return c; } function highlight (word) { app.findTextPreferences.findWhat = word; var w = app.documents[0].findText(); for (var i = w.length-1; i >= 0; i--) { w[i].applyConditions (condition); } } function getWords () { var f = File (app.documents[0].filePath + '/risk-words.txt'); if (f.exists) { f.encoding = ('utf-8'); f.open('r'); var w = f.read().replace(/+$/,'').split(/[\r]/); f.close(); return w; } return null; } app.findTextPreferences = app.findChangeTextOptions = null; app.findChangeTextOptions.properties = { caseSensitive: false, wholeWord: true, includeLockedStoriesForFind: false, } condition = getCondition(); riskWords = getWords(); if (!riskWords) { alert ('Risk words not found'); exit(); } for (var i = riskWords.length-1; i >= 0; i--) { highlight (riskWords[i]); } }());
Peter KahrelParticipantYou can send it to me at pkahrel@gmail.com
Peter KahrelParticipantI’ve seen this error a while ago, but I can’t remember what it the problem is. And I can’t reproduce it. Could you send me that document?
Peter KahrelParticipantTo translate a distance (in points) to a kerning value, you multiply that distance by (1000 / point size). So to add 6 points between two characters, you do
app.selection[0].kerningValue = 6 * (1000 / app.selection[0].pointSize);
I used that in the compose script (https://creativepro.com/files/kahrel/indesign/compose.html).
-
AuthorPosts
