0 Replies Latest reply on Feb 12, 2016 4:20 AM by kajzica

    help: place inline equations (eps), automatically adjust baseline and leading of surrounding text...windows/javascript

    kajzica

      Trying to find solution for adjusting baseline and leading on 1000s mathtype inline equations in indd.

      What i want is script which can read from ALL eps links baseline info and move it to correct position and after that adjust leading of surrounding text to +166% (2/3 more than baseline) of that baseline.

       

      Here is little code which move (selected) equation to correct position but not adjust leading of text line.

      var fp = app.selection[0].graphics[0].itemLink.filePath;

      var f = File(fp);

      f.open('r');

      var fs = f.read();

      f.close();

      var baseline = fs.match(/%%Baseline:\s+(\S+)/)[1];

      app.selection[0].anchoredObjectSettings.anchorYoffset = -Number(baseline)+"pt";