Back

If your email is not recognized and you believe it should be, please contact us.

Forum Replies Created

Viewing 8 posts - 16 through 30 (of 333 total)
  • Author
    Posts
  • in reply to: Include number of list in running header #14399159
    Peter Kahrel
    Participant

    It 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.

    in reply to: Include number of list in running header #14399153
    Peter Kahrel
    Participant

    This 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).

    in reply to: Changing italic parentheses to roman using GREP #14399126
    Peter Kahrel
    Participant

    First, 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?

    in reply to: Script or Plugin to Flag Certain Words #14397830
    Peter Kahrel
    Participant

    Brenda: 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).

    in reply to: Script or Plugin to Flag Certain Words #14397827
    Peter Kahrel
    Participant

    Updated 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]);
      }
    
    }());
    in reply to: Script or Plugin to Flag Certain Words #14397826
    Peter Kahrel
    Participant

    You can send it to me at pkahrel@gmail.com

    in reply to: Script or Plugin to Flag Certain Words #14397821
    Peter Kahrel
    Participant

    I’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?

    in reply to: Ranged left text not lining up #14396387
    Peter Kahrel
    Participant

    To 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).

Viewing 8 posts - 16 through 30 (of 333 total)