<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Linguist Coder</title>
  <id>https://www.linguist-coder.com/</id>
  <link href="https://www.linguist-coder.com/feed.xml" rel="self"/>
  <link href="https://www.linguist-coder.com/"/>
  <updated>2026-09-23T08:55:51.000Z</updated>

  <entry>
    <title>Missing Footnotes, Empty Table Cells, and Stale Index Pages After IDML Translation</title>
    <id>https://www.linguist-coder.com/2026/09/missing-footnotes-empty-table-cells.html</id>
    <link href="https://www.linguist-coder.com/2026/09/missing-footnotes-empty-table-cells.html"/>
    <published>2026-09-23T08:55:51.000Z</published>
    <updated>2026-09-23T08:55:51.000Z</updated>
    <summary>A translated InDesign document comes back with a footnote number but no text, an empty table cell, or an index page that is blank or still in the source language. There are four questions to ask, in this order: Was…</summary>
    <content type="html">&lt;p&gt;A translated InDesign document comes back with a footnote number but no text, an empty table cell, or an index page that is blank or still in the source language.&lt;/p&gt;

&lt;p&gt;There are four questions to ask, in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Was the content extracted into the bilingual file in the first place?&lt;/li&gt;
&lt;li&gt;If it was extracted, was the corresponding target left empty?&lt;/li&gt;
&lt;li&gt;Is the content still present but hidden by overset?&lt;/li&gt;
&lt;li&gt;For an index specifically: was the index page regenerated after the translated IDML was opened in InDesign?&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;diagram&quot;&gt;&lt;img src=&quot;/images/2026/09/missing-footnotes-empty-table-cells/diagram-01.svg&quot; alt=&quot;IDML extraction leads to a bilingual file, merge, and InDesign, with checks for omitted content, empty targets, overset text, stale indexes, and an empty Footnote element.&quot; width=&quot;1600&quot; height=&quot;900&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;

&lt;p&gt;These checks apply at different stages of the round trip.&lt;/p&gt;

&lt;h2&gt;First check whether the content was extracted&lt;/h2&gt;

&lt;p&gt;A common guess is that the CAT tool skipped the footnote or the table cell during extraction, treating it as something other than translatable text. I tested this with a synthetic IDML fixture containing a footnote, a table, and a nested table. Extracted with Okapi Tikal 2.1.48.0 using its IDML filter (&lt;code&gt;okf_idml&lt;/code&gt;), each table cell appeared as its own translation unit. The footnote reference in the body text appeared as a placeholder code, and the footnote&apos;s own text appeared as a separate translation unit, not attached to the sentence that carries the reference.&lt;/p&gt;

&lt;p&gt;That is the behavior I observed with Okapi Tikal 2.1.48.0 and its IDML filter on this synthetic fixture. It is not necessarily what every CAT tool does. Other CAT tools may expose IDML filter settings for footnotes or index content specifically; I did not test those tools, so check the filter configuration used for a project rather than assuming it matches the Okapi result described here.&lt;/p&gt;

&lt;h2&gt;In this Okapi test, an empty target merged without a warning&lt;/h2&gt;

&lt;p&gt;I then tested the failure case: I ran three separate merges with an empty target, one for a footnote, one for a table cell, and one for an ordinary paragraph in an independent story, as if a translator had skipped the segment or a reviewer had cleared it by mistake.&lt;/p&gt;

&lt;p&gt;The merge completed in all three cases, with no error and no warning. But the result was not a footnote with blank text or a cell with an empty paragraph. In the fixture used for this test, the text was nested inside &lt;code&gt;ParagraphStyleRange&lt;/code&gt;, &lt;code&gt;CharacterStyleRange&lt;/code&gt;, and &lt;code&gt;Content&lt;/code&gt; elements. The tested footnote contained the following structure:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;Footnote&amp;gt;
  &amp;lt;ParagraphStyleRange AppliedParagraphStyle=&quot;ParagraphStyle/$ID/NormalParagraphStyle&quot;&amp;gt;
    &amp;lt;CharacterStyleRange AppliedCharacterStyle=&quot;CharacterStyle/$ID/[No character style]&quot;&amp;gt;
      &amp;lt;Content&amp;gt;Footnote text goes here.&amp;lt;/Content&amp;gt;
    &amp;lt;/CharacterStyleRange&amp;gt;
  &amp;lt;/ParagraphStyleRange&amp;gt;
&amp;lt;/Footnote&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After merging with an empty target, the footnote container still existed, but the elements that held its paragraph, character run, and text were gone:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;Footnote/&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;Footnote/&amp;gt;&lt;/code&gt; is an empty XML element. It does not contain an empty string inside the original paragraph structure. It contains no paragraph structure at all. In this Okapi test, the same structural removal happened in the selected table cell and in the independent story: the &lt;code&gt;&amp;lt;Cell&amp;gt;&lt;/code&gt; element came back self-closed, with its row and column position intact but no paragraph inside it, and the &lt;code&gt;&amp;lt;Story&amp;gt;&lt;/code&gt; element for the ordinary paragraph came back with no &lt;code&gt;ParagraphStyleRange&lt;/code&gt; at all.&lt;/p&gt;

&lt;p&gt;I also tried removing a unit from the file entirely, rather than leaving its target empty. In this Okapi test, deleting the unit caused the merge to stop with a &lt;code&gt;Text Unit id mismatch during merger&lt;/code&gt; error, and no output file was produced. Leaving the unit in place with an empty target did not stop the merge.&lt;/p&gt;

&lt;h2&gt;Check whether the index page was regenerated&lt;/h2&gt;

&lt;p&gt;Index extraction and index-page generation are separate checks. The first is an extraction check: inspect the bilingual file to determine whether the index content reached the translator. The second concerns the generated index page.&lt;/p&gt;

&lt;p&gt;If the index topics have been translated but the index page is still stale, check whether the index has been regenerated in InDesign. I did not test index regeneration for this article, so treat this as a diagnostic check rather than a confirmed cause. If the index looks unchanged after import, regeneration is the first thing to try.&lt;/p&gt;

&lt;h2&gt;Do not confuse this with overset text&lt;/h2&gt;

&lt;p&gt;A related but different symptom: the content was translated, it is in the file, and it still looks missing on the page. One possibility is overset text, which InDesign marks with a red overset indicator. &lt;a href=&quot;https://www.linguist-coder.com/2026/07/your-first-indesign-script-which-pages.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;I&apos;ve covered diagnosing and fixing overset text separately&lt;/a&gt;. If the frame shows the indicator, check the layout before treating the content as lost.&lt;/p&gt;

&lt;h2&gt;What to check before you sign off&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;After extraction:&lt;/strong&gt; open the bilingual file and confirm that the expected footnote text and table-cell text appear as source units. If they do not, check the IDML filter settings used for the extraction.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Before merge:&lt;/strong&gt; look for units with a non-empty source and an empty target. Do not rely on the merge to reject them; in the Okapi test described here, the merge completed without a warning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;After the merged IDML is back in InDesign:&lt;/strong&gt; if content is missing from the page, check the frame for the overset indicator before concluding it was lost.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;For an index:&lt;/strong&gt; first confirm that the index content appears in the bilingual file. Then confirm whether the index page was regenerated after import.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These checks help distinguish content omitted during extraction, returned with an empty target, hidden by overset, or left on a stale index page. They do not verify the accuracy of the translation itself.&lt;/p&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-maintenance.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP – Maintenance / Recovery: When and How to Clean Up InDesign Files with IDML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/09/why-idml-formatting-can-produce.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Why IDML Formatting Can Produce Translation Tags, and What to Check in InDesign&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/09/comparing-indesign-files-after.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Comparing InDesign Files After Translation: What to Check&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>

  <entry>
    <title>How to Check a Translated InDesign File in a Language You Cannot Read</title>
    <id>https://www.linguist-coder.com/2026/09/how-to-check-translated-indesign-file.html</id>
    <link href="https://www.linguist-coder.com/2026/09/how-to-check-translated-indesign-file.html"/>
    <published>2026-09-19T23:14:42.973Z</published>
    <updated>2026-09-19T23:14:42.973Z</updated>
    <summary>A translated InDesign file comes back from the vendor. You are responsible for it, and you cannot read it. Most of the advice I found on this question ends the same way: have a native speaker review it. That is…</summary>
    <content type="html">&lt;p&gt;A translated InDesign file comes back from the vendor. You are responsible for it, and you cannot read it. Most of the advice I found on this question ends the same way: have a native speaker review it. That is right for one part of the job. It leaves out the part you can do yourself.&lt;/p&gt;

&lt;p&gt;Whether the translation is correct needs someone who reads the language. Without reading it, you can still compare the document&apos;s structure, check strings that were agreed in advance, and identify items that need review. These checks do not establish that every passage was translated.&lt;/p&gt;

&lt;p&gt;You do not need InDesign for most of this. An IDML file (InDesign&apos;s interchange format, a ZIP of XML files) can be inspected in a text editor, and the returned PDF can be searched. The overset check below uses InDesign&apos;s Preflight panel or an InDesign script. If you do not have InDesign, ask the vendor to run the check and report the results.&lt;/p&gt;

&lt;figure class=&quot;diagram&quot;&gt;&lt;img src=&quot;/images/2026/09/how-to-check-translated-indesign-file/diagram-01.svg&quot; alt=&quot;Container, agreed-string, source-language, hidden-text, and reference-string checks can be done without reading the target, while correctness requires linguistic review.&quot; width=&quot;1600&quot; height=&quot;900&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;

&lt;h2&gt;First, confirm the container survived&lt;/h2&gt;

&lt;p&gt;Before looking at any text, compare the document&apos;s structure: the stories (a story is one continuous flow of text, possibly running through several linked frames), the row and column counts of each table, the number of footnotes and anchored figures per story, and the set of paragraph styles in use. None of this requires reading. The checklist, including how to read the counts out of the IDML file without InDesign, is in &lt;a href=&quot;https://www.linguist-coder.com/2026/09/comparing-indesign-files-after.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Comparing InDesign Files After Translation: What to Check&lt;/a&gt;. Resolve missing stories or tables before linguistic review.&lt;/p&gt;

&lt;h2&gt;Compare agreed strings and values&lt;/h2&gt;

&lt;p&gt;Check part numbers, model names, quantities with units, URLs, email addresses, phone numbers, product names, and trademarks against the agreed conventions and exceptions. Some of these change form by locale, and some names are translated or transliterated by policy.&lt;/p&gt;

&lt;p&gt;In many locales the decimal separator is a comma and the thousands separator is a period or a space, so &lt;code&gt;3.5 mm&lt;/code&gt; becomes &lt;code&gt;3,5 mm&lt;/code&gt; and &lt;code&gt;1,000&lt;/code&gt; becomes &lt;code&gt;1.000&lt;/code&gt;. Dates change order. Ask the vendor for the list of names that were translated or transliterated on purpose, and record it with the conventions. Without this step, formatting differences may be mistaken for discrepancies.&lt;/p&gt;

&lt;p&gt;For a short document, search the returned PDF or the target&apos;s story XML for each item by hand. For a manual with hundreds of part numbers, extract them from the story XML of both IDML archives with a script and compare the two lists. After accounting for the agreed conventions, record unmatched values for review. A value present in both files is not evidence that the sentence around it is right.&lt;/p&gt;

&lt;h2&gt;Search the target for your own language&lt;/h2&gt;

&lt;p&gt;You cannot read the target, but you can recognize the source. Pick sentences and distinctive phrases from the source that were meant to be translated, and search for them in the target. A hit is a candidate to look at in context. No hits do not establish that nothing was left untranslated; a sentence that was half translated will not match a search for the whole sentence.&lt;/p&gt;

&lt;p&gt;Some source-language text is supposed to be there: product names, code samples, trademarks, text the vendor was told not to translate. Keep that list next to the exceptions list from the previous step, so that a hit can be classified quickly.&lt;/p&gt;

&lt;p&gt;If you have the returned PDF, start by searching it. It does not include overset text (see the next section). The story XML inside the IDML archive also contains story text that is absent from the PDF. One caution when searching the XML directly: the text of a paragraph is split into separate elements wherever the formatting changes, so a sentence with a bold word in the middle will not match as one string. Try shorter phrases when formatting splits a sentence. Record searches you cannot complete as unchecked.&lt;/p&gt;

&lt;h2&gt;Look for text you cannot see&lt;/h2&gt;

&lt;p&gt;Translated text is often longer than the source. When it no longer fits its frame, InDesign keeps it but does not display it, and it is not included in an exported PDF. InDesign&apos;s Preflight panel reports overset text, and a short script can list which pages have it: &lt;a href=&quot;https://www.linguist-coder.com/2026/07/your-first-indesign-script-which-pages.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Your First InDesign Script: Which Pages Have Overset Text?&lt;/a&gt;. Check this in the target before the reviewer opens it, because a reviewer reading the PDF cannot see what the PDF does not contain.&lt;/p&gt;

&lt;p&gt;Also check text on hidden layers, master pages, and the pasteboard. That text is in the IDML archive whether or not it shows on the page. In the Okapi filter I use, separate settings control extraction of text on hidden layers, master spreads, and hidden pasteboard items. Ask the vendor whether those locations were included in the translation. If the source has text there that matters, search the target&apos;s story files for the source-language text, as in the previous section. I wrote about finding those objects in &lt;a href=&quot;https://www.linguist-coder.com/2026/04/scaling-multilingual-dtp-by-detecting.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Detecting Objects Outside the Layout&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;If you have reference strings, use them&lt;/h2&gt;

&lt;p&gt;Two kinds of target-language text can be checked without reading, because someone else already approved them.&lt;/p&gt;

&lt;p&gt;If you have approved target-language wording for a required notice or statement, search for it in the required location. I described automating this for PDFs in &lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_21.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Mandatory Text Checks in PDFs Before Delivery&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If the vendor was given a glossary of source terms and their required target terms, you can search the target for each target term. Use exact matching for terms that are required to appear unchanged. For languages that inflect, an exact search may fail to find a correctly inflected form; treat a missing match as a question for the reviewer, not as an error.&lt;/p&gt;

&lt;p&gt;For both kinds, a match elsewhere does not confirm the required occurrence. If you cannot locate the required occurrence in the target, record it as unchecked.&lt;/p&gt;

&lt;h2&gt;What none of this tells you&lt;/h2&gt;

&lt;p&gt;A paragraph can have every number in place, no source text left in it, and the approved terms, and still say something the source does not. That is the reviewer&apos;s job, and nothing above replaces it.&lt;/p&gt;

&lt;p&gt;Machine translation back into your language gives you a rough reading of the target. It cannot tell you the translation is correct, because you would be judging a translation of a translation. Before using an online service, check whether you are permitted to upload the document.&lt;/p&gt;

&lt;p&gt;When you hand the file to the reviewer, hand over the record of which checks were completed and which questions remain.&lt;/p&gt;

&lt;h2&gt;What to ask the vendor for&lt;/h2&gt;

&lt;p&gt;Ask the vendor to confirm the number conventions and the exceptions: strings intentionally left untranslated and names intentionally translated or transliterated. If you do not have InDesign, request the overset check results. Send any search results you cannot classify to the vendor for clarification.&lt;/p&gt;

&lt;h2&gt;The order&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Container: stories, tables, footnotes, anchored objects, styles.&lt;/li&gt;
&lt;li&gt;Agreed strings and values: part numbers, quantities, URLs, and names, using the agreed conventions and exceptions.&lt;/li&gt;
&lt;li&gt;Source-language text left in the target.&lt;/li&gt;
&lt;li&gt;Text that does not show: overset, hidden layers, master pages, pasteboard.&lt;/li&gt;
&lt;li&gt;Reference strings: required wording, glossary terms, checked at the location where they are required.&lt;/li&gt;
&lt;li&gt;Linguistic review by someone who reads the target language.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Steps 1 to 5 can be run without reading the target language, using agreed conventions and approved references. Some of what they find still needs the vendor or the reviewer to resolve.&lt;/p&gt;

&lt;p&gt;I am developing a tool that does step 1 for two IDML files and reports, for each item, whether it compared it or could not. The current trial and the testing request are in &lt;a href=&quot;https://www.linguist-coder.com/2026/09/seeking-testers-comparing-idml-files.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;a separate post&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/09/comparing-indesign-files-after.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Comparing InDesign Files After Translation: What to Check&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_21.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Mandatory Text Checks in PDFs Before Delivery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/05/a-rule-first-approach-to-ai-assisted.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;A Rule-First Approach to AI-Assisted Terminology QA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>

  <entry>
    <title>Why IDML Formatting Can Produce Translation Tags, and What to Check in InDesign</title>
    <id>https://www.linguist-coder.com/2026/09/why-idml-formatting-can-produce.html</id>
    <link href="https://www.linguist-coder.com/2026/09/why-idml-formatting-can-produce.html"/>
    <published>2026-09-18T22:18:59.981Z</published>
    <updated>2026-09-18T22:18:59.982Z</updated>
    <summary>A document goes out for translation as IDML and the translator writes back: the file is full of tags. Some segments have a tag pair around a single letter. Others have a dozen tags in one sentence. The translator asks…</summary>
    <content type="html">&lt;p&gt;A document goes out for translation as IDML and the translator writes back: the file is full of tags. Some segments have a tag pair around a single letter. Others have a dozen tags in one sentence. The translator asks whether they can be deleted. The layout side asks why they are there at all.&lt;/p&gt;

&lt;p&gt;This post is about the second question, and about what to check in InDesign before the next export.&lt;/p&gt;

&lt;h2&gt;Where the tags in an IDML come from&lt;/h2&gt;

&lt;p&gt;IDML is a ZIP archive. Inside it, the &lt;code&gt;Stories/&lt;/code&gt; folder holds one XML file per story, and each paragraph is a &lt;code&gt;ParagraphStyleRange&lt;/code&gt; element. Inside the paragraph, the text is split into &lt;code&gt;CharacterStyleRange&lt;/code&gt; elements. A range is a run of text in which every character attribute is the same. Where an attribute changes, InDesign closes the range and opens a new one.&lt;/p&gt;

&lt;p&gt;A paragraph set entirely in its paragraph style, with no breaks or inline objects in it, is one range. Put one word in bold and it becomes three ranges: the text before the word, the word, the text after it.&lt;/p&gt;

&lt;p&gt;Character formatting changes therefore create range boundaries in the IDML before any translation tool has touched the file. The example below shows how the Okapi IDML filter renders two of them as paired inline codes; it does not establish how Trados or memoQ will display the same IDML.&lt;/p&gt;

&lt;figure class=&quot;diagram&quot;&gt;&lt;img src=&quot;/images/2026/09/why-idml-formatting-can-produce/diagram-01.svg&quot; alt=&quot;Bold formatting on winter becomes its own CharacterStyleRange in IDML and a paired inline code in the CAT segment.&quot; width=&quot;1600&quot; height=&quot;900&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;

&lt;h2&gt;Which formatting changes create a range boundary&lt;/h2&gt;

&lt;p&gt;Any character attribute that differs from the text around it starts a new range. In the story XML these show up as attributes on the &lt;code&gt;CharacterStyleRange&lt;/code&gt; element or in its &lt;code&gt;Properties&lt;/code&gt; child. Attributes to inspect include &lt;code&gt;AppliedCharacterStyle&lt;/code&gt;, &lt;code&gt;FontStyle&lt;/code&gt;, &lt;code&gt;PointSize&lt;/code&gt;, &lt;code&gt;AppliedFont&lt;/code&gt;, &lt;code&gt;Position&lt;/code&gt;, &lt;code&gt;KerningValue&lt;/code&gt;, &lt;code&gt;Tracking&lt;/code&gt;, &lt;code&gt;BaselineShift&lt;/code&gt;, &lt;code&gt;HorizontalScale&lt;/code&gt;, &lt;code&gt;Leading&lt;/code&gt; and &lt;code&gt;AppliedLanguage&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The attribute name does not tell you why it is there. A &lt;code&gt;Tracking&lt;/code&gt; value may be a fix for one line of English that ran a word too long, or the consistent treatment of a product name. A local &lt;code&gt;PointSize&lt;/code&gt; may be a deliberate emphasis or a squeeze to fit a caption. An &lt;code&gt;AppliedLanguage&lt;/code&gt; difference may not be visible in the layout at all, and it can be an unintended difference or an intentional setting, since the language controls hyphenation and the spelling dictionary.&lt;/p&gt;

&lt;p&gt;Formatting is also not the only source of tags. In the Okapi output for the test file below, a footnote marker and an anchored rectangle each appeared as a placeholder code (&lt;code&gt;ph&lt;/code&gt;). These codes represent document structure that needs to be preserved.&lt;/p&gt;

&lt;h2&gt;Why a tag appears in the middle of a word&lt;/h2&gt;

&lt;p&gt;Manual kerning can produce this pattern. Kerning is applied between two characters, so InDesign usually stores it as a range that contains a single character with a &lt;code&gt;KerningValue&lt;/code&gt; attribute. (A kerning value applied across a longer run of text produces a longer range; the single-character form is the common one.) That range differs from the text on both sides.&lt;/p&gt;

&lt;p&gt;To see what that looks like in a bilingual file, I took a one-paragraph IDML exported from InDesign and added two settings directly to the XML: a kerning value on the letter &lt;em&gt;p&lt;/em&gt; in &quot;copper&quot;, and a local bold on &quot;winter&quot;. Extracted with the Okapi IDML filter, the segment reads:&lt;/p&gt;

&lt;pre style=&quot;overflow:auto;&quot;&gt;&lt;code&gt;Independent frame BRAVO describes a co&amp;lt;bpt id=&quot;1&quot;&amp;gt;&amp;amp;lt;content-1&amp;gt;&amp;lt;/bpt&amp;gt;p&amp;lt;ept id=&quot;1&quot;&amp;gt;&amp;amp;lt;/content-1&amp;gt;&amp;lt;/ept&amp;gt;per telescope aimed at &amp;lt;bpt id=&quot;2&quot;&amp;gt;&amp;amp;lt;content-2&amp;gt;&amp;lt;/bpt&amp;gt;winter&amp;lt;ept id=&quot;2&quot;&amp;gt;&amp;amp;lt;/content-2&amp;gt;&amp;lt;/ept&amp;gt; stars.&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(&lt;code&gt;bpt&lt;/code&gt; and &lt;code&gt;ept&lt;/code&gt; are XLIFF&apos;s begin and end markers for a paired inline code; the &lt;code&gt;content-1&lt;/code&gt; inside them is the filter&apos;s name for the range.)&lt;/p&gt;

&lt;p&gt;The first pair records a kerning setting between two letters of one word. The second pair records a bold setting on a word that, in this example, is meant to stay bold in the translation. The &lt;code&gt;bpt&lt;/code&gt; and &lt;code&gt;ept&lt;/code&gt; markers alone do not explain why either setting was applied.&lt;/p&gt;

&lt;h2&gt;Which source formatting to keep or clear before export&lt;/h2&gt;

&lt;p&gt;Decide what the formatting is for before clearing it. Preserve formatting intended to follow the content: a word that is bold because it is a warning, a product name in a character style, a superscript that is part of a unit. Clear an adjustment only when you have identified it as a fix for the source-language layout: kerning between two letters of an English word, tracking that pulled the last word of a line back up, a local leading change on three lines that were too tall. Where you cannot tell, leave it alone.&lt;/p&gt;

&lt;h2&gt;How to find and clear the overrides in InDesign&lt;/h2&gt;

&lt;p&gt;Work on a copy of the InDesign document.&lt;/p&gt;

&lt;p&gt;The IDML you are about to send is one way to inspect the source formatting. Copy it, rename the copy to &lt;code&gt;.zip&lt;/code&gt;, extract it, and search the &lt;code&gt;Stories/&lt;/code&gt; folder with find-in-files for &lt;code&gt;KerningValue=&lt;/code&gt;, &lt;code&gt;Tracking=&lt;/code&gt;, &lt;code&gt;BaselineShift=&lt;/code&gt;, &lt;code&gt;HorizontalScale=&lt;/code&gt; and &lt;code&gt;AppliedLanguage=&lt;/code&gt;. These attributes are written only where the text departs from its styles, so each hit is a local override. The searches identify ranges to inspect; they do not tell you what each override is for, and they are not a complete check of all character- and paragraph-level overrides. A uniform override across a whole paragraph does not, by itself, create an internal range boundary.&lt;/p&gt;

&lt;p&gt;In InDesign, the tool for clearing local formatting is the &lt;strong&gt;Clear Overrides in Selection&lt;/strong&gt; button on the Paragraph Styles panel. It removes every override in the selection, character-level and paragraph-level, and returns the text to what its styles define. That includes overrides you meant to keep, which is why the order matters.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define a character style for each kind of formatting you intend to keep. A Bold character style that leaves point size unspecified does not set the text size; after overrides are cleared, the size follows the paragraph style unless the character style defines it. If your emphasis also changes the point size, that change has to be in a style as well, which may mean one style per size. Paragraph-level formatting you need to keep belongs in paragraph styles in the same way.&lt;/li&gt;
&lt;li&gt;Convert the local formatting to those styles with Find/Change. If you are preserving different point sizes, process each size separately with the matching character style; the following example applies where one Bold character style is sufficient. On the Text tab, leave &lt;em&gt;Find what&lt;/em&gt; and &lt;em&gt;Change to&lt;/em&gt; empty, set &lt;em&gt;Search&lt;/em&gt; to Document, set &lt;em&gt;Find Format&lt;/em&gt; to Font Style: Bold, and set &lt;em&gt;Change Format&lt;/em&gt; to apply the Bold character style. Use &lt;em&gt;Find Next&lt;/em&gt; on the first few matches to confirm they are the emphasis you expect before you use &lt;em&gt;Change All&lt;/em&gt;. Repeat for italic. Other formatting you want to keep needs its own search criteria and its own style.&lt;/li&gt;
&lt;li&gt;Review the &lt;code&gt;AppliedLanguage&lt;/code&gt; hits from the XML search. A local language override is cleared along with the other overrides. Where a language difference is intentional, preserve it together with the other attributes required for that text.&lt;/li&gt;
&lt;li&gt;Clear all overrides in a story only after you have confirmed that every remaining override in it can be removed. If any are unresolved, leave that story unchanged. Once that condition is met, place the cursor in the story, select all of its text, and click Clear Overrides in Selection. The character styles you applied in step 2 are not overrides, so they stay; the remaining kerning, tracking and baseline shifts go. Check footnotes, table cells and text inside anchored frames separately before treating the cleanup as complete.&lt;/li&gt;
&lt;li&gt;Export the IDML again and repeat the XML searches. Look at what is still there and decide whether each remaining hit is one you chose to keep.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This changes the layout of the copy. Lines that were held together by tracking will break differently.&lt;/p&gt;

&lt;h2&gt;What cannot be removed&lt;/h2&gt;

&lt;p&gt;Footnote references, anchored objects, index markers, cross-references and inline tables all appear as tags, and they have to. They are structure, and the target document needs them in the corresponding places. Character styles that mark meaning also stay.&lt;/p&gt;

&lt;h2&gt;If you are the translator&lt;/h2&gt;

&lt;p&gt;If you receive the IDML for translation, do not delete tags simply because they interrupt a word. Ask the document owner to review the source formatting. The cleanup described here takes place in InDesign, before a new IDML is exported.&lt;/p&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Trados-Ready IDML Export from InDesign Books&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_15.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Style Reloads Before Translation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-maintenance.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP – Maintenance / Recovery: When and How to Clean Up InDesign Files with IDML&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>

  <entry>
    <title>Comparing InDesign Files After Translation: What to Check</title>
    <id>https://www.linguist-coder.com/2026/09/comparing-indesign-files-after.html</id>
    <link href="https://www.linguist-coder.com/2026/09/comparing-indesign-files-after.html"/>
    <published>2026-09-15T21:26:12.878Z</published>
    <updated>2026-09-15T21:26:12.879Z</updated>
    <summary>A document goes out for translation as an InDesign file and comes back as an InDesign file. In between it went through a translation workflow: exported to IDML (InDesign&amp;apos;s interchange format, a ZIP of XML files), split into segments, translated,…</summary>
    <content type="html">&lt;p&gt;A document goes out for translation as an InDesign file and comes back as an InDesign file. In between it went through a translation workflow: exported to IDML (InDesign&apos;s interchange format, a ZIP of XML files), split into segments, translated, reassembled. The question that follows is simple to ask and harder to answer than it looks: is everything still there?&lt;/p&gt;

&lt;p&gt;In the forum threads I reviewed, two answers recur. Export both versions to PDF and use Acrobat&apos;s comparison. Or switch on Track Changes before the edits happen. Each does what it says. Neither, on its own, answers the structural question, and the reason tells you what the check has to look at instead.&lt;/p&gt;

&lt;h2&gt;What &quot;compare&quot; means after translation&lt;/h2&gt;

&lt;p&gt;When you compare two versions of a same-language document, you are looking for edits: a sentence changed here, a paragraph deleted there. The text is mostly identical, and the differences are the signal.&lt;/p&gt;

&lt;p&gt;After translation, text differences are expected. What you actually want to know is whether the structure the translation was poured back into still matches the one you sent out. Concretely, six things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Are all the stories still there, and does each still contain text? (A story is a continuous flow of text; it can run through several linked text frames.)&lt;/li&gt;
&lt;li&gt;Do the tables still have the same number of rows and columns?&lt;/li&gt;
&lt;li&gt;Does each story still have the same number of footnotes?&lt;/li&gt;
&lt;li&gt;Does each story still have the same number of anchored objects — figures, callouts, inline frames?&lt;/li&gt;
&lt;li&gt;Are the paragraph styles that were in use in the source still in use in the target, and vice versa?&lt;/li&gt;
&lt;li&gt;Is any of the text &lt;em&gt;not&lt;/em&gt; different — a paragraph, a footnote, a table cell that still reads in the source language?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of these is about how well the translation reads. They are about whether the container survived the round trip, which is a separate check from linguistic review.&lt;/p&gt;

&lt;figure class=&quot;diagram&quot;&gt;&lt;img src=&quot;/images/2026/09/comparing-indesign-files-after/diagram-01.svg&quot; alt=&quot;PDF comparison, Track Changes, CAT comparison, and direct IDML inspection each reveal different evidence and leave different structural questions unresolved.&quot; width=&quot;1600&quot; height=&quot;1100&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;

&lt;h2&gt;What a PDF comparison shows&lt;/h2&gt;

&lt;p&gt;Acrobat&apos;s Compare Files compares the rendered appearance and the extracted text of two PDFs. Run it on a source PDF and a translated PDF and the report will be dominated by the text differences you already expect, and layout changes from text expansion add to them. The six questions above are not what the report is organized around, and a missing footnote is one difference among many.&lt;/p&gt;

&lt;p&gt;There is also a quieter limit. Overset text is not included in the exported PDF. A PDF comparison therefore does not inspect that text.&lt;/p&gt;

&lt;h2&gt;What Track Changes shows&lt;/h2&gt;

&lt;p&gt;InDesign&apos;s Track Changes records edits made inside InDesign after it is switched on. It answers &quot;what did the editor change in this file&quot;. It does not record what happened to the text while it was outside InDesign, and switching it on after the file comes back records only what you do next.&lt;/p&gt;

&lt;h2&gt;What the CAT tool shows&lt;/h2&gt;

&lt;p&gt;A third route that experienced operators use: load both files into the CAT tool and let the translation memory find segments that are identical between source and target. This is useful for question 6, untranslated text, and it works at the segment level.&lt;/p&gt;

&lt;p&gt;What appears in the extracted bilingual data depends on the filter settings. Footnotes, for example, can be excluded. In the XLIFF (a bilingual data format used in translation workflows) generated by the Okapi round trip I tested, I found &lt;code&gt;Story&lt;/code&gt;, &lt;code&gt;Cell&lt;/code&gt; and &lt;code&gt;Footnote&lt;/code&gt; tokens, but no occurrences of &lt;code&gt;TextFrame&lt;/code&gt;, &lt;code&gt;Table&lt;/code&gt;, &lt;code&gt;Row&lt;/code&gt;, &lt;code&gt;ParagraphStyle&lt;/code&gt; or &lt;code&gt;Self=&lt;/code&gt;. That observation applies to that output; it does not establish what every CAT tool or every XLIFF file can represent.&lt;/p&gt;

&lt;h2&gt;Before you start: which two files&lt;/h2&gt;

&lt;p&gt;Identify the source version you sent out and the returned version you want to check. Record whether the returned IDML was subsequently opened in InDesign and exported to IDML again — for example, after layout fixes.&lt;/p&gt;

&lt;p&gt;This matters because of what happened to object identity in my tests. InDesign assigns every object an internal ID. In the three documents I tested through Okapi, those IDs survived the translation round trip; when the returned IDML was then opened in InDesign and exported to IDML again, the IDs I had recorded were no longer present. In the same tests, labels I had added to the objects myself before export survived both stages.&lt;/p&gt;

&lt;p&gt;Whatever the state of your files, the rule for the check is the same: for each item, record whether you could establish which object in the target corresponds to which object in the source. If you could not, mark that item as &lt;em&gt;could not be compared&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;A checklist you can run by hand&lt;/h2&gt;

&lt;p&gt;Record the outcome for each object or check performed, not one result for the whole document. Three outcomes: &lt;strong&gt;matched&lt;/strong&gt; for a value you checked and found equal; &lt;strong&gt;differed&lt;/strong&gt; for a difference you established; &lt;strong&gt;could not be compared&lt;/strong&gt; when you could not establish the correspondence or complete the check. Keep the third separate from a clean result.&lt;/p&gt;

&lt;p&gt;The practical way to do this without a tool is to read the IDML directly. An IDML file is a ZIP archive: copy it, rename the copy to &lt;code&gt;.zip&lt;/code&gt;, and extract it. Inside, the &lt;code&gt;Stories/&lt;/code&gt; folder holds one XML file per story, named after the story&apos;s internal ID (for example &lt;code&gt;Story_u195.xml&lt;/code&gt;). The checks below involve reading these XML files in a text editor with find-in-files. They cover values you can inspect directly; where the correspondence between objects or the counting unit is unclear, record &lt;em&gt;could not be compared&lt;/em&gt;. The search strings match the formatting of the IDML pair I inspected; check the element formatting in your own files before relying on search counts.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Stories.&lt;/strong&gt; Compare the list of file names in &lt;code&gt;Stories/&lt;/code&gt; between the two archives. In the Okapi pair I inspected before any re-export, all eight story file names matched, and I used them to pair the stories in that test; do not assume the same for another workflow. After a re-export, the story IDs I had recorded were no longer present in my three tests, so the file names had changed as well. If you cannot establish the correspondence, record the stories as &lt;em&gt;could not be compared&lt;/em&gt;. Record a file name present on only one side as a difference in the file list; it does not by itself establish that a story was lost. For each story you can pair, inspect the text inside its &lt;code&gt;&amp;lt;Content&amp;gt;&lt;/code&gt; elements. If the source contains text and the target contains none, record a difference. The presence of a &lt;code&gt;&amp;lt;Content&amp;gt;&lt;/code&gt; element alone is not a check that the story contains text; in my sample, an emptied story still had the elements, with nothing inside them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tables.&lt;/strong&gt; In each paired story, find each &lt;code&gt;&amp;lt;Table &lt;/code&gt; element. Its attributes &lt;code&gt;HeaderRowCount&lt;/code&gt;, &lt;code&gt;BodyRowCount&lt;/code&gt;, &lt;code&gt;FooterRowCount&lt;/code&gt; and &lt;code&gt;ColumnCount&lt;/code&gt; give the counts. Compare them only after establishing which table in the target is the counterpart; do not use the order of appearance alone as proof, since one missing table shifts everything after it. Record tables present on one side only separately, and tables you cannot pair as &lt;em&gt;could not be compared&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Footnotes.&lt;/strong&gt; In each paired story, count the &lt;code&gt;&amp;lt;Footnote &lt;/code&gt; elements and compare.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Anchored objects.&lt;/strong&gt; In each paired story, count the &lt;code&gt;&amp;lt;AnchoredObjectSetting&lt;/code&gt; elements and compare. Each anchored or inline object carries one of these elements; in my sample, a story with one anchored frame in the source and two in the target showed one and two of them. I have not tested a file with an anchored group, so if your file contains one and the count is unclear, record this check as &lt;em&gt;could not be compared&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paragraph styles.&lt;/strong&gt; Across all story files in each archive, collect the distinct values of &lt;code&gt;AppliedParagraphStyle=&quot;…&quot;&lt;/code&gt;. These are the styles actually applied, as opposed to the styles merely defined in the document. Note any value present on one side only.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Untranslated text.&lt;/strong&gt; This is a spot check, not a comparison, and the three outcomes above do not apply to it. Choose a few source-language strings you have confirmed were meant to be translated, and search for them in the target&apos;s story files. Record the strings searched and any candidates found; a hit is a candidate to check in context, and no hits do not establish that the file contains no untranslated text. Where I automate this check, I apply a word-count threshold; text below that threshold is outside the check, including any untranslated text it may contain, and the method does not work for languages without word spaces.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These checks cover counts, style use and a spot check for untranslated text. They do not establish that every footnote or anchored object is still attached at the same place in the text; that requires a finer comparison than counts. If you need that, treat items 3 and 4 as a first pass, not a conclusion.&lt;/p&gt;

&lt;p&gt;I am developing a tool for comparing the structure of two IDML files. Its report distinguishes items it compared from items it could not compare. The current trial and the testing request are in &lt;a href=&quot;https://www.linguist-coder.com/2026/09/seeking-testers-comparing-idml-files.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;a separate post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After translation, text differences alone do not tell you whether the document&apos;s structure survived. The review also needs to cover stories, tables, footnotes, anchors, styles, and possible untranslated text.&lt;/p&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Trados-Ready IDML Export from InDesign Books&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_15.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Style Reloads Before Translation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-maintenance.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP – Maintenance / Recovery: When and How to Clean Up InDesign Files with IDML&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>

  <entry>
    <title>Seeking Testers: Comparing IDML Files Before and After Translation</title>
    <id>https://www.linguist-coder.com/2026/09/seeking-testers-comparing-idml-files.html</id>
    <link href="https://www.linguist-coder.com/2026/09/seeking-testers-comparing-idml-files.html"/>
    <published>2026-09-15T04:02:20.523Z</published>
    <updated>2026-09-20T04:56:07.415Z</updated>
    <summary>I&amp;apos;m developing a tool that compares two IDML files: the InDesign document you sent out for translation, and the one that came back. It runs on Windows, the current build is unsigned, and the trial is free. I plan to…</summary>
    <content type="html">&lt;p&gt;I&apos;m developing a tool that compares two IDML files: the InDesign document you sent out for translation, and the one that came back. It runs on Windows, the current build is unsigned, and the trial is free. I plan to offer a paid version later. What I need now is feedback from people who can run it locally on a real translation job. I&apos;m a technical writer based in Japan, with 17 years in multilingual document production; this blog is where I write about that work.&lt;/p&gt;

&lt;h2&gt;Why I&apos;m building this&lt;/h2&gt;

&lt;p&gt;This tool grew out of a question from my translation work: when a document comes back, what changed structurally, and is anything missing? I have not found that question answered by the tools I use, so I started building one.&lt;/p&gt;

&lt;h2&gt;What the tool checks&lt;/h2&gt;

&lt;p&gt;It compares the source IDML and the returned IDML for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;missing stories, text frames and tables where a match can be established; emptied story or table-cell text; changes in footnote and anchored-object counts per story&lt;/li&gt;
&lt;li&gt;changes in paragraph counts, table row and column counts, applied paragraph styles, and the sequence of character styles within a paragraph&lt;/li&gt;
&lt;li&gt;paragraphs, footnotes and table cells whose text is still identical to the source, subject to a word-count threshold (short unchanged text and untranslated text mixed into an otherwise translated paragraph are not reported, and the check is ineffective for text without word spaces, such as Japanese or Chinese)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The comparison runs without launching InDesign, reads the two IDML files without modifying them, and sends nothing over the network. It does not assess translation quality, layout geometry, images or links. Every report lists what was checked and what was not compared, even when it found nothing.&lt;/p&gt;

&lt;p&gt;Testing so far has used synthetic documents, not real translation jobs. That is the gap I am trying to close. I&apos;m asking for feedback, not copies of your files or reports.&lt;/p&gt;

&lt;h2&gt;Getting the trial&lt;/h2&gt;

&lt;p&gt;The trial and Quick Start are on GitHub Releases: &lt;a href=&quot;https://github.com/linguist-coder/localisation-qa/releases/latest&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;linguist-coder/localisation-qa&lt;/a&gt;. You can download and try it without contacting me first. Because the build is unsigned, Windows may show an Open File security warning or a SmartScreen warning; the Quick Start covers both. The trial runs all checks and counts every finding; it shows one finding per rule with its page, object and content, and lists the rest by rule only. Re-running the same pair does not reveal more details. The included sample pair has planted defects and always produces a full report, so you can try it before using your own files.&lt;/p&gt;

&lt;p&gt;The trial build does not expire, and there is no deadline for feedback. Running the included sample takes a few minutes, most of it reading the report; a real document pair depends on its size.&lt;/p&gt;

&lt;p&gt;So you can decide whether this is worth your time: the paid version is planned as a one-time purchase, about $99, sold under the same name as this blog (Linguist Coder). It runs on your machine and does not send files anywhere. If any of that rules it out for your workplace, I would still like to hear why; that is useful feedback on its own.&lt;/p&gt;

&lt;h2&gt;Two limits to know before you try it&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;IDML only.&lt;/strong&gt; It does not read INDD. You need the source and returned versions as IDML, exported from InDesign if necessary.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Matching depends on identifiers.&lt;/strong&gt; The tool uses labels added by the included script, or InDesign&apos;s internal IDs when labels are absent. In a tested workflow using Okapi, internal IDs survived the translation round trip; they were reassigned when the IDML was then opened in InDesign and re-exported. An existing pair without labels may therefore have objects that cannot be matched; these are reported as &quot;could not be compared&quot;, not as clean. For future jobs, run the included script in InDesign before exporting the source IDML you send out; matching then uses those labels if the returned file retains them.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;How to send feedback&lt;/h2&gt;

&lt;p&gt;If you try it, a brief note on these four questions is all I need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Did you use files from a real translation job, or only the sample?&lt;/li&gt;
&lt;li&gt;Did ZIP extraction, launch and analysis all complete? If not, where did it stop?&lt;/li&gt;
&lt;li&gt;How do you currently check returned files?&lt;/li&gt;
&lt;li&gt;Did it show anything your current check had missed? &quot;No&quot; or &quot;couldn&apos;t tell&quot; is useful too; please mention any false alarms.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Email your feedback to hi@linguist-coder.com, or reply to &lt;a href=&quot;https://x.com/linguist_coder/status/2099711656192565320&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;the announcement post on X&lt;/a&gt; (@linguist_coder). Please leave out client names and document text when describing your results; replies on X are public. I won&apos;t publish feedback sent by email without your permission.&lt;/p&gt;
</content>
  </entry>

  <entry>
    <title>Where an InDesign Script Should Stop</title>
    <id>https://www.linguist-coder.com/2026/09/where-indesign-script-should-stop.html</id>
    <link href="https://www.linguist-coder.com/2026/09/where-indesign-script-should-stop.html"/>
    <published>2026-09-11T03:30:49.015Z</published>
    <updated>2026-09-11T03:30:49.015Z</updated>
    <summary>A translated document comes back and the layout is full of overset text. Not one frame: dozens, spread across chapters, plus a handful of table cells where the German ran two lines longer than the English. A script can tighten…</summary>
    <content type="html">&lt;p&gt;A translated document comes back and the layout is full of overset text. Not one frame: dozens, spread across chapters, plus a handful of table cells where the German ran two lines longer than the English.&lt;/p&gt;

&lt;p&gt;A script can tighten the tracking, drop a point of type, grow the frame, raise a fixed row height. The interesting question was never whether it can do that. It is how far it should go, what it should refuse to do at all, and what it should say when it stops short.&lt;/p&gt;

&lt;p&gt;The examples below come from Overset Fixer Pro, a script I sell for InDesign. Version 2.0 forced four of those decisions into the open, and the last one was a lesson in how quietly this kind of thing goes wrong.&lt;/p&gt;

&lt;h2&gt;A Row It Could Grow, and Doesn&apos;t&lt;/h2&gt;

&lt;p&gt;InDesign gives a table row one of two height behaviors. &lt;strong&gt;At Least&lt;/strong&gt; means the row grows on its own to fit whatever is in it. &lt;strong&gt;Exactly&lt;/strong&gt; means the row is pinned at a height someone chose, and text that does not fit becomes overset.&lt;/p&gt;

&lt;p&gt;If a cell in an Exactly row is overset, growing the row is a reasonable fix. The row is pinned; raise its fixed height a little and the text may fit.&lt;/p&gt;

&lt;p&gt;If a cell in an At Least row is overset, growing the row is not a fix at all. That row is already trying to grow. Its height is not what is holding the text back &amp;mdash; something else is, usually the frame the table sits in. Writing a height to that row would not solve the problem, and it would do damage on the way past: the height the script writes imposes a minimum the script chose, and the script has no verified way to reconstruct the row&apos;s previous state afterward. That is reason enough not to write it.&lt;/p&gt;

&lt;p&gt;So the script never writes to those rows. Not as a default, not as an option, not when you clear the option that lets fixed rows grow. That option governs Exactly rows only.&lt;/p&gt;

&lt;p&gt;The asymmetry is the whole argument. On one side, one row gets fixed. On the other, the document&apos;s existing behavior is replaced by a minimum the script invented, silently, in a document that may have hundreds of rows. &lt;strong&gt;The test is not whether the script can do the thing. It is whether the user can get back what the script replaced.&lt;/strong&gt; When the answer is &quot;by hand, and only if they notice,&quot; the feature does not ship.&lt;/p&gt;

&lt;h2&gt;One Lever at a Time&lt;/h2&gt;

&lt;p&gt;The text side has three levers: tracking, font size, horizontal scale. Leading is not a fourth; it follows font size at a ratio you set. Each lever has a floor you set, and the floor is a typographic decision before it is anything else &amp;mdash; I made that case for the single-lever version in &lt;a href=&quot;https://www.linguist-coder.com/2026/09/your-second-indesign-script-condensing.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Part 2 of the beginner series&lt;/a&gt;, which ends by noting that a script with several levers also needs a rule for the order they are tried in. This is that rule.&lt;/p&gt;

&lt;p&gt;The obvious implementation runs them together. Nudge everything down a step, check whether the overset cleared, nudge again. It terminates, and it can be wrong in a way that is easy to miss: text that tighter tracking alone would have fixed comes back a half point smaller and slightly narrower as well. Nothing looks broken. The page is just quietly further from the design than it needed to be, and no single setting explains why.&lt;/p&gt;

&lt;p&gt;2.0 runs them as a cascade instead. Tracking goes first and goes all the way to its floor. Only then does font size start moving, with leading following it. Horizontal scale is last, and is reached only if the other two fell short. The loop stops the moment the overset clears. Tracking and horizontal scale are off by default, so a default run moves only the type size and its linked leading; the cascade is the order among whatever you switch on.&lt;/p&gt;

&lt;p&gt;Two things come out of that. The result respects the order: when an earlier lever clears the overset, no later lever is touched. And the result is legible: when tracking is enabled and clears the overset at the first stage, you can look at the frame, see that only the tracking moved, and know the type size was never touched.&lt;/p&gt;

&lt;p&gt;The order is a judgment, not a fact. I put tracking first because I judge a few units of it to be the least objectionable change of the three, and horizontal scale last because I treat visibly distorted letterforms as the costliest. Someone setting a different kind of work could argue for a different order. What matters is that there &lt;strong&gt;is&lt;/strong&gt; an order, that it is written down, and that it is the same on every run.&lt;/p&gt;

&lt;h2&gt;Saying What Happened When It Stops Short&lt;/h2&gt;

&lt;p&gt;Sometimes the levers reach their floors and the text still does not fit. Now the script has to do something, and there are two defensible answers.&lt;/p&gt;

&lt;p&gt;Text adjustment mode writes the original values back and counts the frame as unresolved. &lt;a href=&quot;https://www.linguist-coder.com/2026/09/your-second-indesign-script-condensing.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Part 2&lt;/a&gt; is about why &quot;putting it back&quot; is a claim to test rather than assume. Here it is verified at the level of values: the script snapshots each style run before it moves anything, and a mixed-formatting test confirmed that each run received its original values again, so a story that disagreed with itself comes back disagreeing in the same places. Whether the text&apos;s relationship to its styles comes back with the values, I have not tested. Either way the frame is left for a person.&lt;/p&gt;

&lt;p&gt;Frame expansion mode does the opposite. A frame or row that was enlarged without resolving is left at its new size rather than silently discarded. That is not a claim that the page is finished: expansion moves only the bottom edge and does not move nearby items out of the way, so the result still needs to be inspected. The choice is simply to keep the enlargement for that inspection, and to report that it remains.&lt;/p&gt;

&lt;p&gt;Both answers are defensible. What is not defensible is leaving the user to guess which one happened. The run report names it, and the notice after a frame expansion run says plainly that enlarged frames have been left at their new size, that one Ctrl+Z undoes the entire run, and to do that before making any other edit. Nobody discovers it three pages later. Skips are reported the same way, with the reason attached instead of folded into a single count of failures &amp;mdash; a row skipped because it grows on its own is a different fact from a frame the script tried and could not fix.&lt;/p&gt;

&lt;p&gt;A limit whose effect you cannot see is not a limit. It is a hope.&lt;/p&gt;

&lt;h2&gt;The Limit That Was Not Real&lt;/h2&gt;

&lt;p&gt;Which brings me to the decision that should have been checked before the first version shipped.&lt;/p&gt;

&lt;p&gt;Frame expansion has two numbers: how much to add per step, and the maximum a frame may grow in total. They are the safety rail for the entire feature. Set 2mm and 15mm, and a frame should grow in 2mm steps and stop at 15mm.&lt;/p&gt;

&lt;p&gt;In a document whose rulers are set to millimeters, it did not. It grew in steps of 5.669mm and would carry on to roughly 42.5mm. Every number was off by the same factor &amp;mdash; 2.835, the number of points in a millimeter.&lt;/p&gt;

&lt;p&gt;The cause is one step of reasoning that was never verified. &lt;code&gt;geometricBounds&lt;/code&gt; reports a frame&apos;s position in whatever unit the document&apos;s rulers use. The script was converting the user&apos;s millimeters into points before adding them. Two values, two unit systems, one addition, no error message.&lt;/p&gt;

&lt;p&gt;Nothing announced it. The frames grew, the overset cleared, the script reported success. The clue that led me to it was excess space below the last line in frames the script had expanded, which is exactly the kind of thing you put down to the document. It surfaced when that impression finally got measured: one frame, before and after, read off the Transform panel &amp;mdash; 13.529mm to 24.868mm. Two steps of a setting that said 2mm had added 11.339mm.&lt;/p&gt;

&lt;p&gt;The fix is unremarkable. The run now forces measurements into points for its duration and restores the previous setting afterward. What is worth keeping is the shape of the failure. Refusing a row and reporting a skip need no number. But the floors in the cascade are numbers, and so are these two limits, &lt;strong&gt;and a number in an interface is only a promise about what the code does.&lt;/strong&gt; The guard had been written, documented, and shipped, and it was not enforcing the value anyone typed.&lt;/p&gt;

&lt;p&gt;So the fourth decision is not finished when the limit is designed. It is finished when the boundary has been measured in a real document, in the units the user actually has, rather than trusted because it was written down.&lt;/p&gt;

&lt;h2&gt;The Pattern Underneath&lt;/h2&gt;

&lt;p&gt;This is the distinction I keep coming back to in &lt;a href=&quot;https://www.linguist-coder.com/2026/04/scaling-multilingual-dtp-by-detecting.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;low judgment work&lt;/a&gt;: some parts of a production job are mechanical and repetitive, and some parts need a decision only a person can make. Automation earns its place on the first kind, and gets dangerous when it quietly annexes the second.&lt;/p&gt;

&lt;p&gt;Where to stop is not one question but four:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What will it refuse to touch, even when it could, because it cannot put the previous state back?&lt;/li&gt;
&lt;li&gt;When several levers are available, in what order are they tried, and where does each one stop?&lt;/li&gt;
&lt;li&gt;What state is left behind when it stops short, and how is that reported?&lt;/li&gt;
&lt;li&gt;Have the limits you configured been measured where they actually run?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The script that comes out of this does less than it could. That is the point. The work it declines to do is the work you would not want it doing unsupervised, and what a tool leaves alone is one of the things I check before handing one to a production team.&lt;/p&gt;

&lt;p&gt;Overset Fixer Pro 2.0 is on &lt;a href=&quot;https://aescripts.com/overset-fixer-pro/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;aescripts + aeplugins&lt;/a&gt;, with a free trial.&lt;/p&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/09/your-second-indesign-script-condensing.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Your Second InDesign Script: Condensing Text Until It Fits&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/07/your-first-indesign-script-which-pages.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Your First InDesign Script: Which Pages Have Overset Text?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/04/scaling-multilingual-dtp-by-detecting.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Detecting Objects Outside the Layout (Low Judgment Workflows)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>

  <entry>
    <title>Your Second InDesign Script: Condensing Text Until It Fits</title>
    <id>https://www.linguist-coder.com/2026/09/your-second-indesign-script-condensing.html</id>
    <link href="https://www.linguist-coder.com/2026/09/your-second-indesign-script-condensing.html"/>
    <published>2026-09-10T05:23:38.333Z</published>
    <updated>2026-09-10T05:23:38.333Z</updated>
    <summary>Part 1 reported which pages contained overset text without changing the document. This post changes it: the script below lowers the horizontal scale of the selected frame&amp;apos;s entire story, one percentage point at a time, until the overset clears or…</summary>
    <content type="html">&lt;p&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/07/your-first-indesign-script-which-pages.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Part 1&lt;/a&gt; reported which pages contained overset text without changing the document. This post changes it: the script below lowers the horizontal scale of the selected frame&apos;s entire story, one percentage point at a time, until the overset clears or it reaches a limit you choose.&lt;/p&gt;

&lt;p&gt;Two things are worth knowing before you read another line:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;It changes the whole story, not the frame.&lt;/strong&gt; If the story runs through three linked frames, all three get restyled. The reason is structural and I come back to it below.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It expects a frame that reports overset&lt;/strong&gt; — in practice, an unthreaded frame, or the last frame in a chain. A frame in the middle of a thread passes its surplus along and does not report anything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This edit needs an explicit limit, and a defined outcome for the case where the text still does not fit.&lt;/p&gt;

&lt;p&gt;So the interesting question is not how to condense text. It is how far you are willing to go, what the script should do when that is not far enough, and what &quot;putting it back&quot; actually means.&lt;/p&gt;

&lt;h2&gt;One number, one typographic decision&lt;/h2&gt;

&lt;p&gt;Horizontal scale is a percentage. At 100 the type is drawn as designed. Below that, every character gets narrower while its height stays the same.&lt;/p&gt;

&lt;p&gt;That is the appeal and the problem in the same sentence. It always makes text occupy less width. It never asks whether the result still looks like the typeface you chose.&lt;/p&gt;

&lt;p&gt;In my work I go by the following rough rules of thumb, not measured thresholds, and the exact numbers depend on the typeface, the size, the measure, and how forgiving the job is. A couple of percent goes unremarked in body copy. Ten percent is visible to someone who sets type for a living. By a quarter, the letterforms no longer carry the proportions the designer drew. A display line at 24pt gives you away sooner than a caption at 7pt.&lt;/p&gt;

&lt;p&gt;None of that is InDesign&apos;s business to enforce. It is yours, and the script should say where you drew the line.&lt;/p&gt;

&lt;h2&gt;The overset text is not in the frame&lt;/h2&gt;

&lt;p&gt;Here is the part that trips people up.&lt;/p&gt;

&lt;p&gt;You have a frame. You want to condense the text in that frame. So you reach for the frame&apos;s text:&lt;/p&gt;

&lt;pre style=&quot;overflow:auto;&quot;&gt;&lt;code&gt;frame.characters
frame.lines&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Both of these reach the text the frame actually holds — the composed, visible text. But overset text is, by definition, the text the frame does not hold. It belongs to the story and it is waiting outside. Scale only what the frame contains and you are working on the wrong characters; some of the surplus may flow in as the visible text narrows, but you are shrinking the part that already fit in order to rescue the part that did not.&lt;/p&gt;

&lt;p&gt;So you go one level up, to the story:&lt;/p&gt;

&lt;pre style=&quot;overflow:auto;&quot;&gt;&lt;code&gt;frame.parentStory&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And that has a consequence worth stating plainly: &lt;strong&gt;if that story flows through three linked frames, you just restyled all three.&lt;/strong&gt; This is not a bug you can fix by choosing a narrower scope. The story owns the characters; the frame only decides how a portion of them is displayed. A script that condenses overset text is always a story-level operation wearing a frame-level interface, and the honest thing to do is say so rather than let the selection imply otherwise.&lt;/p&gt;

&lt;h2&gt;The loop needs a second exit&lt;/h2&gt;

&lt;p&gt;The naive version writes itself:&lt;/p&gt;

&lt;pre style=&quot;overflow:auto;&quot;&gt;&lt;code&gt;var frame = app.selection[0];

while (frame.overflows) {
    frame.parentStory.texts[0].horizontalScale -= 1;
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Do not run that.&lt;/p&gt;

&lt;p&gt;The only stop condition written into this loop is that the frame no longer reports overset. It names no minimum acceptable scale, and no outcome for text that still does not fit. Its one exit depends entirely on the document changing its mind, and horizontal scale cannot go down forever.&lt;/p&gt;

&lt;p&gt;This is a general lesson worth taking out of InDesign with you: &lt;strong&gt;a loop whose exit depends on the world responding needs a second exit that does not.&lt;/strong&gt; The complete script adds both — a floor, and a defined outcome when the floor is reached.&lt;/p&gt;

&lt;h2&gt;The floor is not a safety hack&lt;/h2&gt;

&lt;pre style=&quot;overflow:auto;&quot;&gt;&lt;code&gt;var MIN_SCALE = 90;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It is tempting to read that as loop protection, and it does serve that purpose. But it is really the typographic decision from earlier, written down.&lt;/p&gt;

&lt;p&gt;A lower floor permits more horizontal compression, and buys the appearance of a higher success rate by widening what you are willing to ship. Reaching the floor without clearing the overset is not a malfunction: it means this lever failed within the limit you chose, and the frame needs a different kind of fix.&lt;/p&gt;

&lt;p&gt;Ninety is not a standard. It is a starting point for the kind of work I do, and it is the first number you should change for yours.&lt;/p&gt;

&lt;p&gt;That is the value of putting it on the first line as a named constant. The most visible judgment call in the script sits where you can argue about it.&lt;/p&gt;

&lt;h2&gt;What &quot;putting it back&quot; can and cannot mean&lt;/h2&gt;

&lt;p&gt;This is the part I would have skipped a few years ago, and it matters more than the loop.&lt;/p&gt;

&lt;p&gt;When the script gives up and writes the original value back:&lt;/p&gt;

&lt;pre style=&quot;overflow:auto;&quot;&gt;&lt;code&gt;story.texts[0].horizontalScale = original;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;the number you see in the Character panel returns to where it was. The question is what else came back with it.&lt;/p&gt;

&lt;p&gt;Does the text then go back to following its paragraph style, or does the assignment leave a local override sitting on top of the style? That is not a question to reason about from first principles. I tested it.&lt;/p&gt;

&lt;p&gt;I ran these tests in InDesign 21.5.1.73, on one machine, in one session; I have not checked other versions or platforms. The test is not to look at the page, which shows nothing either way. It is to change the paragraph style&apos;s horizontal scale afterwards and see whether that change reaches the text.&lt;/p&gt;

&lt;p&gt;Starting from a story that inherited 100% from its style: condense it to 97% and leave it there, and a later change to the style &lt;strong&gt;does not reach the text&lt;/strong&gt; — an override is sitting on it. Write the 100% back, which is what the failure branch does, and the change &lt;strong&gt;reaches the text again&lt;/strong&gt;. Write 90% onto text that already inherits 90%, and nothing is created at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A successful fit still needs your approval.&lt;/strong&gt; The test shows why checking whether the text fits is not enough: keeping 97% also changed how the text responded to later style edits. These results do not establish how every combination of styles and existing overrides behaves.&lt;/p&gt;

&lt;p&gt;What the restore genuinely cannot do is put back &lt;em&gt;differences&lt;/em&gt;. It writes one value across the whole story, so if the story had disagreed with itself before the run, that disagreement is gone. This is the same problem as the mixed-scale check below, seen from the other end, and it is why the script refuses to start on a story whose runs disagree: the only restore it has is a single number.&lt;/p&gt;

&lt;p&gt;The script also groups its edits into a single undo step.&lt;/p&gt;

&lt;pre style=&quot;overflow:auto;&quot;&gt;&lt;code&gt;app.doScript(condenseToFit, ScriptLanguage.JAVASCRIPT, undefined,
             UndoModes.ENTIRE_SCRIPT, &quot;Condense to fit&quot;);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;UndoModes.ENTIRE_SCRIPT&lt;/code&gt; groups the operation into one undo step. That matters most after a run that worked: in the same test, undoing a successful run let later changes to the paragraph style reach the text again.&lt;/p&gt;

&lt;p&gt;It is worth being precise about what that covers. The restore branch handles one outcome: text that still overflows at the floor. It is not an exception handler. Locked objects or layers can interrupt the run, and the restore line never runs if the failure happens before it. Automatic rollback after an exception is undocumented and unverified here. The recovery instructions in this post describe a run that completed, not a tested recovery procedure for an interrupted one.&lt;/p&gt;

&lt;h2&gt;The script&lt;/h2&gt;

&lt;p&gt;Use the setup steps in &lt;a href=&quot;https://www.linguist-coder.com/2026/07/your-first-indesign-script-which-pages.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Part 1&lt;/a&gt; to save the code below as &lt;code&gt;condense-to-fit.jsx&lt;/code&gt;. For the first run, work on a copy of a document. With the Selection tool, select one overset text frame — an unthreaded frame, or the last frame in a thread — then run the script from the Scripts panel.&lt;/p&gt;

&lt;pre style=&quot;overflow:auto;&quot;&gt;&lt;code&gt;// Condenses the selected frame&apos;s story horizontally until the overset clears.
(function () {
    var MIN_SCALE = 90;   // percent - the most distortion you are willing to ship
    var STEP = 1;

    function condenseToFit() {
        var sel = app.selection;
        if (sel.length !== 1 || !(sel[0] instanceof TextFrame)) {
            alert(&quot;Select exactly one text frame with the Selection tool.&quot;);
            return;
        }

        var frame = sel[0];
        if (!frame.overflows) {
            alert(&quot;That frame is not overset.&quot;);
            return;
        }

        // The overset text sits outside the frame, so the story is the only handle.
        var story = frame.parentStory;

        // Asking the story for its horizontal scale does not tell you whether the
        // story agrees with itself: a mixed story hands back its first run&apos;s value.
        // So compare the runs instead of trusting the effective value.
        var runs = story.textStyleRanges;
        var original = runs[0].horizontalScale;
        for (var i = 1; i &amp;lt; runs.length; i++) {
            if (runs[i].horizontalScale !== original) {
                alert(&quot;This story already mixes horizontal scales. Not handled.&quot;);
                return;
            }
        }
        if (original &amp;lt; MIN_SCALE) {
            alert(&quot;This story is already below &quot; + MIN_SCALE + &quot;%. Not handled.&quot;);
            return;
        }

        var scale = original;
        while (frame.overflows &amp;amp;&amp;amp; scale &amp;gt; MIN_SCALE) {
            scale = Math.max(scale - STEP, MIN_SCALE);   // never step past the floor
            story.texts[0].horizontalScale = scale;
        }

        if (!frame.overflows) {
            alert(&quot;Fitted at &quot; + scale + &quot;%.&quot;);
        } else if (scale === original) {
            alert(&quot;Already at the &quot; + MIN_SCALE + &quot;% floor. Nothing was changed.&quot;);
        } else {
            story.texts[0].horizontalScale = original;
            alert(&quot;Could not fit at &quot; + MIN_SCALE + &quot;% or above.\n&quot;
                + &quot;The scale is back at &quot; + original + &quot;%, but the document is still marked as modified.\n&quot;
                + &quot;Use Undo once to undo this run.&quot;);
        }
    }

    if (app.documents.length === 0) {
        alert(&quot;Open a document first.&quot;);
        return;
    }

    app.doScript(condenseToFit, ScriptLanguage.JAVASCRIPT, undefined,
                 UndoModes.ENTIRE_SCRIPT, &quot;Condense to fit&quot;);
})();&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;&quot;Fitted at X%&quot; is not the end of the job.&lt;/strong&gt; It means the selected frame no longer reports overset. Before you keep the result, look at every frame in that story — all of them were restyled — and decide whether you accept the horizontal-scale change. In the style-inherited case tested above, keeping the fitted value also meant keeping a local override. To reject the run, press Ctrl+Z once.&lt;/p&gt;

&lt;p&gt;Three more small things are doing real work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clamping the step.&lt;/strong&gt; The starting scale is not necessarily a whole number — a story sitting at 90.5% is perfectly ordinary. Subtract one and you are at 89.5%, below the floor you just spent a section defending, and if the text happens to fit there the script reports success. &lt;code&gt;Math.max(scale - STEP, MIN_SCALE)&lt;/code&gt; prevents a step from going below the floor. If the text fits sooner, the loop stops there. A floor you can step over is not a floor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Restoring only what was written.&lt;/strong&gt; If the story starts at exactly the floor, the loop makes no assignment at all. So the restore is guarded: that branch skips it and reports that nothing was changed — which is the point. A run that changed nothing should not ask you to go and check anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comparing the runs before writing.&lt;/strong&gt; If part of the story is already condensed and part is not, the script has no business scaling the whole thing from a single starting number. My first version treated a numeric result as evidence of a uniform scale: it asked the story for its horizontal scale and refused if the answer was not a number.&lt;/p&gt;

&lt;p&gt;The mixed-run tests showed that check does not detect the differences. In a story with three runs at 100, 95 and 100, &lt;code&gt;story.texts[0].horizontalScale&lt;/code&gt; returned the number &lt;code&gt;100&lt;/code&gt;. Flip the order so the runs read 95, 100, 100 and it returned &lt;code&gt;95&lt;/code&gt;. &lt;strong&gt;In these tests the property returned the first run&apos;s value rather than any marker for mixed values&lt;/strong&gt;, so the check never fired and the run went on to flatten a difference it had not noticed.&lt;/p&gt;

&lt;p&gt;The check has to compare the runs itself — this is the excerpt from &lt;code&gt;condenseToFit&lt;/code&gt; above:&lt;/p&gt;

&lt;pre style=&quot;overflow:auto;&quot;&gt;&lt;code&gt;var runs = story.textStyleRanges;
var original = runs[0].horizontalScale;
for (var i = 1; i &amp;lt; runs.length; i++) {
    if (runs[i].horizontalScale !== original) {
        alert(&quot;This story already mixes horizontal scales. Not handled.&quot;);
        return;
    }
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The guard compares horizontal-scale values, not the number of runs. In the six-run test, the text differed in weight, size and color, but every run started at 100% horizontal scale. The script accepted it and fitted the text at 95%.&lt;/p&gt;

&lt;p&gt;Note also what the check does not buy you. It confirms the runs agree on a value. It says nothing about whether that value came from a style or an override, which is the distinction from the section above. Uniform on screen is not the same as uniform underneath.&lt;/p&gt;

&lt;h2&gt;Where this stops working&lt;/h2&gt;

&lt;p&gt;Run it on real pages and you will meet the edges quickly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Condensing does not always help.&lt;/strong&gt; What it buys is width, so it works by changing where lines break. When the overset is governed by vertical constraints rather than by line length, narrowing the characters may buy very little. The script reports that it could not clear the overset within your limit, but not which kind of problem you had — and &quot;it did not work&quot; and &quot;it cannot work&quot; look identical from the outside.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A version with several adjustment methods needs more than the methods.&lt;/strong&gt; Tracking, leading, point size and the size of the frame itself all buy space, and each buys a different amount at a different cost. Applying several of them on each pass can change more than necessary: the text may fit after one adjustment, before the others are applied. So such a version needs a limit for each method and a rule for the order they are tried in. This script implements one method, which is why it can get away with one number.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One percentage point at a time is coarse.&lt;/strong&gt; A frame that would have cleared at 99.4% gets taken to 99%. Fine here; not fine if you are trying to prove you used the minimum distortion necessary.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;This is advice about horizontal Latin text.&lt;/strong&gt; The 90% starting point reflects my work with it. A composite font can cover several scripts under one setting, so do not assume that a limit acceptable for one of them is acceptable for the rest. Choose and review a limit for the text in the job in front of you rather than carrying this one across a language boundary.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Locked objects and locked layers can cause an exception.&lt;/strong&gt; This script does not check their lock state before writing. A production version checks first, which is the difference between recovering from a problem and not having one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One frame at a time.&lt;/strong&gt; Part 1 hands you a list of pages. If there are forty overset frames on them, this script asks you to click forty times.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A document-wide version has to rescan and repeat.&lt;/strong&gt; Fixing one frame can change what fits elsewhere: expanding a frame can make its text overlap nearby content, and condensing a story recomposes every frame that story runs through. Once a lever changes geometry, the fix stops being local, so a version that works on a whole document needs to rescan and repeat until nothing changes — with a limit on the number of passes, so that it stops instead of thrashing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;What the two scripts are for&lt;/h2&gt;

&lt;p&gt;Part 1 defined what to inspect and what its report meant. Part 2 defines what to change, how far to change it, and what happens when the text still does not fit.&lt;/p&gt;

&lt;p&gt;The floor is only one part of that decision. Before running the script, accept its story-wide scope. After a fit, review the result and decide whether to keep the horizontal-scale change. If the text still does not fit, the script writes the starting scale back — in the case tested above the text followed later style changes again, though the document stays marked as modified — and one Undo reverses the whole run.&lt;/p&gt;

&lt;p&gt;Those choices belong to the person running the script. The code only makes them explicit.&lt;/p&gt;

&lt;p&gt;What neither script covers is the case that actually eats the day — a hundred frames across a dozen documents in five languages, where several methods have to be tried in a defined order, the results recorded, and anything unfixable handed back to a human with its page number attached. I discuss &lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-eliminating.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;broader multilingual production workflows in this earlier post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I also sell &lt;a href=&quot;https://aescripts.com/overset-fixer-pro/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Overset Fixer Pro&lt;/a&gt;, a paid script for document-wide fitting with multiple adjustment methods and reports of what was fitted, left overset, or skipped.&lt;/p&gt;
</content>
  </entry>

  <entry>
    <title>InDesign Will Not Warn You About External Links</title>
    <id>https://www.linguist-coder.com/2026/08/indesign-will-not-warn-you-about.html</id>
    <link href="https://www.linguist-coder.com/2026/08/indesign-will-not-warn-you-about.html"/>
    <published>2026-08-22T00:10:57.340Z</published>
    <updated>2026-08-22T00:10:57.340Z</updated>
    <summary>A document opens cleanly. No red flags in the Links panel, no warnings on export. It gets zipped, copied to a shared drive, or handed off as it stands. On the other machine, images are missing &amp;amp;mdash; not one or…</summary>
    <content type="html">&lt;!-- YouTube embed (responsive 16:9) --&gt;
&lt;div style=&quot;position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;margin:0 0 1.5em;&quot;&gt;
&lt;iframe loading=&quot;lazy&quot; src=&quot;https://www.youtube.com/embed/zN5TkmJ5yq8&quot; style=&quot;position:absolute;top:0;left:0;width:100%;height:100%;border:0;&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; allowfullscreen title=&quot;LinkSafe: Collect, Relink, and Audit External Links in InDesign&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;p&gt;A document opens cleanly. No red flags in the Links panel, no warnings on export. It gets zipped, copied to a shared drive, or handed off as it stands. On the other machine, images are missing &amp;mdash; not one or two, but a screenful.&lt;/p&gt;

&lt;p&gt;Nothing broke in transit. The links were already pointing at places that were never going to travel with the file. They had been for weeks. The handoff was just the first moment anything depended on it.&lt;/p&gt;

&lt;h2&gt;Two Kinds of Bad Link, and InDesign Only Names One&lt;/h2&gt;

&lt;p&gt;InDesign is precise about link state. It will tell you a link is &lt;strong&gt;missing&lt;/strong&gt; &amp;mdash; the file is not where the document expects it. It will tell you a link is &lt;strong&gt;out of date&lt;/strong&gt; &amp;mdash; the file changed since it was placed. Both get a badge in the Links panel, and both are picked up by the default preflight profile.&lt;/p&gt;

&lt;p&gt;There is a third situation it does not treat as a problem: the link resolves perfectly, and its source file lives somewhere that only exists on your machine. A different folder. A different drive. Someone&apos;s Desktop.&lt;/p&gt;

&lt;p&gt;This is not a third link status, and InDesign is not wrong to omit it. The link genuinely is fine. Missing and out-of-date are observations about the file as it is right now. An external source is a different kind of fact &amp;mdash; a dependency on a location that may or may not exist on the other side of a handoff. That is a property of the workflow, not of the link, which is why no badge covers it.&lt;/p&gt;

&lt;figure class=&quot;diagram&quot;&gt;&lt;img src=&quot;/images/2026/08/indesign-will-not-warn-you-about/diagram-01.svg&quot; alt=&quot;A linked file inside the Links folder is local, while a file elsewhere is external even when it is inside the same project folder.&quot; width=&quot;1600&quot; height=&quot;900&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;

&lt;h2&gt;What &quot;External&quot; Means Here&lt;/h2&gt;

&lt;p&gt;Worth pinning down, because everything below depends on it.&lt;/p&gt;

&lt;p&gt;LinkSafe uses one deliberately strict rule: the canonical home for a linked file is the &lt;code&gt;Links&lt;/code&gt; folder beside the INDD. Anything outside that folder is reported as external &amp;mdash; &lt;em&gt;including&lt;/em&gt; files elsewhere inside the same project folder, which would travel with the document perfectly well.&lt;/p&gt;

&lt;p&gt;That is a workflow policy, not an InDesign category. If your shop keeps assets in &lt;code&gt;Photos/&lt;/code&gt; and &lt;code&gt;Logos/&lt;/code&gt; next to the document and always moves the whole tree, those links are fine in practice and LinkSafe will still list them. The strictness is the point: one canonical place means one test, with nothing to configure per project and nothing to get wrong.&lt;/p&gt;

&lt;h2&gt;The Panel Shows You a Name, Not a Relationship&lt;/h2&gt;

&lt;p&gt;It would be wrong to say the path is hidden. Open the Links panel menu, choose &lt;strong&gt;Panel Options&lt;/strong&gt;, and you can switch on &lt;code&gt;Folder 0&lt;/code&gt;, &lt;code&gt;Folder 1&lt;/code&gt;, &lt;code&gt;Folder 2&lt;/code&gt; &amp;mdash; the enclosing folder and its parents &amp;mdash; as columns. Select a link and &lt;strong&gt;Link Info&lt;/strong&gt; shows the full path.&lt;/p&gt;

&lt;p&gt;So the information is there. What is not there is the comparison.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Folder 0&lt;/code&gt; tells you a link sits in a folder called &lt;code&gt;Images&lt;/code&gt;. It does not tell you &lt;em&gt;which&lt;/em&gt; &lt;code&gt;Images&lt;/code&gt; &amp;mdash; the one beside this document, or the one on the shared drive, or the one in last year&apos;s job folder. Two links showing an identical folder name can point at completely different places. The panel gives you a label; what decides the outcome is a relationship between two paths, and there is no column for a relationship.&lt;/p&gt;

&lt;p&gt;That leaves reading full paths row by row. It is fine at six links and stops scaling quickly, because a clean result is only provable by exhaustion: there is no shortcut to establishing that none of the remaining rows point somewhere else.&lt;/p&gt;

&lt;p&gt;Meanwhile the state accumulates through ordinary work &amp;mdash; duplicating last year&apos;s layout, reusing a logo from a shared folder, placing an image straight out of a client&apos;s download folder, opening a document built on a machine with different drive letters. Each one leaves a link pointing somewhere a handoff will not carry.&lt;/p&gt;

&lt;h2&gt;Package Fixes the Handoff, Not the Working Document&lt;/h2&gt;

&lt;p&gt;The obvious objection is that InDesign already covers this. &lt;strong&gt;File &amp;gt; Package&lt;/strong&gt; copies linked graphics into a &lt;code&gt;Links&lt;/code&gt; folder and, with &lt;em&gt;Update Graphic Links in Package&lt;/em&gt; enabled, repoints the links at those copies. That is true, and for a handoff it is the right tool &amp;mdash; done properly it prevents exactly the failure this post opens with.&lt;/p&gt;

&lt;p&gt;The distinction is narrower than &quot;Package is not enough,&quot; and it is worth stating exactly: &lt;strong&gt;Package makes a portable copy. It does not change the dependency structure of the document you keep working in.&lt;/strong&gt; The links that get repointed belong to the copy inside the package folder. Your working file still points wherever it pointed before.&lt;/p&gt;

&lt;p&gt;If production continues from the packaged copy, that is a complete answer and there is nothing left to do. If production continues from the original &amp;mdash; the common case, since the original is what sits in the job folder and carries the edit history &amp;mdash; then the underlying condition is untouched, and every future handoff depends on remembering to package correctly again.&lt;/p&gt;

&lt;p&gt;Consolidating in place is the other operation. It changes the working document so that its eligible links resolve from the canonical &lt;code&gt;Links&lt;/code&gt; folder beside the INDD. Packaging is still the right way to hand off afterward; by then the links are already consolidated.&lt;/p&gt;

&lt;h2&gt;This Is a Low Judgment Check&lt;/h2&gt;

&lt;p&gt;Once the canonical location is fixed by policy, deciding whether a given link satisfies it takes no judgment at all. At the scripting level it reduces to a deterministic path-containment test &amp;mdash; after both paths are normalized, which is the part that is less trivial than it sounds: separators, trailing separators, and whether the volume is case-sensitive, which LinkSafe probes at run time rather than inferring from the operating system&apos;s name.&lt;/p&gt;

&lt;p&gt;Objective detection, predictable action: that is the combination I have written about before as &lt;a href=&quot;https://www.linguist-coder.com/2026/04/scaling-multilingual-dtp-by-detecting.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;low judgment work&lt;/a&gt;, and it is the category that is safe to automate first. There is a second reason to hand it over, which only shows up later. Done by hand, the result exists in someone&apos;s head and there is nothing to point at afterward. Done by tool, the result is a file &amp;mdash; and a file can be attached to a handoff, filed with the job, or read six months later when someone asks what happened.&lt;/p&gt;

&lt;h2&gt;Consolidation Is Four Operations, Not One&lt;/h2&gt;

&lt;p&gt;&quot;Collect the links&quot; sounds like one action &amp;mdash; copy the files. It is four, and skipping any of them is where consolidation scripts usually go wrong.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Copy&lt;/strong&gt; every eligible external file into the &lt;code&gt;Links&lt;/code&gt; folder beside the document. Eligible carries weight: an embedded graphic has no external source to copy, because it is already stored inside the document; a missing file cannot be copied at all; a file already in the folder does not need to be. Three different reasons, and each should be recorded rather than silently skipped.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Relink&lt;/strong&gt; the document to the copies. This is the step that changes the document, and the only one that does.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Verify&lt;/strong&gt; each relink after making it. Not assume &amp;mdash; read the link back and check both its status and its resolved path against the copy you intended. A relink that reports success and does not land is worse than no relink at all, because now the document &lt;em&gt;looks&lt;/em&gt; consolidated.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Log&lt;/strong&gt; the run. What moved, what did not, and why.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Name conflicts deserve their own note. Two different images called &lt;code&gt;logo.eps&lt;/code&gt; from two different folders will collide in one flat folder. Blind overwrite is the unsafe answer: it leaves a file that still opens, still shows an image, and shows the wrong one. Several responses are defensible &amp;mdash; preserve the source hierarchy, abort on collision, ask. LinkSafe renames the incoming copy (&lt;code&gt;logo.eps&lt;/code&gt;, &lt;code&gt;logo_2.eps&lt;/code&gt;) and never overwrites what is already there.&lt;/p&gt;

&lt;h2&gt;The Script&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;LinkSafe&lt;/strong&gt; is an InDesign script that does the above. It has one mode that changes the document and three that only read it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Collect &amp;amp; Relink&lt;/strong&gt; &amp;mdash; copy, relink, verify, log. The run is wrapped as a single InDesign undo transaction, so one Ctrl/Cmd+Z reverts every relink together.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;External Links Report&lt;/strong&gt; &amp;mdash; a CSV of every link whose source sits outside the &lt;code&gt;Links&lt;/code&gt; folder beside the document, with its path and a reason code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Missing Links Report&lt;/strong&gt; &amp;mdash; a CSV of everything that is gone, keeping the recorded path so you know what to restore.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;All Links Inventory&lt;/strong&gt; &amp;mdash; one row per link with its status: local, external, embedded, missing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The three report modes do not touch the document. That separation is deliberate: on a file you did not build, you want to look before you change anything.&lt;/p&gt;

&lt;p&gt;Worth knowing before leaning on it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Undo covers the relinking, not the copying.&lt;/strong&gt; The relinks revert in one step because the run is wrapped as one transaction. The copied files stay on disk &amp;mdash; a filesystem operation is not something Undo can reach &amp;mdash; and nothing already in the folder is overwritten. Delete the unused copies manually once you are satisfied with the document.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It does not collect fonts.&lt;/strong&gt; Package does. Consolidating links is not a replacement for packaging; it removes one class of failure from it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It does not reconstruct missing sources.&lt;/strong&gt; If a recorded path no longer resolves, LinkSafe can list it but not rebuild it. Recovering the file from a backup, an earlier package, or the machine it came from is outside what a script can do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It works on links, whatever they point at.&lt;/strong&gt; Everything in the Links panel is in scope &amp;mdash; graphics, placed INDD files, linked text &amp;mdash; because the rule is about where a source file lives, not what kind of file it is. What it does not do is recurse: a placed INDD is copied and relinked as a file, but the links &lt;em&gt;inside&lt;/em&gt; that document remain that document&apos;s own problem. Fonts and color settings are not links at all, and are separate concerns with separate failure modes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Full walkthrough here: &lt;a href=&quot;https://youtu.be/Ccm4zA4w6dw&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://youtu.be/Ccm4zA4w6dw&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;LinkSafe is on aescripts, with a free trial: &lt;a href=&quot;https://aescripts.com/linksafe/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://aescripts.com/linksafe/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_18.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Language-Based Image Relinking in InDesign&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/04/scaling-multilingual-dtp-by-detecting.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Detecting Objects Outside the Layout (Low Judgment Workflows)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>

  <entry>
    <title>Your First InDesign Script: Which Pages Have Overset Text?</title>
    <id>https://www.linguist-coder.com/2026/07/your-first-indesign-script-which-pages.html</id>
    <link href="https://www.linguist-coder.com/2026/07/your-first-indesign-script-which-pages.html"/>
    <published>2026-07-29T00:18:19.631Z</published>
    <updated>2026-07-29T00:33:28.831Z</updated>
    <summary>Most InDesign scripting tutorials open with a finished script. This one opens a step earlier: with the smallest useful thing a script can do, and with the decision of what to leave out of it. The goal is one dialog…</summary>
    <content type="html">&lt;p&gt;Most InDesign scripting tutorials open with a finished script. This one opens a step earlier: with the smallest useful thing a script can do, and with the decision of what to leave out of it.&lt;/p&gt;

&lt;p&gt;The goal is one dialog that tells you which pages of the open document contain overset text. To be precise about what that means, since precision is most of the point here: it checks the text frames that belong directly to each page, and nothing else. It is not a complete document-wide audit. It will not mark anything, it will not fix anything, and it will not write a log file. Those are not missing features. They are the boundary I drew before writing the first line.&lt;/p&gt;

&lt;p&gt;If you already write ExtendScript, you may want &lt;a href=&quot;https://www.linguist-coder.com/2026/02/detecting-text-overset-in-indesign.html&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;the production-shaped version I published earlier&lt;/a&gt; instead. This post is for the reader who has not yet run a script in InDesign at all.&lt;/p&gt;

&lt;h2&gt;The one property that does the work&lt;/h2&gt;

&lt;p&gt;Overset text is text that has nowhere to go. A story contains more than its available frames can display, and the surplus sits outside the layout, invisible. In a single frame it appears once the story exceeds what the frame can hold; in a threaded chain of frames it appears after the last frame in the chain. InDesign shows you this as a red plus sign in the frame&apos;s out port.&lt;/p&gt;

&lt;p&gt;InDesign already knows. You do not have to measure anything, compare anything, or compose anything. You only have to ask:&lt;/p&gt;

&lt;pre style=&quot;overflow: auto;&quot;&gt;&lt;code&gt;textFrame.overflows&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It returns &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Reading the property is the easy part. The work in this post is deciding which objects to ask, and how to report what comes back — which turns out to be where all the interesting decisions live.&lt;/p&gt;

&lt;h2&gt;Running a script at all&lt;/h2&gt;

&lt;p&gt;If you have never run one, here is the whole setup.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Scripts panel: &lt;strong&gt;Window &amp;gt; Utilities &amp;gt; Scripts&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Right-click the &lt;strong&gt;User&lt;/strong&gt; folder and choose &lt;strong&gt;Reveal in Explorer&lt;/strong&gt; (Windows) or &lt;strong&gt;Reveal in Finder&lt;/strong&gt; (macOS).&lt;/li&gt;
&lt;li&gt;Save a plain text file into that folder with a &lt;code&gt;.jsx&lt;/code&gt; extension.&lt;/li&gt;
&lt;li&gt;Back in the Scripts panel, double-click the file to run it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Two things to know before you type anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ExtendScript is an old dialect of JavaScript.&lt;/strong&gt; Roughly ES3. There is no &lt;code&gt;let&lt;/code&gt;, no &lt;code&gt;const&lt;/code&gt;, no arrow functions, and no &lt;code&gt;Array.prototype.forEach&lt;/code&gt;. You write &lt;code&gt;var&lt;/code&gt; and you write &lt;code&gt;for&lt;/code&gt; loops. Code copied from a modern JavaScript tutorial will often fail here for reasons that have nothing to do with InDesign.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Save it as plain text, and watch two separate things.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first is your quotes. Many editors, and every word processor, replace straight quotes (&lt;code&gt;&quot;&lt;/code&gt; and &lt;code&gt;&apos;&lt;/code&gt;) with typographic ones as you type. Those are different characters, and JavaScript will not accept them as string delimiters. If you paste code from a web page and get a syntax error on a line that looks perfectly correct, this is usually why.&lt;/p&gt;

&lt;p&gt;The second is the file&apos;s encoding. Save as UTF-8, and confirm your editor is actually writing UTF-8 rather than quietly using something else. Older ExtendScript environments can behave inconsistently when a script contains non-ASCII characters, sometimes reporting a syntax error on a line that has nothing wrong with it. Keeping comments in ASCII avoids that particular source of trouble. If you want Japanese or accented text in your dialogs, that is fine — just be deliberate about how the file gets saved.&lt;/p&gt;

&lt;h2&gt;Step 1: ask one frame&lt;/h2&gt;

&lt;p&gt;Select a text frame on the page, then run this:&lt;/p&gt;

&lt;pre style=&quot;overflow: auto;&quot;&gt;&lt;code&gt;(function () {
    alert(app.selection[0].overflows);
})();&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You get a dialog saying &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;. That is the entire mechanism.&lt;/p&gt;

&lt;p&gt;The wrapper is worth explaining. &lt;code&gt;(function () { ... })();&lt;/code&gt; defines a function and calls it immediately. Anything you declare with &lt;code&gt;var&lt;/code&gt; at the top level of a script goes onto the global object, which is shared by everything running in the same ExtendScript engine — and whether those leftovers outlive your script depends on which engine InDesign used to run it. The wrapper means you never have to know. Your variables stay yours, and the script becomes a self-contained unit you can drop into a larger one later without renaming anything.&lt;/p&gt;

&lt;p&gt;This version breaks if nothing is selected, or if you selected a rectangle instead of a text frame. That is fine. It exists to prove the property works, and then it goes away.&lt;/p&gt;

&lt;h2&gt;Step 2: ask every page&lt;/h2&gt;

&lt;p&gt;The obvious next move is two loops: every page, and every text frame on that page.&lt;/p&gt;

&lt;pre style=&quot;overflow: auto;&quot;&gt;&lt;code&gt;var doc = app.activeDocument;

for (var i = 0; i &amp;lt; doc.pages.length; i++) {
    var frames = doc.pages[i].textFrames;

    for (var j = 0; j &amp;lt; frames.length; j++) {
        if (frames[j].overflows) {
            alert(&quot;Overset on page &quot; + doc.pages[i].name);
        }
    }
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This works, and it is unusable. A document with thirty overset frames gives you thirty dialogs, each one waiting for a click. The script is correct and the experience is wrong, which is a distinction worth learning early.&lt;/p&gt;

&lt;p&gt;The fix is to separate finding from reporting. Collect everything first, then say it once.&lt;/p&gt;

&lt;p&gt;Note also &lt;code&gt;doc.pages[i].name&lt;/code&gt; rather than &lt;code&gt;i + 1&lt;/code&gt;. If the document uses sections — front matter in roman numerals, a chapter that restarts at 1 — then &lt;code&gt;i + 1&lt;/code&gt; gives you a number that appears nowhere in the page box, and you will go looking for page 7 and not find it. &lt;code&gt;page.name&lt;/code&gt; is the label you actually see in the Pages panel.&lt;/p&gt;

&lt;p&gt;The tradeoff is that page names are not guaranteed to be unique. In a document where every chapter restarts at 1, a result of &lt;code&gt;1, 1, 3&lt;/code&gt; is entirely possible and tells you less than you want. For most documents this never comes up; when it does, you have outgrown this script.&lt;/p&gt;

&lt;h2&gt;The script&lt;/h2&gt;

&lt;pre style=&quot;overflow: auto;&quot;&gt;&lt;code&gt;// Reports which pages contain an overset text frame.
(function () {
    if (app.documents.length === 0) {
        alert(&quot;Open a document first.&quot;);
        return;
    }

    var doc = app.activeDocument;
    var hits = [];

    for (var i = 0; i &amp;lt; doc.pages.length; i++) {
        var page = doc.pages[i];
        var frames = page.textFrames;

        for (var j = 0; j &amp;lt; frames.length; j++) {
            if (frames[j].overflows) {
                hits.push(page.name);   // page.name respects section numbering
                break;                  // one report per page is enough
            }
        }
    }

    if (hits.length === 0) {
        alert(&quot;No overset text frames found.&quot;);
    } else {
        alert(&quot;Overset text on page(s): &quot; + hits.join(&quot;, &quot;));
    }
})();&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Two lines are worth pointing at.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;break&lt;/code&gt; stops scanning a page as soon as one overset frame turns up. You already know the answer for that page, and the question is which pages to look at, not how many frames are involved. It also means each page object is added to the list at most once, without any deduplication logic.&lt;/p&gt;

&lt;p&gt;The guard at the top costs three lines and removes an entire class of confusing failure. &lt;code&gt;app.activeDocument&lt;/code&gt; throws when nothing is open, and the resulting error dialog says nothing useful to someone who has run four scripts in their life.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/07/your-first-indesign-script-which-pages/01.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Running an overset detection script from the Scripts panel on a test document with overset text on pages 4 and 5&quot; border=&quot;0&quot; data-original-height=&quot;945&quot; data-original-width=&quot;1427&quot; height=&quot;212&quot; src=&quot;/images/2026/07/your-first-indesign-script-which-pages/01.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;

&lt;h2&gt;What I left out, on purpose&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;It reports pages, not frames.&lt;/strong&gt; The question this script answers is &quot;where do I need to look.&quot; A page number answers that. A frame identifier would need coordinates or labels to mean anything, and then I would be building a different tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It shows a dialog, not a log file.&lt;/strong&gt; A file needs a path, a format, a write permission, and a story about what happens to it next week. A dialog needs none of those. Every one of them is a decision I did not have to make. The ceiling is real, though: a document with sixty overset pages produces a dialog you cannot comfortably read or copy out of. That is the point at which writing to a file, or building a scrollable window, stops being optional.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It does not fix anything.&lt;/strong&gt; This is the limit I would defend hardest. Detection and correction fail differently, and at different prices. A detection that fires when it should not costs you a look. A detection that stays quiet when it should not — the failure mode every exclusion in the next section produces — leaves overset text sitting in the file. A correction that goes wrong changes the layout itself. Keeping detection and correction in separate scripts is what lets you weigh those three risks one at a time instead of all at once.&lt;/p&gt;

&lt;p&gt;Small scope is not a stage you pass through on the way to a real script. It is the thing that lets a short script be finished.&lt;/p&gt;

&lt;h2&gt;Where the script stops seeing&lt;/h2&gt;

&lt;p&gt;Being honest about the edges is part of the design, so here is what this one does not catch.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Frames inside a group.&lt;/strong&gt; &lt;code&gt;page.textFrames&lt;/code&gt; returns the frames the page owns directly. A frame nested in a group is owned by the group.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Anchored frames.&lt;/strong&gt; A text frame anchored into another story lives in that story, not on the page, for the same reason.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Frames on the pasteboard.&lt;/strong&gt; They belong to the spread rather than to any page, so the page loop never reaches them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Frames on parent pages that have not been overridden.&lt;/strong&gt; Parent pages — still called master spreads in the scripting DOM — are a separate collection.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Overset inside a table cell.&lt;/strong&gt; The cell hides the surplus text without the containing frame reporting &lt;code&gt;overflows&lt;/code&gt; at all. Cells carry their own &lt;code&gt;overflows&lt;/code&gt; property, so a fuller version has to walk tables separately.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Threads.&lt;/strong&gt; In a chain of linked frames, normally only the last one returns &lt;code&gt;true&lt;/code&gt;. You learn the page where the text ran out, not the page where the pressure started.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are deliberate exclusions, not oversights — but they turn into defects the moment the script gets described as a complete overset audit, which is why I put the scope in the first paragraph rather than here. A script that answers one question cleanly and a tool that covers a workflow are different objects, and most of the frustration in scripting comes from expecting one to behave like the other.&lt;/p&gt;

&lt;p&gt;If you want the version that walks the whole document, parent pages included, and marks what it finds directly on the page, that is the &lt;a href=&quot;https://www.linguist-coder.com/2026/02/detecting-text-overset-in-indesign.html&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;earlier post&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Next&lt;/h2&gt;

&lt;p&gt;Finding overset is the easy half. In Part 2, I take the most obvious way to fix it — condensing the type horizontally until the text fits — write that script with the same discipline about limits, and then look at exactly where the approach stops working.&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>When InDesign Fails to Export: Start by Finding the Broken Page</title>
    <id>https://www.linguist-coder.com/2026/07/when-indesign-fails-to-export-start-by.html</id>
    <link href="https://www.linguist-coder.com/2026/07/when-indesign-fails-to-export-start-by.html"/>
    <published>2026-07-14T23:06:19.585Z</published>
    <updated>2026-09-18T23:11:04.509Z</updated>
    <summary>InDesign export failures can be difficult to diagnose. A document may open normally, but fail when you try to export it as a PDF. The file may hang partway through, crash the application, or produce an incomplete PDF with no…</summary>
    <content type="html">&lt;!--Blogger: switch the post editor to &quot;HTML view&quot; and paste everything below.--&gt;
&lt;!--Put the post title in Blogger&apos;s Title field: Finding the Page That Breaks an InDesign PDF Export--&gt;

&lt;style&gt;
.idx-post { line-height: 1.7; }
.idx-post h2 { margin-top: 1.8em; margin-bottom: 0.5em; }
.idx-post p, .idx-post ul, .idx-post ol { margin: 0.8em 0; }
.idx-post li { margin: 0.35em 0; }
.idx-post pre {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  line-height: 1.5;
}
.idx-post pre code { font-size: 0.9em; }
.idx-post code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.idx-post :not(pre) &gt; code {
  background: #f0f0f0;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}
&lt;/style&gt;

&lt;div class=&quot;idx-post&quot;&gt;

&lt;p&gt;InDesign export failures can be difficult to diagnose. A document may open normally, but fail when you try to export it as a PDF. The file may hang partway through, crash the application, or produce an incomplete PDF with no clear error message.&lt;/p&gt;

&lt;p&gt;When this happens, the first problem is often not fixing the file. The first problem is finding where the failure starts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A note on scope.&lt;/strong&gt; This article is about one specific situation: a &lt;em&gt;PDF (or print) export&lt;/em&gt; that fails in a way you can reproduce with a specific page range. That scope matters, because the core technique below — testing page ranges — only works for outputs that accept a page range. IDML export and ordinary &quot;Save As&quot; failures do not; there is no &quot;export only pages 1–150 to IDML.&quot; Those require a different isolation method based on duplicating the document and removing pages or content, which I touch on at the end but do not cover in depth here.&lt;/p&gt;

&lt;p&gt;A damaged InDesign document can fail for many reasons: a corrupted object, a broken placed file, a font issue, a complex table, an anchored object, a parent-page item, threaded text, transparency settings, or internal document corruption. Trying to repair everything at once is rarely efficient. A better first step is to narrow the search area.&lt;/p&gt;

&lt;h2&gt;Why diagnosis should come before repair&lt;/h2&gt;

&lt;p&gt;When an export fails, it is tempting to start deleting objects, replacing links, changing fonts, or exporting to IDML immediately. Sometimes that works. But it also changes the document before you understand the problem, which can make troubleshooting harder. You may spend time on pages unrelated to the failure, or apply a repair that appears to work temporarily without addressing the cause.&lt;/p&gt;

&lt;p&gt;Before repairing the file, it is usually better to answer two smaller questions in order:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Is this actually a page-local &lt;em&gt;content&lt;/em&gt; problem at all?&lt;/li&gt;
  &lt;li&gt;If so, which page should I inspect first?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first question is the one most people skip — so let&apos;s start there.&lt;/p&gt;

&lt;h2&gt;First, rule out the environment&lt;/h2&gt;

&lt;p&gt;Before you bisect a 300-page document, confirm that the failure is caused by the document&apos;s content and not by something around it. A PDF export can fail for reasons that have nothing to do with any page:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;the output folder&apos;s permissions, or a network / cloud-sync destination&lt;/li&gt;
  &lt;li&gt;low disk space&lt;/li&gt;
  &lt;li&gt;corrupt InDesign preferences&lt;/li&gt;
  &lt;li&gt;a third-party plugin&lt;/li&gt;
  &lt;li&gt;one specific PDF preset&lt;/li&gt;
  &lt;li&gt;memory pressure on large jobs&lt;/li&gt;
  &lt;li&gt;a problem with the InDesign install itself&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If one of these is the real cause, page bisection may never converge — or worse, converge on a misleading suspect range. So run a short gate first:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Reproduce on a copy.&lt;/strong&gt; Duplicate the &lt;code&gt;.indd&lt;/code&gt; and confirm the failure still happens. Work on the copy from here on.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Export to a plain local folder.&lt;/strong&gt; If it now succeeds, the problem was the destination, not the document.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Test the preset in isolation.&lt;/strong&gt; Create a new one-page document and export it with the &lt;em&gt;same&lt;/em&gt; preset. If that fails too, suspect the preset or the environment, not your file.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Try a known-good preset.&lt;/strong&gt; If your file exports fine under a different preset, you&apos;ve narrowed it to preset-specific handling (fonts, transparency, color conversion, compression).&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Classify the failure.&lt;/strong&gt; Is it a clean error dialog, a hang, a crash, or a silently incomplete PDF? These are different problems, and you&apos;ll treat them differently below.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Test the same range twice.&lt;/strong&gt; If the same export sometimes passes and sometimes fails, the failure is non-deterministic — and, as you&apos;ll see, bisection cannot be trusted in that case.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only once the failure survives this gate — reproducible, document-specific, deterministic — is page-range bisection the right tool.&lt;/p&gt;

&lt;h2&gt;Common causes, once it &lt;em&gt;is&lt;/em&gt; the document&lt;/h2&gt;

&lt;p&gt;When the cause is inside the file, it is often hidden. The page can look normal, and the error message rarely names the responsible object. Candidates include:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;corrupted page items&lt;/li&gt;
  &lt;li&gt;missing or damaged linked images&lt;/li&gt;
  &lt;li&gt;damaged placed PDF, AI, or EPS files&lt;/li&gt;
  &lt;li&gt;font problems&lt;/li&gt;
  &lt;li&gt;complex tables&lt;/li&gt;
  &lt;li&gt;anchored objects&lt;/li&gt;
  &lt;li&gt;parent-page (formerly &quot;master page&quot;) items&lt;/li&gt;
  &lt;li&gt;threaded-text problems&lt;/li&gt;
  &lt;li&gt;transparency or effect settings&lt;/li&gt;
  &lt;li&gt;internal document history or file corruption&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One item deserves a caveat: &lt;strong&gt;overset text&lt;/strong&gt; is frequently blamed, but it usually causes &lt;em&gt;missing output&lt;/em&gt; rather than a halted export. Keep &quot;the export failed&quot; and &quot;the output is incomplete&quot; as separate problems; they don&apos;t always have the same cause.&lt;/p&gt;

&lt;h2&gt;Why a script can&apos;t do this whole job unattended&lt;/h2&gt;

&lt;p&gt;If you write InDesign automation, your instinct here is probably to script it: loop through the pages, export each one, catch the error on the bad page, write a report. It&apos;s worth being precise about what a script can and cannot do, because the honest answer is &lt;em&gt;both&lt;/em&gt;, depending on how the export fails.&lt;/p&gt;

&lt;p&gt;InDesign export failures don&apos;t share one failure mode:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;A catchable scripting exception.&lt;/strong&gt; &lt;code&gt;exportFile()&lt;/code&gt; throws, control returns to your script, &lt;code&gt;try/catch&lt;/code&gt; works, and you can log the result. A script handles this case fine.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;An asynchronous failure.&lt;/strong&gt; &lt;code&gt;asynchronousExportFile()&lt;/code&gt; returns a background task and reports problems later, decoupled from the calling &lt;code&gt;try/catch&lt;/code&gt;. The error may surface well after the line that started it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;A hang.&lt;/strong&gt; The InDesign process is still alive but unresponsive. Your script is stuck inside the same process and never returns.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;A hard crash.&lt;/strong&gt; The native InDesign process terminates rather than raising a catchable exception, taking your script down with it before it can log anything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For diagnosis, it helps to take the asynchronous path off the table — and how you do that differs for manual tests versus scripts. For manual &lt;strong&gt;File &amp;gt; Export&lt;/strong&gt; tests, you can disable desktop background PDF export: quit InDesign, place an empty file named &lt;code&gt;DisableAsyncExports.txt&lt;/code&gt; in the application folder (on macOS, inside the app&apos;s &lt;code&gt;Contents/MacOS/&lt;/code&gt;; on Windows, the InDesign program folder, which usually needs administrator rights), then relaunch. PDF export will then run in the &lt;em&gt;foreground&lt;/em&gt; and block the InDesign UI until it finishes. In a script, there&apos;s no file to place — the choice is explicit: &lt;code&gt;exportFile()&lt;/code&gt; for a synchronous call, &lt;code&gt;asynchronousExportFile()&lt;/code&gt; for a background task.&lt;/p&gt;

&lt;p&gt;Either way, a foreground/synchronous export ties any &lt;em&gt;catchable&lt;/em&gt; error directly to the export attempt, instead of it being reported later by a background-task alert — easier to observe, time, and trap. (A hang or hard crash can still prevent control from returning; running in the foreground only helps with the errors that are catchable in the first place.)&lt;/p&gt;

&lt;p&gt;The hang and the hard crash are the two that break the &quot;just script it&quot; plan. When the host process hangs or dies, an in-process script cannot record a post-export result or continue to the next page. In a hang, the script never regains control; in a crash, the process and the script terminate outright. Either way, nothing gets logged after the fact.&lt;/p&gt;

&lt;p&gt;But notice the limit precisely, because it is narrower than &quot;scripting is useless here.&quot; A script &lt;em&gt;can&lt;/em&gt; still write the range it is &lt;strong&gt;about to&lt;/strong&gt; test and persist that line to disk &lt;strong&gt;before&lt;/strong&gt; starting the export. What it cannot do is complete an unattended full sweep in a single process: after a crash it needs to be relaunched and resumed. So the honest framing is not &quot;manual instead of script.&quot; It&apos;s: &lt;strong&gt;an in-process script can preserve state, but it cannot recover and continue on its own.&lt;/strong&gt; The dependable, low-effort method for that recovery loop is your own hands.&lt;/p&gt;

&lt;h2&gt;The manual method: page-range bisection&lt;/h2&gt;

&lt;p&gt;The most dependable approach is to divide the document into smaller page ranges and test them by hand. Because you are the one clicking Export, a crash costs you a relaunch — not your entire record.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A precondition first.&lt;/strong&gt; Bisection is reliable only when two things hold: the failure is &lt;em&gt;reproducible&lt;/em&gt;, and there is at least one &lt;em&gt;local, independent&lt;/em&gt; trigger — a page or contiguous range that still fails when it is tested inside one of the two halves on its own. (&quot;Local&quot; here means it can be reproduced within a sub-range by itself, not merely that it&apos;s &quot;visible on the same page.&quot;) There can be more than one such trigger, which is why removing one may not make every other range pass. As long as at least one local trigger holds, the search is efficient:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Export the whole document (you did this in the gate above).&lt;/li&gt;
  &lt;li&gt;If it fails, export only the first half.&lt;/li&gt;
  &lt;li&gt;If the first half succeeds, a trigger is in the second half — split &lt;em&gt;that&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;If the first half fails, split &lt;em&gt;it&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;Repeat until the failing range is a single page or spread.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure style=&quot;margin: 1.6em 0px; text-align: center;&quot;&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/07/when-indesign-fails-to-export-start-by/01.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Page-range bisection: pages 1-100 fail, 1-50 pass, 51-100 fail, 51-75 pass, 76-100 fail&quot; data-original-height=&quot;941&quot; data-original-width=&quot;1672&quot; height=&quot;180&quot; src=&quot;/images/2026/07/when-indesign-fails-to-export-start-by/01.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
  &lt;figcaption style=&quot;color: #666666; font-size: 0.9em; margin-top: 0.5em;&quot;&gt;Page-range bisection: follow the failing half down, splitting each time, until one suspect page is left.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Each test roughly halves the search area, so a 300-page document usually collapses to one suspect page in about nine splits (plus the initial full-document test).&lt;/p&gt;

&lt;p&gt;That locality assumption is exactly what breaks in the hard cases, so watch for these — where bisection can point at the wrong range, or at no range at all:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;the export fails only when two specific pages are &lt;strong&gt;both&lt;/strong&gt; present (an interaction — a cross-reference or shared resource — so neither half fails on its own)&lt;/li&gt;
  &lt;li&gt;the failure depends on &lt;strong&gt;total load&lt;/strong&gt;: memory exhaustion that only appears on large ranges, or accumulates across many sequential exports&lt;/li&gt;
  &lt;li&gt;results &lt;strong&gt;vary&lt;/strong&gt; between runs (a non-deterministic failure)&lt;/li&gt;
  &lt;li&gt;the tested pages depend on &lt;strong&gt;adjacent-page or document-wide state&lt;/strong&gt; — parent-page items, threaded stories, shared swatches, cross-references&lt;/li&gt;
  &lt;li&gt;the &lt;strong&gt;whole&lt;/strong&gt; document fails but neither half does — the trigger is not independently page-local; it may be document-level state, a cross-range interaction, or total workload&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One case looks like a breakage but isn&apos;t: &lt;strong&gt;multiple independent bad pages.&lt;/strong&gt; Bisection still finds one of them just fine — the catch is that fixing that page won&apos;t fix the document, because another remains. That&apos;s exactly why the last habit below matters.&lt;/p&gt;

&lt;p&gt;A few habits keep the manual search reliable:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Record every range and its result&lt;/strong&gt; in a two-column note. After a crash forces a relaunch, this note is the only thing stopping you from repeating tests.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Fix one preset for the whole session&lt;/strong&gt; — the one you actually need — and note which it was.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Test spreads, not single pages, for spread-based layouts.&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Relaunch cleanly after a crash&lt;/strong&gt; and reopen the copy fresh before the next test.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;After isolating one page, re-test the whole document with that page removed&lt;/strong&gt; to check for a &lt;em&gt;second&lt;/em&gt; bad page.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Record your intent before each risky export&lt;/h2&gt;

&lt;p&gt;There is one place where a little automation helps, and it does not contradict anything above — because it does its work &lt;em&gt;before&lt;/em&gt; the export, not after.&lt;/p&gt;

&lt;p&gt;Keep a log, and write the next line &lt;strong&gt;and save it to disk&lt;/strong&gt; immediately before each export attempt. The key word is &lt;em&gt;save&lt;/em&gt;: an unsaved editor buffer is not durable against an editor crash, a system crash, or power loss (an InDesign-only crash usually spares an external editor, but don&apos;t count on it). Use a log format that distinguishes states rather than just &quot;OK/Failed&quot;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;STARTED    range=151-300
COMPLETED  range=151-300  output=exists, pages=150, opens=yes
FAILED     range=151-300  error=&amp;lt;message&amp;gt;
TIMEOUT    range=151-300&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If InDesign crashes, the log&apos;s last line will be a &lt;code&gt;STARTED&lt;/code&gt; with no matching &lt;code&gt;COMPLETED&lt;/code&gt;. That tells you which range was being attempted when it stopped — a strong &lt;em&gt;suspect&lt;/em&gt;, not a proven cause. Two refinements matter:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A &lt;code&gt;STARTED&lt;/code&gt;-only entry means only that no completion was recorded for that attempt. The cause could be a crash, a hang followed by a forced quit, a system interruption, or even a logging failure — so treat it as a candidate, not a verdict.&lt;/li&gt;
  &lt;li&gt;Beware the success-then-crash case: if the PDF finished but InDesign crashed before writing &lt;code&gt;COMPLETED&lt;/code&gt;, the range looks failed but isn&apos;t. Check whether the PDF exists, has a plausible size, opens, and has the expected page count — that distinguishes a finished export from an interrupted one, though it still doesn&apos;t prove every page rendered correctly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can maintain this log by hand or with a tiny helper that only appends-and-flushes a line (that part never touches the failing export, so it&apos;s safe either way).&lt;/p&gt;

&lt;h2&gt;If you want to push it further: an external driver&lt;/h2&gt;

&lt;p&gt;To actually &lt;em&gt;recover and continue&lt;/em&gt; across crashes without you at the keyboard, the automation has to live &lt;strong&gt;outside&lt;/strong&gt; InDesign, so it survives the crash. This is a real option, but it is considerably more work than the manual loop, and worth doing only if you hit these failures often.&lt;/p&gt;

&lt;p&gt;On Windows, InDesign exposes a COM automation interface onto substantially the same scripting object model the JavaScript engine uses, with language-specific mappings — so an external Python process (via &lt;code&gt;win32com&lt;/code&gt;, &lt;code&gt;Dispatch(&quot;InDesign.Application&quot;)&lt;/code&gt;) can drive it directly. On macOS, the equivalent path is AppleScript / Apple Events. (Note that you can&apos;t simply drop a &lt;code&gt;.py&lt;/code&gt; file in the Scripts panel; Python isn&apos;t a natively supported in-panel language, so it drives InDesign through that external COM/AppleScript layer.)&lt;/p&gt;

&lt;p&gt;A production-grade driver needs more than a liveness check, because &lt;strong&gt;a hang is not a crash&lt;/strong&gt;: the process stays alive but never returns, so &quot;is InDesign still running?&quot; won&apos;t detect it. At minimum it needs to handle launch-completion detection, modal/recovery dialogs, a per-range timeout, output-file validation (exists, size, page count, opens as a valid PDF), forced termination, relaunch, and a persisted state file so it can resume the sweep.&lt;/p&gt;

&lt;p&gt;For genuinely unattended, high-volume automation, the intended tool is &lt;strong&gt;InDesign Server&lt;/strong&gt;, the headless, UI-less product (commonly driven over SOAP). But it is a separate product and license, and it does not guarantee it will reproduce a desktop InDesign failure identically — so it&apos;s a scaling path, not a drop-in diagnostic for a single broken desktop file. (Note too that asynchronous export is a desktop-only feature; InDesign Server exports synchronously.)&lt;/p&gt;

&lt;h2&gt;After isolating the page: go object by object&lt;/h2&gt;

&lt;p&gt;Once you have a suspect page, keep bisecting — this time at the object level, and always on a &lt;strong&gt;duplicate of the original&lt;/strong&gt;. (Copying suspect objects into a &lt;em&gt;new&lt;/em&gt; document can silently regenerate their structure and &quot;heal&quot; the corruption, giving a false pass; deleting or hiding within a duplicate of the original preserves the problem.)&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Check the &lt;strong&gt;Links&lt;/strong&gt; panel on that page for missing or modified links.&lt;/li&gt;
  &lt;li&gt;Hide or delete &lt;strong&gt;half the objects&lt;/strong&gt; on the page, re-test, and narrow down — the same bisection idea, one level lower.&lt;/li&gt;
  &lt;li&gt;Temporarily swap placed &lt;strong&gt;PDF / AI / EPS&lt;/strong&gt; files for a low-res proxy or a known-good file.&lt;/li&gt;
  &lt;li&gt;Remove &lt;strong&gt;parent-page&lt;/strong&gt; items from the page and test.&lt;/li&gt;
  &lt;li&gt;Check &lt;strong&gt;bleed, slug, and pasteboard&lt;/strong&gt; items that print but are easy to overlook.&lt;/li&gt;
  &lt;li&gt;Inspect &lt;strong&gt;tables, anchored objects, and grouped objects&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Re-test with the &lt;strong&gt;same preset&lt;/strong&gt; after each change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is still investigative — but now the search area is one page, then a handful of objects, not a whole book.&lt;/p&gt;

&lt;h2&gt;What the result does and doesn&apos;t tell you&lt;/h2&gt;

&lt;p&gt;Isolating a page is useful, but interpret it carefully.&lt;/p&gt;

&lt;p&gt;A failing range is a strong candidate for inspection. A range that passed is &lt;em&gt;not&lt;/em&gt; proof the document is healthy. And even a single isolated page is a &lt;strong&gt;failure-triggering page&lt;/strong&gt;, not necessarily the root cause — the actual cause may be a parent page, a shared swatch, document structure, total export load, or an interaction with another page. Call it a &lt;em&gt;suspect page&lt;/em&gt; or &lt;em&gt;trigger range&lt;/em&gt;, and don&apos;t attribute the root cause to the page itself until you&apos;ve confirmed it at the object level.&lt;/p&gt;

&lt;p&gt;There&apos;s also a practical cost: for very large documents, many manual exports take time, and each crash means a relaunch. Bisection keeps the number of tests low, but budget for the relaunches.&lt;/p&gt;

&lt;h2&gt;Why this matters for scalable DTP workflows&lt;/h2&gt;

&lt;p&gt;In multilingual DTP and production work, file failures are usually handled as one-off emergencies. Someone investigates, tries a few repairs, finds a workaround — and the knowledge disappears when the job ships.&lt;/p&gt;

&lt;p&gt;A written diagnostic record changes that, even when the whole process was manual. But to be &lt;em&gt;reusable&lt;/em&gt;, the record needs more than &quot;page 3 failed.&quot; Capture:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;InDesign version and build, and the OS&lt;/li&gt;
  &lt;li&gt;output format and the exact preset name/settings&lt;/li&gt;
  &lt;li&gt;output destination (local vs network/sync)&lt;/li&gt;
  &lt;li&gt;failure classification: error, hang, crash, or incomplete PDF&lt;/li&gt;
  &lt;li&gt;reproducibility rate (always, or intermittently?)&lt;/li&gt;
  &lt;li&gt;the suspect range/page and, if found, the object&lt;/li&gt;
  &lt;li&gt;relevant link and font versions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do this a few times and patterns emerge — the same placed-file type, the same font, the same parent page. That&apos;s the beginning of a repeatable document-health practice, and it doesn&apos;t require a single line of working script.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;When InDesign fails to export a PDF, the most important first step is not always to fix the file. It&apos;s to rule out the environment, then narrow the document until only a suspect page — and then a suspect object — is left.&lt;/p&gt;

&lt;p&gt;The instinct to automate that is understandable, and partly right: a script can preserve state before each risky export. What it can&apos;t do is recover and continue on its own after the process hangs or dies, which is exactly what the hard failures do. So the dependable core is a manual bisection, backed by a log that records your intent &lt;em&gt;before&lt;/em&gt; each export and distinguishes a crash from a genuine failure.&lt;/p&gt;

&lt;p&gt;Good troubleshooting doesn&apos;t always fix the problem directly. Often the most valuable thing it does is shrink the search until there&apos;s only one page left to suspect — and make sure a crash can never erase the fact that you got that far.&lt;/p&gt;

&lt;/div&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-maintenance.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP – Maintenance / Recovery: When and How to Clean Up InDesign Files with IDML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/04/scaling-multilingual-dtp-by-detecting.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Detecting Objects Outside the Layout (Low Judgment Workflows)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/07/your-first-indesign-script-which-pages.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Your First InDesign Script: Which Pages Have Overset Text?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>

  <entry>
    <title>The Expensive Part of Multilingual DTP Isn&amp;apos;t Only the Translation</title>
    <id>https://www.linguist-coder.com/2026/07/the-expensive-part-of-multilingual-dtp.html</id>
    <link href="https://www.linguist-coder.com/2026/07/the-expensive-part-of-multilingual-dtp.html"/>
    <published>2026-07-08T04:05:06.982Z</published>
    <updated>2026-09-18T23:15:10.475Z</updated>
    <summary>A finished English layout existed in InDesign — a short quick-start guide, set cleanly, with a type hierarchy and a grid. It needed to exist in Japanese and German as well. The translations were already done. What remained was the…</summary>
    <content type="html">&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/7yk0JIccIT8&quot; width=&quot;320&quot; youtube-src-id=&quot;7yk0JIccIT8&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;A finished English layout existed in InDesign — a short quick-start guide, set cleanly, with a type hierarchy and a grid. It needed to exist in Japanese and German as well. The translations were already done. What remained was the part that actually takes the time: getting each language back into the layout.&amp;nbsp;&lt;/p&gt;&lt;p&gt;That last step is easy to underestimate. It sounds like typing, or pasting. In practice it is where multilingual production quietly goes wrong, and the reason is worth stating plainly.&lt;/p&gt;&lt;h2&gt;What Is Fixed, and What Varies&lt;/h2&gt;&lt;p&gt;A multilingual document has a fixed part and a variable part. The design — the frames, the styles, the master pages — is fixed. The language is the variable. The job is to hold the first constant while changing the second.&lt;/p&gt;&lt;p&gt;Done by hand, that distinction collapses. Each language becomes a fresh layout task: select the text, replace it, then re-check every frame by eye. The design that was supposed to stay constant is now being re-touched three times, five times, once per language — and every touch is a chance to move something that was meant to stay put.&lt;/p&gt;&lt;p&gt;So the useful question is the same one I keep returning to in production work: which part is the source, and which part is derived? Here the layout is the source. Each language is a rendering of it. The text content is the only thing that should change.&lt;/p&gt;&lt;h2&gt;Two Failures That Ship When You Reflow by Eye&lt;/h2&gt;&lt;p&gt;Translating is the easy part precisely because a translation is just different words. The trouble is that the different words have two other properties the layout cares about.&lt;/p&gt;&lt;p&gt;The first is &lt;b&gt;length&lt;/b&gt;. German runs longer than English — often much longer. The same sentence that fit a narrow column in English now overflows its frame. On screen the overflow is a small red &lt;b&gt;+&lt;/b&gt;; in a shipped PDF it is simply missing text. Nobody decided to cut the sentence. It fell off the end of a frame that no one re-measured.&lt;/p&gt;&lt;p&gt;The second is &lt;b&gt;script&lt;/b&gt;. Japanese set in a Latin font renders as tofu — the empty boxes □□□ that appear when the font has no glyph for the character. The text is correct; the font just cannot draw it.&lt;/p&gt;&lt;p&gt;Both of these are detectable properties of the swap, not matters of judgment. A frame either overflows or it does not. A font either has the glyphs or it does not. Which means they belong to the tool, checked at the moment the text is swapped — not to a human doing a final visual pass and hoping to catch them.&lt;/p&gt;&lt;h2&gt;Swap the Content, Keep the Container&lt;/h2&gt;&lt;p&gt;The approach that follows from this is a keyed swap. Every translatable frame carries a label — a key — and the translation table is keyed the same way:&lt;/p&gt;&lt;pre style=&quot;overflow: auto;&quot;&gt;&lt;code&gt;key, en, ja, de
title, Quick Start Guide, クイックスタートガイド, Kurzanleitung zur Inbetriebnahme
intro, Thank you for ..., 本製品をお選び..., Vielen Dank, dass Sie ...&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The script matches each frame to its key, replaces the text inside it, and re-applies that frame&apos;s paragraph style to the swapped text. The master pages and the paragraph-style &lt;em&gt;definitions&lt;/em&gt; stay exactly as they were — they were never the variable. Where a language needs a different font — Japanese — the script applies it as a local override on the swapped text, leaving the style definition itself unchanged. This is the same shape as a TMS round-trip — extract, translate, reimport — done directly against the document.&lt;/p&gt;&lt;p&gt;And because the swap is the moment the new text meets the old frame, it is the right moment to check the two failures:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Overset is caught and reported.&lt;/b&gt; Every frame where the translated text no longer fits is written to a report, by language and by key. The overflow that a by-eye reflow ships becomes a line you read before you deliver.&lt;/li&gt;&lt;li&gt;&lt;b&gt;A CJK font is applied automatically.&lt;/b&gt; For Japanese, the script finds an installed CJK font and applies it as a local override on the swapped text — the paragraph style itself is left as defined. If no CJK font is installed, that is flagged in the report rather than exported as broken output: a missing font is a note to fix, not a file you send.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The design — frames, master pages, and the style definitions — survives; the content is replaced, and for Japanese the font is overridden on that swapped text.&lt;/p&gt;&lt;h2&gt;Two Ways to Run It&lt;/h2&gt;&lt;p&gt;The same engine reads two ways, and which one you lead with depends on where the content lives.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;One CSV in, every language out.&lt;/b&gt; Hand it a table (&lt;code&gt;key, en, ja, de, …&lt;/code&gt;) and it lays out and saves each language as a finished document, plus the report. One data file in, a set of print-ready PDFs out.&lt;/li&gt;&lt;li&gt;&lt;b&gt;On your own document, in place.&lt;/b&gt; Open your branded InDesign file, point the script at a language, and it swaps that layout where it stands — preserving your design. This is the real localization job: &lt;em&gt;here is our brochure, we need it in five languages.&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Where This Has Limits&lt;/h2&gt;&lt;p&gt;Worth knowing before you lean on it:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Right-to-left is out of scope here.&lt;/b&gt; Arabic and Urdu need bidirectional layout handling that this proof does not attempt.&lt;/li&gt;&lt;li&gt;&lt;b&gt;The swap is whole-frame, and it does not preserve inline formatting.&lt;/b&gt; Each keyed frame is replaced with plain text from the table, so local emphasis — a bold word, a character style on a single term, or several different paragraph styles inside one frame — does not survive the swap. A frame comes back in one paragraph style, with &lt;code&gt;|&lt;/code&gt; adding further paragraphs in that same style. That is what keeps the behavior predictable, and it fits structured, one-field-per-frame content — a label, a spec line, a short guide — better than richly formatted running text. For the latter, an inline-aware swap that replaces phrases inside a run is the right next step.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Input is a CSV for now.&lt;/b&gt; Word and xlsx import are a natural next step, not part of this proof.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Terminology is a separate layer.&lt;/b&gt; Making the translation &lt;em&gt;fit&lt;/em&gt; is this tool&apos;s job; making it use the &lt;em&gt;approved terms&lt;/em&gt; is a different check. I keep that in a companion, a glossary/terminology checker, run on the copy before reflow.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;None of these are blockers. They are the edges of a deliberately small proof, and knowing them up front is part of the point.&lt;/p&gt;&lt;h2&gt;The Structural Takeaway&lt;/h2&gt;&lt;p&gt;The layout is the source; each language is a rendering of it. Once you treat it that way — swap only the content, keep the container, and let the tool check the fit and the font at swap time — reflowing a document into another language stops being a fresh manual job and becomes a repeatable step. The translation was always the easy part. The value is in everything that has to happen &lt;em&gt;after&lt;/em&gt; the words are ready.&lt;/p&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_15.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Style Reloads Before Translation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_18.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Language-Based Image Relinking in InDesign&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/09/comparing-indesign-files-after.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Comparing InDesign Files After Translation: What to Check&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>

  <entry>
    <title>How a Print PDF Should Be Built from HTML</title>
    <id>https://www.linguist-coder.com/2026/07/how-print-pdf-should-be-built-from-html.html</id>
    <link href="https://www.linguist-coder.com/2026/07/how-print-pdf-should-be-built-from-html.html"/>
    <published>2026-07-01T20:37:10.691Z</published>
    <updated>2026-07-01T20:37:10.692Z</updated>
    <summary>Recently I had a small but common production problem. A report already existed as a designed HTML page — good typography, a cover, a table of contents — and it needed to become a print-ready PDF. Not a screen capture…</summary>
    <content type="html">&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/07/how-print-pdf-should-be-built-from-html/01.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Cover page of the sample PDF, The Print Pipeline&quot; border=&quot;0&quot; data-original-height=&quot;1853&quot; data-original-width=&quot;1309&quot; height=&quot;320&quot; src=&quot;/images/2026/07/how-print-pdf-should-be-built-from-html/01.png&quot; width=&quot;226&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Recently I had a small but common production problem. A report already existed as a designed HTML page — good typography, a cover, a table of contents — and it needed to become a print-ready PDF. Not a screen capture of the web page, but a proper document: numbered pages, a table of contents whose page references are correct, and no heading left stranded at the bottom of a page.&lt;/p&gt;

&lt;p&gt;At first glance this is just &quot;export to PDF.&quot; But the more useful question is the same one I keep returning to in production work:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Which layer should own the page numbers and the table of contents?&lt;/b&gt;&lt;/p&gt;

&lt;h2&gt;The Wrong Layers&lt;/h2&gt;

&lt;p&gt;There are two tempting answers, and both create problems later.&lt;/p&gt;

&lt;p&gt;The first is to type the numbers into the table of contents by hand. This works until the content changes. Add a paragraph near the front, and every page reference after it is quietly wrong. The numbers live in the text, but they describe the layout — so they fall out of sync the moment the layout moves.&lt;/p&gt;

&lt;p&gt;The second is to use the browser&apos;s &quot;Print to PDF.&quot; This renders the page faithfully, but it cannot compute that the Methods section begins on page 7, and it cannot restart numbering after the cover. It produces an image of the document, not a paginated document with cross-references.&lt;/p&gt;

&lt;p&gt;Neither approach is wrong because of effort. They are wrong because the page numbers and the TOC references are being placed in the wrong layer.&lt;/p&gt;

&lt;h2&gt;The Source Is the HTML; the PDF Is a Rendering&lt;/h2&gt;

&lt;p&gt;The useful framing is to treat the HTML as the source and the PDF as one rendering of it. Page numbers and table-of-contents references are not content you author. They are properties of the laid-out pages, and they should be &lt;b&gt;computed at layout time&lt;/b&gt; — the same way a screen layout computes where a line wraps.&lt;/p&gt;

&lt;p&gt;That is exactly what the CSS &lt;a href=&quot;https://www.w3.org/TR/css-page-3/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;Paged Media&lt;/a&gt; specification describes, and what &lt;a href=&quot;https://pagedjs.org/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;Paged.js&lt;/a&gt; implements as a browser polyfill — paginating the document in the DOM, which a headless Chrome run then prints to PDF. So instead of editing the document, the print behavior is added as a separate layer on top of it.&lt;/p&gt;

&lt;p&gt;The conversion then becomes four predictable steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read the source HTML.&lt;/li&gt;
&lt;li&gt;Inline local images as data URIs, so the file stays self-contained.&lt;/li&gt;
&lt;li&gt;Overlay the print CSS — page size, margins, page numbers, live TOC.&lt;/li&gt;
&lt;li&gt;Render to PDF with Paged.js. Body text stays selectable and fonts are embedded.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The document&apos;s own design is never touched. The overlay only adds the print semantics the screen layout had no reason to carry.&lt;/p&gt;

&lt;h2&gt;Page Numbers Belong to the Page Box&lt;/h2&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/07/how-print-pdf-should-be-built-from-html/02.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Body page of the sample PDF with a stage table, headings, a diagram, and page number 2&quot; border=&quot;0&quot; data-original-height=&quot;1853&quot; data-original-width=&quot;1309&quot; height=&quot;320&quot; src=&quot;/images/2026/07/how-print-pdf-should-be-built-from-html/02.png&quot; width=&quot;226&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;In Paged Media, a page number is not text in the document. It is content of the page box itself, so it sits in the margin and updates automatically:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;@page {
  size: A4;
  margin: 18mm;
  @bottom-center { content: counter(page); }
}

/* the cover is its own page, full bleed, with no number */
.cover { page: cover; break-after: page; }
@page cover { margin: 0; @bottom-center { content: none; } }

/* the imprint is the first page that carries a number: restart the count here */
.imprint { counter-reset: page 1; }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Because the folio is a property of the page rather than the text, suppressing it on the cover and restarting the count at the imprint are small, declarative changes — not manual edits to chase on every revision.&lt;/p&gt;

&lt;h2&gt;A Table of Contents Computed at Layout Time&lt;/h2&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/07/how-print-pdf-should-be-built-from-html/03.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Contents page of the sample PDF with page numbers computed at layout time&quot; border=&quot;0&quot; data-original-height=&quot;1853&quot; data-original-width=&quot;1309&quot; height=&quot;320&quot; src=&quot;/images/2026/07/how-print-pdf-should-be-built-from-html/03.png&quot; width=&quot;226&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;This is the part that surprises people. Each TOC entry is an ordinary link to an anchor in the document. The page number is filled in &lt;i&gt;after&lt;/i&gt; the layout is known, with &lt;code&gt;target-counter&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;.toc a[href^=&quot;#&quot;]::after {
  content: target-counter(attr(href), page);
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Move a section, regenerate the PDF, and every number is correct again. The reference describes the layout, and now it is derived from the layout, so the two can no longer drift apart.&lt;/p&gt;

&lt;h2&gt;Where This Approach Has Limits&lt;/h2&gt;

&lt;p&gt;A few things are worth knowing before you rely on it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;CSS Grid does not fragment across pages.&lt;/b&gt; A grid block jumps whole to the next page and can leave its heading stranded. When a long section needs to flow, multi-column layout (&lt;code&gt;column-count&lt;/code&gt;) paginates cleanly where grid does not.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Paged.js cannot resolve &lt;code&gt;var()&lt;/code&gt; inside &lt;code&gt;@page&lt;/code&gt; rules.&lt;/b&gt; Page geometry has to be written with literal values.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Headings set in a web font render correctly but may not be selectable as text.&lt;/b&gt; When verifying output, check the body text and a rendered page image rather than the headline.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these are blockers. They are just places where the print layer behaves differently from the screen, and knowing them up front saves an afternoon.&lt;/p&gt;

&lt;h2&gt;A Note on Tools&lt;/h2&gt;

&lt;p&gt;Prince XML handles this category of work very well, but it is commercial and its free tier watermarks the output. Paged.js is open source and adds no watermark, which is why I reach for it when the goal is a repeatable conversion rather than a single file. The browser&apos;s own &quot;Print to PDF&quot; remains fine for a quick one-off — it simply cannot compute references or restart folios.&lt;/p&gt;

&lt;h2&gt;The Script&lt;/h2&gt;

&lt;p&gt;I packaged the workflow as a small command-line tool and published it:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/linguist-coder/html-to-print-pdf&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;https://github.com/linguist-coder/html-to-print-pdf&lt;/b&gt;&lt;/a&gt; (MIT)&lt;/p&gt;

&lt;p&gt;It takes a designed HTML file and produces the PDF, driven by a small config for page size, margins, the cover, where numbering restarts, and which links form the table of contents. The repository includes a self-contained sample report — a cover, an imprint page, a computed TOC, a table, and a figure — so the whole thing runs end to end:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone https://github.com/linguist-coder/html-to-print-pdf.git
cd html-to-print-pdf
npm install
npm run example     # -&amp;gt; examples/report/report.pdf&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The takeaway is the same structural point I started with. The PDF is a rendering of the document, not the document itself. Once the page numbers and the table of contents are computed at layout time instead of typed by hand, regenerating the file after an edit stops being manual work — which is the whole point of treating the HTML, and not the PDF, as the source.&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>When Font Replacement Should Happen at the Definition Level in InDesign</title>
    <id>https://www.linguist-coder.com/2026/06/when-font-replacement-should-happen-at.html</id>
    <link href="https://www.linguist-coder.com/2026/06/when-font-replacement-should-happen-at.html"/>
    <published>2026-06-16T02:05:17.436Z</published>
    <updated>2026-06-16T02:05:17.436Z</updated>
    <summary>Replacing Helvetica with Arial inside document composite fonts InDesign font replacement is not always a text-level task. Recently, I had a small but practical multilingual DTP problem: a Chinese InDesign document used composite fonts, and Helvetica was assigned inside those…</summary>
    <content type="html">&lt;h2 style=&quot;text-align: left;&quot;&gt;Replacing Helvetica with Arial inside document composite fonts&lt;/h2&gt;

&lt;p&gt;InDesign font replacement is not always a text-level task.&lt;/p&gt;

&lt;p&gt;Recently, I had a small but practical multilingual DTP problem: a Chinese InDesign document used composite fonts, and Helvetica was assigned inside those composite font definitions. The production requirement was simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Replace Helvetica with Arial.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At first glance, this sounds like an ordinary font replacement task. But in InDesign, the important question is not only &lt;strong&gt;which font should be replaced&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The more important question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which layer owns the font decision?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;InDesign documents can contain font information in several places: direct text formatting, paragraph styles, character styles, and composite font definitions. If the change is made at the wrong layer, the document may look correct temporarily but become harder to maintain later.&lt;/p&gt;

&lt;p&gt;This is why I created a small script that replaces Helvetica with Arial only inside document-level composite fonts.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;Why I Usually Avoid Direct Font Replacement&lt;/h2&gt;

&lt;p&gt;In many InDesign production workflows, I do not treat font replacement as a direct text-level operation.&lt;/p&gt;

&lt;p&gt;If a font is controlled by a paragraph style or a character style, the safer approach is usually to update the style definition itself. This keeps the document structure clean.&lt;/p&gt;

&lt;p&gt;Directly replacing the font in the text may fix the appearance, but it can create local overrides.&lt;/p&gt;

&lt;p&gt;That causes two practical problems.&lt;/p&gt;

&lt;p&gt;First, if the override is cleared later, the text may return to the old font defined in the style.&lt;/p&gt;

&lt;p&gt;Second, when new content is added, the same local override may need to be copied or recreated manually.&lt;/p&gt;

&lt;p&gt;In other words, direct font replacement can solve the visible problem while leaving the structural problem unresolved.&lt;/p&gt;

&lt;p&gt;For maintainable InDesign files, font changes should usually happen at the style level when the font is controlled by a paragraph style or a character style.&lt;/p&gt;

&lt;p&gt;If the font is controlled by a paragraph style, update the paragraph style.&lt;/p&gt;

&lt;p&gt;If the font is controlled by a character style, update the character style.&lt;/p&gt;

&lt;p&gt;But composite fonts add another layer.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;Why Composite Fonts Are Different&lt;/h2&gt;

&lt;p&gt;Composite fonts are commonly used in CJK typography workflows.&lt;/p&gt;

&lt;p&gt;Depending on the InDesign version or language edition, composite font features may not be exposed in the same way through the user interface. In other words, some readers may not see the same composite font controls in their own InDesign environment.&lt;/p&gt;

&lt;p&gt;In CJK workflows, a paragraph style may use a composite font. Inside that composite font, different character classes can be assigned different fonts. For example, Chinese characters may use a CJK font, while Latin letters, numbers, and symbols may use a separate Latin font.&lt;/p&gt;

&lt;p&gt;That means the visible text may not directly tell the whole story.&lt;/p&gt;

&lt;p&gt;The paragraph style may simply point to a composite font. The actual Latin font used inside that composite font may be Helvetica.&lt;/p&gt;

&lt;p&gt;In that case, changing the paragraph style to Arial would not be the right interpretation of the problem.&lt;/p&gt;

&lt;p&gt;The issue is not that the paragraph style itself should become Arial.&lt;/p&gt;

&lt;p&gt;The issue is that Helvetica should no longer be used inside the composite font definition.&lt;/p&gt;

&lt;p&gt;So the replacement target is not ordinary text.&lt;/p&gt;

&lt;p&gt;It is not a paragraph style.&lt;/p&gt;

&lt;p&gt;It is not a character style.&lt;/p&gt;

&lt;p&gt;It is the applied font inside the document’s composite font entries.&lt;/p&gt;

&lt;figure class=&quot;diagram&quot;&gt;&lt;img src=&quot;/images/2026/06/when-font-replacement-should-happen-at/diagram-01.svg&quot; alt=&quot;Helvetica is replaced with Arial inside the composite font definition while style references remain and ordinary text runs are not directly changed.&quot; width=&quot;1600&quot; height=&quot;900&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;h2&gt;Two Possible Approaches&lt;/h2&gt;

&lt;p&gt;There were two reasonable ways to handle this.&lt;/p&gt;

&lt;table style=&quot;border-collapse: collapse; margin: 1em 0px; width: 100%;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px; text-align: left;&quot;&gt;Approach&lt;/th&gt;
      &lt;th style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px; text-align: left;&quot;&gt;When it makes sense&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Create a new composite font&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;When the old and new composite fonts need to coexist&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Modify the existing composite font&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;When the old font should no longer be used in that composite font&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The first approach is to create a new composite font and then update paragraph styles and character styles so that they use the new composite font.&lt;/p&gt;

&lt;p&gt;This is a good approach when both composite fonts need to remain available. For example, if some pages or styles should continue using the old composite font while others should use the new one, creating a separate composite font keeps the distinction clear.&lt;/p&gt;

&lt;p&gt;The second approach is to modify the existing composite font definition.&lt;/p&gt;

&lt;p&gt;This is appropriate when the old font should no longer be used at all in that composite font. In this case, the style references can stay as they are. The definition they point to is updated instead.&lt;/p&gt;

&lt;p&gt;For this case, Helvetica was no longer supposed to be used.&lt;/p&gt;

&lt;p&gt;So I chose the second approach.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;Why I Chose to Modify the Existing Composite Font&lt;/h2&gt;

&lt;p&gt;The requirement was not to create a new font design system.&lt;/p&gt;

&lt;p&gt;It was to remove Helvetica from the existing document-level composite font setup and replace it with Arial.&lt;/p&gt;

&lt;p&gt;Creating a new composite font would have worked, but it would also have introduced another definition into the document. Then I would need to update paragraph styles and character styles that referenced the old composite font.&lt;/p&gt;

&lt;p&gt;That approach is useful when both definitions must coexist.&lt;/p&gt;

&lt;p&gt;But here, the old Helvetica-based composite font was not needed anymore.&lt;/p&gt;

&lt;p&gt;So the better choice was to update the existing composite font definition.&lt;/p&gt;

&lt;p&gt;This kept the style structure intact. Paragraph styles and character styles could continue pointing to the same composite font. Only the internal font assignment changed.&lt;/p&gt;

&lt;p&gt;The important decision was not Helvetica versus Arial.&lt;/p&gt;

&lt;p&gt;It was whether the existing composite font definition should be updated or replaced with a new one.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;The Script Scope: Document Composite Fonts Only&lt;/h2&gt;

&lt;p&gt;The script is intentionally narrow.&lt;/p&gt;

&lt;p&gt;It does not try to replace every instance of Helvetica in the document.&lt;/p&gt;

&lt;p&gt;It only scans composite fonts stored in the active document and changes Helvetica entries inside those document composite font definitions.&lt;/p&gt;

&lt;p&gt;At the top of the script, the intended scope is documented clearly:&lt;/p&gt;

&lt;pre style=&quot;background: rgb(245, 245, 245); border: 1px solid rgb(221, 221, 221); overflow-x: auto; padding: 12px;&quot;&gt;&lt;div style=&quot;background-color: #121314; color: #bbbebf; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 19px;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;/*&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;&amp;nbsp; &amp;nbsp; Replaces Helvetica with Arial in document composite fonts.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;&amp;nbsp; &amp;nbsp; Scope:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;&amp;nbsp; &amp;nbsp; - Processes only app.activeDocument.compositeFonts.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;&amp;nbsp; &amp;nbsp; - Does not directly modify app.compositeFonts.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;&amp;nbsp; &amp;nbsp; - Does not modify paragraph styles, character styles, normal text, or find/change settings.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;*/&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;(&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; () &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;());&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;main&lt;/span&gt;() &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;doc&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;fallbackArialFont&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;compositeFonts&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;cf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;shouldSkipIndexZero&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;summaryMessage&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (app.documents.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;alert&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;No InDesign document is open.&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;confirm&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;This script will replace Helvetica used in composite fonts in the current document with Arial. Continue?&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;)) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;fallbackArialFont&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getArialFontByStyle&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Regular&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;fallbackArialFont&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;alert&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Cannot continue because Arial is not available.&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; doc &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; app.activeDocument;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; log &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;compositeFontsScanned:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;entriesScanned:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;entriesChanged:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;styleMappedEntries:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fallbackEntries:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;styleSetWarnings:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;errors:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;lines:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; []&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compositeFonts &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; doc.compositeFonts;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;alert&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Could not retrieve the document composite fonts.&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; e);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; shouldSkipIndexZero &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;canSkipFirstCompositeFont&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(compositeFonts);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;; i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFonts.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;; i&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; shouldSkipIndexZero) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.lines.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Skipped composite font at index 0: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetCompositeFontName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(compositeFonts[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;]));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;continue&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cf &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFonts[i];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;processCompositeFont&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(cf, fallbackArialFont, log);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e2) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.errors&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.lines.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;[Error] Composite font index &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; e2);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; summaryMessage &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;buildSummaryMessage&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(log);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;alert&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(summaryMessage);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;getArialFontByStyle&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;styleName&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; font;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; normalizedStyle;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; candidates;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; i;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; normalizedStyle &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeArialStyleName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(styleName);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; candidates &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getArialFontNameCandidates&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(normalizedStyle);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;; i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; candidates.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;; i&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; font &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getValidFontByName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(candidates[i]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (font &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; font;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;getArialFontNameCandidates&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;styleName&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; candidates;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; candidates &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; [];&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (styleName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Bold Italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;Bold Italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial Bold Italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial-BoldItalicMT&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial-BoldItalic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (styleName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Bold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;Bold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial Bold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial-BoldMT&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial-Bold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (styleName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;Italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial Italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial-ItalicMT&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial-Italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;Regular&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;ArialMT&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; candidates.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Arial-Regular&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; candidates;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;getValidFontByName&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;fontName&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; font;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; font &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; app.fonts.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;itemByName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontName);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (font &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; font.isValid) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; font;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;canSkipFirstCompositeFont&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;compositeFonts&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; firstName;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;compositeFonts &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFonts.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;compositeFonts[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;].isValid) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; firstName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetCompositeFontName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(compositeFonts[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;]);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (firstName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (firstName.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\u306A\u3057&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; firstName.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toLowerCase&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; firstName.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toLowerCase&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;no composite&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;processCompositeFont&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;compositeFont&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;fallbackArialFont&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;log&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; entries;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFontName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; i;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; entry;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; compositeFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetCompositeFontName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(compositeFont);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; log.compositeFontsScanned&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entries &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFont.compositeFontEntries;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.errors&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.lines.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;[Error] Could not read entries for composite font &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; e);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;; i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; entries.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;; i&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; entries[i];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;processCompositeFontEntry&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(compositeFontName, entry, fallbackArialFont, log);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e2) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.errors&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.lines.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;[Error] Composite font &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;, entry index &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; e2);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;processCompositeFontEntry&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;compositeFontName&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;entry&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;fallbackArialFont&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;log&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; entryName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; oldFont;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; oldFontName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; rawStyle;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; inferredStyle;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; mappedTargetStyle;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; arialFont;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fallbackUsed;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; styleMapped;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; newFontName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; newStyleName;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; log.entriesScanned&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; entryName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetEntryName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(entry);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; oldFont &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; entry.appliedFont;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.errors&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.lines.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;[Error] Could not read appliedFont. Composite font: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;, entry: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; entryName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; e);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; oldFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getFontDisplayName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(oldFont);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;isHelveticaFont&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(oldFont)) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; rawStyle &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getRawFontStyleName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(oldFont, entry);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; inferredStyle &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;inferFontStyleName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(oldFont, entry);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; mappedTargetStyle &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; inferredStyle;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; arialFont &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getArialFontByStyle&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(mappedTargetStyle);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; fallbackUsed &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (arialFont &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; arialFont &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fallbackArialFont;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fallbackUsed &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; styleMapped &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;isMeaningfullyDifferentStyle&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(rawStyle, mappedTargetStyle);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry.appliedFont &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; arialFont;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e2) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.errors&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.lines.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;[Error] Could not change appliedFont. Composite font: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;, entry: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; entryName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;, before: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; oldFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; e2);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; newStyleName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getFontStyleForEntry&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(arialFont, mappedTargetStyle);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (newStyleName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; entry.fontStyle &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; newStyleName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e3) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.styleSetWarnings&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.lines.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;[Warning] appliedFont was changed, but fontStyle could not be set. Composite font: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;, entry: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; entryName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; e3);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; newFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;getFontDisplayName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(arialFont);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; log.entriesChanged&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (styleMapped) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.styleMappedEntries&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (fallbackUsed) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.fallbackEntries&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; log.lines.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;[Changed] Composite font: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compositeFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;, entry: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; entryName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;, inferred style: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; inferredStyle &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;, before: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; oldFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;, after: &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; newFontName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (fallbackUsed &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; [Fell back to Arial Regular]&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (styleMapped) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; log.lines.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;[Style mapped] Original style &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; rawStyle &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt; was mapped to &lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; mappedTargetStyle &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;.&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;isHelveticaFont&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;fontValue&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; family;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; name;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fullName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (fontValue &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fontValue &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;undefined&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fontValue &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;string&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsHelvetica&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; family &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fontFamily&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (family &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsHelveticaFamily&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(family)) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; name &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (name &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsHelvetica&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(name)) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; fullName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fullName&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (fullName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsHelvetica&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fullName)) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsHelvetica&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;inferFontStyleName&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;fontValue&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;entry&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; parts;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; i;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; normalized;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; parts &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; [];&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;addIfNotEmpty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(parts, &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fontStyleName&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;addIfNotEmpty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(parts, &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;styleName&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;addIfNotEmpty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(parts, &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(entry, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fontStyle&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;addIfNotEmpty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(parts, &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;addIfNotEmpty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(parts, &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fullName&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;));&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fontValue &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;string&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;addIfNotEmpty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(parts, fontValue);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;; i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; parts.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;; i&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; normalized &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeArialStyleName&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(parts[i]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (normalized &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Regular&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; normalized;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Regular&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;getRawFontStyleName&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;fontValue&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;entry&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; style;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fontStyleName&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; style;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;styleName&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; style;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(entry, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fontStyle&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; style;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;isMeaningfullyDifferentStyle&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;rawStyle&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;mappedStyle&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; raw;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; mapped;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; raw &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeStyleForComparison&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(rawStyle);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; mapped &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeStyleForComparison&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(mappedStyle);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; raw &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; mapped &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; raw &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; mapped;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeStyleForComparison&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;styleName&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeText&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(styleName);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;removeFontFamilyWords&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;[^&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;a-z0-9&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #8b949e;&quot;&gt;// Ignore family-name residue so plain Helvetica Neue is not reported as a style mapping.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;neue&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;helveticaneue&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;helvetica&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;arial&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;roman&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;plain&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;normal&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;book&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;regular&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeArialStyleName&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;styleName&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; compactText;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; isBold;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; isItalic;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeText&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(styleName);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Regular&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;removeFontFamilyWords&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; compactText &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;[^&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;a-z0-9&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; isBold &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsStyleWord&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;bold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compactText.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;bold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsStyleWord&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;black&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compactText.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;black&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsStyleWord&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;heavy&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compactText.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;heavy&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsStyleWord&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;demi&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compactText.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;demi&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsStyleWord&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;semi bold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsStyleWord&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;semibold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compactText.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;semibold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; isItalic &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsStyleWord&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compactText.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsStyleWord&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;oblique&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compactText.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;oblique&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsStyleWord&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;slanted&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compactText.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;slanted&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (isBold &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; isItalic) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Bold Italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (isBold) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Bold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (isItalic) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Italic&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Regular&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;removeFontFamilyWords&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;value&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; value;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/helvetica neue/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/helveticaneue/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/helvetica/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/arial/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #d16969;&quot;&gt;\s&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;trimString&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsStyleWord&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;value&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;word&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; normalizedWord;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; value &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; normalizedWord &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeText&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(word) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(normalizedWord) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (word &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;semibold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; value.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;semi bold&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;getFontStyleForEntry&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;fontValue&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;inferredStyle&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; style;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fontStyleName&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; style;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;styleName&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; style;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; inferredStyle;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;addIfNotEmpty&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;list&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;value&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (value &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; value &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;undefined&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(value) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; list.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(value));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsHelveticaFamily&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;value&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeText&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(value);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;helvetica&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;helvetica&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;containsHelvetica&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;value&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeText&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(value);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt; /&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;^|&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;[^&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;a-z0-9&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;])&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;helvetica&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;$|&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;[^&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;a-z0-9&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;neue&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;normalizeText&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;value&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (value &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; value &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;undefined&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(value);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;toLowerCase&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #d16969;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #d16969;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #d16969;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/_/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #d16969;&quot;&gt;\s&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; text &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;trimString&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(text);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; text;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;getFontDisplayName&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;fontValue&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; family;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; style;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fullName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; name;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; result;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (fontValue &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fontValue &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;undefined&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;(None)&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fontValue &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;string&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fontValue;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; family &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fontFamily&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fontStyleName&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; fullName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;fullName&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; name &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (family &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; family;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (style &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; style;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; result;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (fullName &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; fullName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (name &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; name;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(fontValue);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;(Unknown font)&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetCompositeFontName&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;compositeFont&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; name;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; name &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(compositeFont, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (name &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; name;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;(Unnamed composite font)&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetEntryName&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;entry&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; name;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; characterRange;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; name &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(entry, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (name &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; name;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; characterRange &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(entry, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;characterRange&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (characterRange &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; characterRange;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;(Unnamed entry)&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;safeGetProperty&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;obj&lt;/span&gt;, &lt;span style=&quot;color: #ffa657;&quot;&gt;propertyName&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; value;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (obj &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; obj &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;undefined&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; obj[propertyName];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (value &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; value &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;undefined&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(value);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;trimString&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;value&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; value.&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;^&lt;/span&gt;&lt;span style=&quot;color: #d16969;&quot;&gt;\s&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: #d2a8ff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #d16969;&quot;&gt;\s&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2a8ff;&quot;&gt;buildSummaryMessage&lt;/span&gt;(&lt;span style=&quot;color: #ffa657;&quot;&gt;log&lt;/span&gt;) &lt;span style=&quot;color: #c9d1d9;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; message;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; maxLines;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff7b72;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; i;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Finished replacing Helvetica with Arial in composite fonts.&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Composite fonts scanned: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; log.compositeFontsScanned &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Composite font entries scanned: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; log.entriesScanned &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Entries changed: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; log.entriesChanged &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Style-mapped entries: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; log.styleMappedEntries &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Fallback entries: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; log.fallbackEntries &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Style set warnings: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; log.styleSetWarnings &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;Errors: &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; log.errors;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (log.lines.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;Log:&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; maxLines &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;20&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;; i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; log.lines.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; maxLines; i&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; log.lines[i];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (log.lines.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; maxLines) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; message &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #d7ba7d;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;... &quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; (log.lines.&lt;/span&gt;&lt;span style=&quot;color: #79c0ff;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; maxLines) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a5d6ff;&quot;&gt;&quot; more log entries.&quot;&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt; message;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c9d1d9;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;

&lt;p&gt;This is the core design principle of the script.&lt;/p&gt;

&lt;p&gt;The script is not a general font replacement tool.&lt;/p&gt;

&lt;p&gt;It is a targeted cleanup script for a specific composite font problem.&lt;/p&gt;

&lt;h3&gt;Limitations&lt;/h3&gt;

&lt;p&gt;This script is intentionally limited.&lt;/p&gt;

&lt;p&gt;It does not modify ordinary text formatting.&lt;/p&gt;

&lt;p&gt;It does not modify paragraph styles.&lt;/p&gt;

&lt;p&gt;It does not modify character styles.&lt;/p&gt;

&lt;p&gt;It does not create a new composite font.&lt;/p&gt;

&lt;p&gt;It does not directly modify application-level composite fonts.&lt;/p&gt;

&lt;p&gt;It does not check fonts embedded in exported PDFs.&lt;/p&gt;

&lt;p&gt;It does not manage a full font policy for a project.&lt;/p&gt;

&lt;p&gt;For this specific workflow, the goal was not to build a general font management system. The goal was to correct one document-level composite font rule safely and repeatably.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;What the Script Does&lt;/h2&gt;

&lt;p&gt;The script follows a simple process:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Check whether an InDesign document is open.&lt;/li&gt;
  &lt;li&gt;Ask for confirmation before making changes.&lt;/li&gt;
  &lt;li&gt;Check whether Arial Regular is available.&lt;/li&gt;
  &lt;li&gt;Get the composite fonts from the active document.&lt;/li&gt;
  &lt;li&gt;Scan each composite font entry.&lt;/li&gt;
  &lt;li&gt;Detect Helvetica or Helvetica Neue.&lt;/li&gt;
  &lt;li&gt;Infer the font style, such as Regular, Bold, Italic, or Bold Italic.&lt;/li&gt;
  &lt;li&gt;Replace the Helvetica entry with the matching Arial font when available.&lt;/li&gt;
  &lt;li&gt;Fall back to Arial Regular if a matching Arial style cannot be found.&lt;/li&gt;
  &lt;li&gt;Show a summary that separates changed entries, style mappings, fallback replacements, style-setting warnings, and errors.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is a small script, but the logic reflects a production rule:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Only replace Helvetica when it appears inside document composite font entries.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The summary separates several types of results:&lt;/p&gt;

&lt;table style=&quot;border-collapse: collapse; margin: 1em 0px; width: 100%;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px; text-align: left;&quot;&gt;Summary item&lt;/th&gt;
      &lt;th style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px; text-align: left;&quot;&gt;Meaning&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Composite fonts scanned&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Number of document composite fonts checked&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Composite font entries scanned&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Number of composite font entries checked&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Entries changed&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Number of entries where Helvetica was replaced&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Style-mapped entries&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Number of entries where the original style was mapped to a simpler Arial style&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Fallback entries&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Number of entries where a matching Arial style was not found and Arial Regular was used&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Style set warnings&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Number of entries where the font was changed but the font style setting could not be applied&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Errors&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(204, 204, 204); padding: 8px;&quot;&gt;Number of entries or composite fonts that could not be processed&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The distinction between style mapping and fallback is important.&lt;/p&gt;

&lt;p&gt;For example, Helvetica Neue Medium may be mapped to Arial Regular. In that case, the script records a style mapping so that the change is visible in the log.&lt;/p&gt;

&lt;p&gt;Fallback is different. It means the script tried to find a matching Arial style, but could not find one, so it used Arial Regular instead.&lt;/p&gt;

&lt;p&gt;This makes the result easier to review after execution.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;Key Code Points&lt;/h2&gt;

&lt;p&gt;The script starts by getting the composite fonts from the active document:&lt;/p&gt;&lt;p&gt;compositeFonts = doc.compositeFonts;&lt;/p&gt;&lt;p&gt;This is the key scope decision.&lt;/p&gt;

&lt;p&gt;The script is not scanning all text in the document. It is not searching paragraph styles. It is not searching character styles.&lt;/p&gt;

&lt;p&gt;It is targeting document composite font definitions.&lt;/p&gt;

&lt;p&gt;Then it reads the entries inside each composite font:&lt;/p&gt;&lt;p&gt;entries = compositeFont.compositeFontEntries;&lt;/p&gt;&lt;p&gt;Each entry may have an applied font. The script reads that font:&lt;/p&gt;&lt;p&gt;oldFont = entry.appliedFont;&lt;/p&gt;&lt;p&gt;Then it checks whether the font is Helvetica:&lt;/p&gt;&lt;p&gt;if (!isHelveticaFont(oldFont)) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; return;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;This prevents the script from touching unrelated fonts.&lt;/p&gt;&lt;p&gt;If the entry uses Helvetica, the script selects an Arial font and applies it to the composite font entry:&lt;/p&gt;&lt;p&gt;entry.appliedFont = arialFont;&lt;/p&gt;&lt;p&gt;This is the actual replacement.&lt;/p&gt;&lt;p&gt;Again, the target is not the text itself.&lt;/p&gt;

&lt;p&gt;The target is the font assigned inside the composite font definition.&lt;/p&gt;

&lt;p&gt;That distinction is the main point of the script.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;Demo: Updating the Composite Font Definition&lt;/h2&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/DfNXtihBGvo&quot; width=&quot;320&quot; youtube-src-id=&quot;DfNXtihBGvo&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;For the demo, I created a fictional Chinese InDesign document.&lt;/p&gt;

&lt;p&gt;The demo file contains sample Chinese text mixed with Latin letters and numbers. The paragraph style uses a composite font. Inside that composite font, the Latin entry uses Helvetica.&lt;/p&gt;

&lt;p&gt;Before running the script, the composite font definition contains Helvetica.&lt;/p&gt;

&lt;p&gt;After running the script, the same composite font definition uses Arial.&lt;/p&gt;

&lt;p&gt;The paragraph style still points to the same composite font.&lt;/p&gt;

&lt;p&gt;The normal text structure remains unchanged.&lt;/p&gt;

&lt;p&gt;The script also shows a summary dialog after execution. This makes it possible to confirm not only how many entries were changed, but also whether any style mappings, fallback replacements, style-setting warnings, or errors occurred.&lt;/p&gt;

&lt;p&gt;This is the behavior I wanted.&lt;/p&gt;

&lt;p&gt;The script does not create a new document structure. It updates the existing composite font definition.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;The lesson from this script is not that every font replacement needs automation.&lt;/p&gt;

&lt;p&gt;The lesson is that font replacement should happen at the layer that owns the font decision.&lt;/p&gt;

&lt;p&gt;If the font is controlled by a paragraph style, update the paragraph style.&lt;/p&gt;

&lt;p&gt;If it is controlled by a character style, update the character style.&lt;/p&gt;

&lt;p&gt;If it is controlled inside a composite font, update the composite font definition.&lt;/p&gt;

&lt;p&gt;In multilingual DTP, this distinction matters.&lt;/p&gt;

&lt;p&gt;A script should not simply change as much as possible. A good script should change only the layer it is supposed to change.&lt;/p&gt;

&lt;p&gt;For this case, Helvetica did not need to be replaced everywhere.&lt;/p&gt;

&lt;p&gt;It needed to be replaced inside document composite font definitions.&lt;/p&gt;

&lt;p&gt;That is why a small, targeted script was the right solution.&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>A Rule-First Approach to AI-Assisted Terminology QA</title>
    <id>https://www.linguist-coder.com/2026/05/a-rule-first-approach-to-ai-assisted.html</id>
    <link href="https://www.linguist-coder.com/2026/05/a-rule-first-approach-to-ai-assisted.html"/>
    <published>2026-05-11T21:33:00.000Z</published>
    <updated>2026-09-18T23:03:57.680Z</updated>
    <summary>Terminology errors are rarely dramatic. They usually appear as small inconsistencies: one deprecated term, one preferred phrase that was missed, one verbose expression that should have been simplified, or one word that does not match the approved glossary. In technical…</summary>
    <content type="html">&lt;p&gt;Terminology errors are rarely dramatic.&lt;/p&gt;

&lt;p&gt;They usually appear as small inconsistencies: one deprecated term, one preferred phrase that was missed, one verbose expression that should have been simplified, or one word that does not match the approved glossary.&lt;/p&gt;

&lt;p&gt;In technical documentation, these small issues matter. They affect consistency, readability, translation quality, and sometimes even product safety.&lt;/p&gt;

&lt;p&gt;The problem is that terminology checks are repetitive. They are also easy to miss when reviewing long documents manually.&lt;/p&gt;

&lt;p&gt;That makes terminology QA a good candidate for automation.&lt;/p&gt;

&lt;p&gt;But there is an important design question:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Should AI be the first checker?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My answer is: usually, no.&lt;/p&gt;

&lt;p&gt;For production-oriented QA, terminology checking should start with explicit rules. AI should be used as a second-pass confirmation layer, not as the primary source of detection.&lt;/p&gt;

&lt;p&gt;This is the design idea behind a small terminology checker I recently built and published on GitHub. The repository is available here: &lt;a href=&quot;https://github.com/linguist-coder/terminology-checker&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;Terminology Checker&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;The Problem with Manual Terminology Checks&lt;/h2&gt;

&lt;p&gt;A terminology rule often looks simple.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Use “use” instead of “utilize”&lt;/li&gt;
  &lt;li&gt;Use “before” instead of “prior to”&lt;/li&gt;
  &lt;li&gt;Use “because” instead of “due to the fact that”&lt;/li&gt;
  &lt;li&gt;Avoid inconsistent product names&lt;/li&gt;
  &lt;li&gt;Avoid deprecated technical terms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In theory, these rules are easy to check.&lt;/p&gt;

&lt;p&gt;In practice, they become difficult for several reasons.&lt;/p&gt;

&lt;p&gt;First, documents are long. Even if a reviewer knows the correct terminology, checking every occurrence manually is slow and unreliable.&lt;/p&gt;

&lt;p&gt;Second, terminology rules are often scattered. Some rules live in a glossary, some in a style guide, some in a client-specific instruction file, and some only exist as reviewer experience.&lt;/p&gt;

&lt;p&gt;Third, final deliverables are not always checked in the same environment where translation was performed. A document may pass QA in a CAT tool, but still need to be checked again after layout, PDF generation, or DOCX formatting.&lt;/p&gt;

&lt;p&gt;This is especially common in multilingual production workflows.&lt;/p&gt;

&lt;p&gt;A CAT tool can check the translation environment.&lt;br /&gt;
But the final PDF or DOCX is what the client actually receives.&lt;/p&gt;

&lt;p&gt;That gap is where lightweight QA tools can help.&lt;/p&gt;

&lt;h2&gt;Why AI Should Not Be the First Checker&lt;/h2&gt;

&lt;p&gt;It is tempting to ask AI a simple question:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Please check this document for terminology errors.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For a short document, this may work well enough.&lt;/p&gt;

&lt;p&gt;For production QA, however, this approach has several weaknesses.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;strong&gt;Lack of repeatability&lt;/strong&gt;&lt;br /&gt;
    The same input may not always produce the same output. This makes it difficult to use AI-only checking as a stable QA process.
  &lt;/li&gt;
  &lt;li&gt;
    &lt;strong&gt;Unclear rule traceability&lt;/strong&gt;&lt;br /&gt;
    It may be hard to tell which glossary entry, style rule, or client instruction caused a finding.
  &lt;/li&gt;
  &lt;li&gt;
    &lt;strong&gt;Over-detection and under-detection&lt;/strong&gt;&lt;br /&gt;
    AI may over-interpret harmless phrases, while also missing simple rule violations that a deterministic search would catch.
  &lt;/li&gt;
  &lt;li&gt;
    &lt;strong&gt;Difficult review history&lt;/strong&gt;&lt;br /&gt;
    If the finding is not tied to an explicit rule, it becomes harder to review, compare, or improve the result later.
  &lt;/li&gt;
  &lt;li&gt;
    &lt;strong&gt;Unclear cost and scope&lt;/strong&gt;&lt;br /&gt;
    Sending entire documents to AI for open-ended checking can be inefficient, especially when many issues can be detected by simple rules.
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This matters because QA needs repeatability.&lt;/p&gt;

&lt;p&gt;A terminology checker should answer basic questions clearly:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Which rule was checked?&lt;/li&gt;
  &lt;li&gt;Which term was found?&lt;/li&gt;
  &lt;li&gt;Where was it found?&lt;/li&gt;
  &lt;li&gt;What is the suggested replacement?&lt;/li&gt;
  &lt;li&gt;Was the finding confirmed or rejected?&lt;/li&gt;
  &lt;li&gt;Can the result be reviewed later?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If AI is used as the first checker, these questions become harder to control.&lt;/p&gt;

&lt;p&gt;For this reason, I prefer a rule-first approach.&lt;/p&gt;

&lt;p&gt;The rules should find candidates first.&lt;br /&gt;
AI can then help confirm whether each candidate is actually a problem in context.&lt;/p&gt;

&lt;h2&gt;A Two-Pass Approach&lt;/h2&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/05/a-rule-first-approach-to-ai-assisted/01.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Terminology QA flow: document, rule-based detection, AI confirmation, CSV report, human review&quot; border=&quot;0&quot; data-original-height=&quot;941&quot; data-original-width=&quot;1672&quot; height=&quot;180&quot; src=&quot;/images/2026/05/a-rule-first-approach-to-ai-assisted/01.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;The terminology checker uses a simple two-pass structure.&lt;/div&gt;

&lt;pre&gt;&lt;code&gt;Document
  ↓
Rule-based candidate detection
  ↓
AI-based confirmation
  ↓
CSV report&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The first pass is rule-based.&lt;/p&gt;

&lt;p&gt;The tool reads a glossary file and searches the document for defined terms or phrases. This step is deterministic. If the same document and the same glossary are used, the same candidates should be detected.&lt;/p&gt;

&lt;p&gt;The second pass is AI-assisted.&lt;/p&gt;

&lt;p&gt;After the rule-based pass finds candidates, AI can review the surrounding context and help reduce false positives.&lt;/p&gt;

&lt;p&gt;This separation is important.&lt;/p&gt;

&lt;p&gt;The rule layer provides repeatability.&lt;br /&gt;
The AI layer provides context sensitivity.&lt;br /&gt;
The report layer keeps the result reviewable.&lt;/p&gt;

&lt;p&gt;That combination is more practical than relying on AI alone.&lt;/p&gt;

&lt;h2&gt;A Simple Example&lt;/h2&gt;

&lt;p&gt;Suppose a glossary contains this rule:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;wrong_term,correct_term,notes
utilize,use,Use plain English where possible&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A rule-based checker can easily find every occurrence of “utilize.”&lt;/p&gt;

&lt;p&gt;But not every occurrence has the same priority.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;We will utilize this tool to check the document.&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In this case, the preferred wording is probably:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;We will use this tool to check the document.&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The rule-based layer can detect the candidate.&lt;br /&gt;
The AI confirmation layer can then check the surrounding sentence and confirm that this is likely a real style issue.&lt;/p&gt;

&lt;p&gt;Now consider a different case:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;The report discusses asset utilization in manufacturing environments.&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A simple search may still detect a related term pattern, depending on the glossary rule. But the surrounding context may show that this is part of a technical expression, not a simple “utilize → use” replacement.&lt;/p&gt;

&lt;p&gt;This is where AI can be useful.&lt;/p&gt;

&lt;p&gt;Not as a magic checker.&lt;br /&gt;
Not as the source of truth.&lt;br /&gt;
But as a context filter.&lt;/p&gt;

&lt;p&gt;The goal is to reduce the number of items that a human reviewer needs to inspect manually.&lt;/p&gt;

&lt;h2&gt;What This Terminology Checker Does&lt;/h2&gt;

&lt;p&gt;The tool is a small web app and command-line utility for terminology QA.&lt;/p&gt;

&lt;p&gt;It can check:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;PDF files&lt;/li&gt;
  &lt;li&gt;DOCX files&lt;/li&gt;
  &lt;li&gt;TXT files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It uses a CSV glossary with entries such as:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;wrong_term,correct_term,notes
utilize,use,Use plain English
prior to,before,Simplify the phrase
due to the fact that,because,Avoid verbose expressions&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The tool extracts text from the document, checks it against the glossary, and generates a CSV report.&lt;/p&gt;

&lt;p&gt;The report can then be reviewed by a human.&lt;/p&gt;

&lt;p&gt;This is intentional. The tool does not automatically rewrite the document. It focuses on detection, confirmation, and reporting.&lt;/p&gt;

&lt;p&gt;In QA workflows, that distinction matters.&lt;/p&gt;

&lt;p&gt;Automatic fixing may be useful in some controlled cases, but terminology QA often requires human judgment. The goal is not to remove the reviewer. The goal is to reduce repetitive checking and make possible issues easier to review.&lt;/p&gt;

&lt;h2&gt;Web UI and CLI&lt;/h2&gt;

&lt;p&gt;The tool includes a simple web interface built with Gradio.&lt;/p&gt;

&lt;p&gt;The web UI is useful when the goal is quick checking:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Upload a document&lt;/li&gt;
  &lt;li&gt;Upload a glossary CSV&lt;/li&gt;
  &lt;li&gt;Run the check&lt;/li&gt;
  &lt;li&gt;Download the result report&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The tool also supports command-line execution.&lt;/p&gt;

&lt;p&gt;This is useful if the checker is later integrated into a more structured workflow, such as:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;project-level QA folders&lt;/li&gt;
  &lt;li&gt;repeated checks for the same client&lt;/li&gt;
  &lt;li&gt;batch processing&lt;/li&gt;
  &lt;li&gt;automated report generation&lt;/li&gt;
  &lt;li&gt;local production pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The web UI makes the tool easier to try.&lt;br /&gt;
The CLI makes it easier to extend.&lt;/p&gt;

&lt;h2&gt;Why This Matters in Multilingual Production&lt;/h2&gt;

&lt;p&gt;Terminology QA is not only a translation issue.&lt;/p&gt;

&lt;p&gt;It is also a production issue.&lt;/p&gt;

&lt;p&gt;In a multilingual workflow, text may move through several stages:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Source document
  ↓
Translation
  ↓
CAT tool QA
  ↓
Layout / DTP
  ↓
PDF or DOCX output
  ↓
Final review&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A terminology issue can appear, disappear, or become harder to detect at different stages.&lt;/p&gt;

&lt;p&gt;For example, a term may be correct in the CAT tool but become difficult to verify after layout. A PDF may introduce line breaks or extraction noise. A final DOCX may contain manually edited text that was not checked in the translation environment.&lt;/p&gt;

&lt;p&gt;This is why final-document QA matters.&lt;/p&gt;

&lt;p&gt;The terminology checker is not meant to replace CAT-tool QA.&lt;br /&gt;
It is a final-document QA layer.&lt;/p&gt;

&lt;p&gt;It is designed to help check deliverable formats such as PDF, DOCX, and plain text against explicit terminology rules.&lt;/p&gt;

&lt;p&gt;That makes it useful as a bridge between translation QA and final production QA.&lt;/p&gt;

&lt;h2&gt;Rule-Based Detection Is Still Valuable&lt;/h2&gt;

&lt;p&gt;AI is powerful, but rule-based detection is still extremely useful.&lt;/p&gt;

&lt;p&gt;A rule is clear.&lt;br /&gt;
A rule is reviewable.&lt;br /&gt;
A rule can be versioned.&lt;br /&gt;
A rule can be reused across projects.&lt;/p&gt;

&lt;p&gt;For example, if a client says that “utilize” should be replaced with “use,” that rule does not need creative interpretation. It should simply be checked.&lt;/p&gt;

&lt;p&gt;In such cases, using AI as the first detection layer adds unnecessary uncertainty.&lt;/p&gt;

&lt;p&gt;A better design is:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Explicit rule:
“utilize” → “use”

Detection:
Find occurrences of “utilize”

AI confirmation:
Check whether this occurrence is actually a problem in context

Human review:
Accept, reject, or revise&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This keeps the workflow understandable.&lt;/p&gt;

&lt;p&gt;It also makes the QA result easier to explain to another reviewer, translator, client, or production manager.&lt;/p&gt;

&lt;h2&gt;AI as a Smart Filter&lt;/h2&gt;

&lt;p&gt;AI becomes more useful when its role is limited.&lt;/p&gt;

&lt;p&gt;Instead of asking AI to invent the checklist, the tool gives AI a narrower task:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;This term was found by a rule.&lt;br /&gt;
  Based on the surrounding context, does it look like a real terminology issue?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is a better use of AI in QA.&lt;/p&gt;

&lt;p&gt;The AI is not replacing the glossary.&lt;br /&gt;
It is not replacing the reviewer.&lt;br /&gt;
It is not deciding the entire QA policy.&lt;/p&gt;

&lt;p&gt;It is only helping with context confirmation.&lt;/p&gt;

&lt;p&gt;In other words, AI works best here as a smart filter.&lt;/p&gt;

&lt;p&gt;The rule-based layer finds possible issues.&lt;br /&gt;
The AI layer helps prioritize them.&lt;br /&gt;
The human reviewer makes the final decision.&lt;/p&gt;

&lt;p&gt;This role separation makes the workflow easier to trust.&lt;/p&gt;

&lt;h2&gt;Current Limitations&lt;/h2&gt;

&lt;p&gt;This is still a small MVP.&lt;/p&gt;

&lt;p&gt;There are several limitations.&lt;/p&gt;

&lt;p&gt;First, PDF text extraction is not always perfect. If the PDF contains complex layouts, unusual encoding, scanned pages, or broken text order, the extracted text may not reflect the visible page accurately.&lt;/p&gt;

&lt;p&gt;Second, AI confirmation requires an external API. This means confidential documents should not be checked with AI confirmation unless the workflow allows it.&lt;/p&gt;

&lt;p&gt;For sensitive documents, the rule-based mode is safer because it can be used without sending document text to an external AI service.&lt;/p&gt;

&lt;p&gt;Third, the tool does not automatically apply corrections. This is by design. At this stage, the output is a report, not a rewritten document.&lt;/p&gt;

&lt;p&gt;Fourth, glossary management is still simple. The current CSV format is easy to understand, but larger workflows may need Excel support, rule categories, severity levels, client profiles, and version control.&lt;/p&gt;

&lt;p&gt;These limitations are useful because they clarify the next design step.&lt;/p&gt;

&lt;h2&gt;Future Direction&lt;/h2&gt;

&lt;p&gt;The interesting part of this tool is not the web UI itself.&lt;/p&gt;

&lt;p&gt;The important part is the structure:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Rules
  ↓
Detection
  ↓
Context confirmation
  ↓
Reviewable report&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This structure can become a reusable QA module.&lt;/p&gt;

&lt;p&gt;Possible future improvements include:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Excel glossary support&lt;/li&gt;
  &lt;li&gt;batch checking for multiple files&lt;/li&gt;
  &lt;li&gt;project-specific rule profiles&lt;/li&gt;
  &lt;li&gt;severity levels&lt;/li&gt;
  &lt;li&gt;false-positive feedback&lt;/li&gt;
  &lt;li&gt;highlighted PDF output&lt;/li&gt;
  &lt;li&gt;DOCX comments&lt;/li&gt;
  &lt;li&gt;QA history logs&lt;/li&gt;
  &lt;li&gt;local AI model support&lt;/li&gt;
  &lt;li&gt;integration with other multilingual DTP checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The long-term goal is not just to build another checker.&lt;/p&gt;

&lt;p&gt;The goal is to make terminology QA more structured, repeatable, and easier to connect with other parts of multilingual production.&lt;/p&gt;

&lt;p&gt;A terminology checker can become one module in a larger local QA workflow.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Terminology check
  +
PDF text check
  +
layout issue detection
  +
overset / missing link checks
  +
QA logs
  =
local multilingual production QA layer&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That is the direction I am interested in.&lt;/p&gt;

&lt;p&gt;Not just one-off automation, but reusable workflow components.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Terminology QA should not depend only on human memory.&lt;br /&gt;
It should also not depend entirely on AI judgment.&lt;/p&gt;

&lt;p&gt;A more practical approach is to start with explicit rules, detect candidates consistently, then use AI only where context matters.&lt;/p&gt;

&lt;p&gt;That is the idea behind this terminology checker.&lt;/p&gt;

&lt;p&gt;Rules provide structure.&lt;br /&gt;
AI provides context support.&lt;br /&gt;
Reports keep the process reviewable.&lt;/p&gt;

&lt;p&gt;For multilingual technical documentation, this balance is important.&lt;/p&gt;

&lt;p&gt;The goal is not to automate judgment away.&lt;br /&gt;
The goal is to make judgment easier to apply consistently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt;&lt;br /&gt;
&lt;a href=&quot;https://github.com/linguist-coder/terminology-checker&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;https://github.com/linguist-coder/terminology-checker&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/05/a-rule-first-approach-to-ai-assisted/01.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Terminology QA flow: document, rule-based detection, AI confirmation, CSV report, human review&quot; border=&quot;0&quot; data-original-height=&quot;941&quot; data-original-width=&quot;1672&quot; height=&quot;180&quot; src=&quot;/images/2026/05/a-rule-first-approach-to-ai-assisted/01.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/09/comparing-indesign-files-after.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Comparing InDesign Files After Translation: What to Check&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/09/why-idml-formatting-can-produce.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Why IDML Formatting Can Produce Translation Tags, and What to Check in InDesign&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_21.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Mandatory Text Checks in PDFs Before Delivery&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>

  <entry>
    <title>Why TOC Is Hard to Automate in InDesign</title>
    <id>https://www.linguist-coder.com/2026/04/why-toc-is-hard-to-automate-in-indesign.html</id>
    <link href="https://www.linguist-coder.com/2026/04/why-toc-is-hard-to-automate-in-indesign.html"/>
    <published>2026-04-17T21:36:00.000Z</published>
    <updated>2026-04-17T21:36:43.403Z</updated>
    <summary>InDesign can generate and update a table of contents. But once you try to build automation around it, things get much less straightforward. The problem is not TOC generation itself. The problem is reliable identification. From the scripting side, a…</summary>
    <content type="html">&lt;p&gt;InDesign can generate and update a table of contents.&lt;/p&gt;&lt;p data-end=&quot;443&quot; data-start=&quot;302&quot;&gt;
But once you try to build automation around it, things get much less straightforward.&lt;/p&gt;
&lt;p data-end=&quot;526&quot; data-start=&quot;445&quot;&gt;The problem is not TOC generation itself. The problem is reliable identification.&lt;/p&gt;
&lt;p data-end=&quot;763&quot; data-start=&quot;528&quot;&gt;From the scripting side, a TOC often looks like an ordinary text frame. It sits on a page like any other block of text, and at first glance it seems like something you should be able to detect, inspect, and process like normal content.&lt;/p&gt;
&lt;p data-end=&quot;814&quot; data-start=&quot;765&quot;&gt;In practice, that assumption breaks down quickly.&lt;/p&gt;
&lt;p data-end=&quot;1227&quot; data-start=&quot;816&quot;&gt;What makes TOC difficult to automate is not that it is impossible to create. InDesign exposes TOC creation through its scripting model. The real issue is that the document model does not give you a practical, explicit frame-level way to say, “This text frame is a TOC.” The UI clearly knows how to update it. The scripting side does not give you the same kind of certainty. &lt;span class=&quot;&quot; data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-end=&quot;1268&quot; data-start=&quot;1229&quot;&gt;That gap matters more than it may seem.&lt;/p&gt;
&lt;h2 data-end=&quot;1342&quot; data-section-id=&quot;1fkmorz&quot; data-start=&quot;1270&quot;&gt;A TOC looks like normal text, but it does not behave like normal text&lt;/h2&gt;
&lt;p data-end=&quot;1373&quot; data-start=&quot;1344&quot;&gt;Visually, a TOC is just text.&lt;/p&gt;
&lt;p data-end=&quot;1688&quot; data-start=&quot;1375&quot;&gt;But functionally, it is closer to a generated structure than to hand-authored text. The fact that InDesign can update it already tells us that something more than visible text is involved. There is some internal relationship between the TOC and the document’s heading structure, TOC style, and regeneration logic.&lt;/p&gt;
&lt;p data-end=&quot;1856&quot; data-start=&quot;1690&quot;&gt;The problem for automation is simple: whatever InDesign uses internally, it is not exposed in a way that makes frame-level detection reliable from the scripting side.&lt;/p&gt;
&lt;p data-end=&quot;1967&quot; data-start=&quot;1858&quot;&gt;This is where many automation attempts go wrong. What looks simple in the UI is not always simple in the DOM.&lt;/p&gt;
&lt;h2 data-end=&quot;2014&quot; data-section-id=&quot;1gafr4z&quot; data-start=&quot;1969&quot;&gt;There is no simple “is this TOC?” property&lt;/h2&gt;
&lt;p data-end=&quot;2049&quot; data-start=&quot;2016&quot;&gt;This is the practical limitation.&lt;/p&gt;
&lt;p data-end=&quot;2249&quot; data-start=&quot;2051&quot;&gt;You can create a TOC. You can define TOC styles. But when you scan document stories or text frames, there is no clean, obvious, automation-safe property that tells you, “Yes, this is the TOC frame.”&lt;/p&gt;
&lt;p data-end=&quot;2348&quot; data-start=&quot;2251&quot;&gt;That means any script that tries to detect TOC by inspection is already operating on weak ground.&lt;/p&gt;
&lt;p data-end=&quot;2873&quot; data-start=&quot;2350&quot;&gt;You can guess. You can infer. You can build heuristics. But you cannot depend on a robust and explicit TOC flag in the way many automation workflows would ideally require. Even in the UXP era, this remains fundamentally a document-model problem, not just a scripting-engine problem. Adobe clearly supports UXP scripting and provides migration guidance from older platforms, but that does not automatically mean every internal document structure is fully exposed for reliable detection. &lt;span class=&quot;&quot; data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-end=&quot;2954&quot; data-start=&quot;2875&quot;&gt;And in production, weak detection logic quickly turns into unstable automation.&lt;/p&gt;
&lt;h2 data-end=&quot;2994&quot; data-section-id=&quot;zj0mr7&quot; data-start=&quot;2956&quot;&gt;Why this matters in real production&lt;/h2&gt;
&lt;p data-end=&quot;3039&quot; data-start=&quot;2996&quot;&gt;This is not just a technical inconvenience.&lt;/p&gt;
&lt;p data-end=&quot;3304&quot; data-start=&quot;3041&quot;&gt;In multilingual DTP workflows, TOC is often one of the most fragile parts of a document. After translation, headings get longer, line breaks change, page flow shifts, and the TOC often needs to be updated. That is already a sensitive moment in the layout process.&lt;/p&gt;
&lt;p data-end=&quot;3343&quot; data-start=&quot;3306&quot;&gt;Now add automation to that situation.&lt;/p&gt;
&lt;p data-end=&quot;3593&quot; data-start=&quot;3345&quot;&gt;If your script cannot safely identify which frame is the actual TOC, then every downstream action becomes risky. You may update the wrong content. You may miss the TOC entirely. You may trigger layout changes in a place you did not intend to touch.&lt;/p&gt;
&lt;p data-end=&quot;3821&quot; data-start=&quot;3595&quot;&gt;And once a TOC expands or reflows, the effect is rarely isolated. In multilingual documents, one TOC change can push text onto the next page, create overset, shift anchored objects, or break carefully balanced page structures.&lt;/p&gt;
&lt;p data-end=&quot;3920&quot; data-start=&quot;3823&quot;&gt;In other words, TOC is not just a generated list. In production, it is a layout-sensitive object.&lt;/p&gt;
&lt;p data-end=&quot;4069&quot; data-start=&quot;3922&quot;&gt;That is why the real question is not “Can InDesign update a TOC?”&lt;br data-end=&quot;3990&quot; data-start=&quot;3987&quot; /&gt;
The real question is “Can this be handled safely inside an automated workflow?”&lt;/p&gt;
&lt;h2 data-end=&quot;4115&quot; data-section-id=&quot;zb85s7&quot; data-start=&quot;4071&quot;&gt;Why detection-based automation is fragile&lt;/h2&gt;
&lt;p data-end=&quot;4175&quot; data-start=&quot;4117&quot;&gt;A common instinct is to solve this with smarter detection.&lt;/p&gt;
&lt;p data-end=&quot;4229&quot; data-start=&quot;4177&quot;&gt;For example, a script might assume that a TOC frame:&lt;/p&gt;
&lt;ul data-end=&quot;4436&quot; data-start=&quot;4231&quot;&gt;
&lt;li data-end=&quot;4264&quot; data-section-id=&quot;1gwprog&quot; data-start=&quot;4231&quot;&gt;
uses a specific paragraph style
&lt;/li&gt;
&lt;li data-end=&quot;4309&quot; data-section-id=&quot;3m4p0b&quot; data-start=&quot;4265&quot;&gt;
appears near the beginning of the document
&lt;/li&gt;
&lt;li data-end=&quot;4359&quot; data-section-id=&quot;1vh2uft&quot; data-start=&quot;4310&quot;&gt;
contains a predictable title such as “Contents”
&lt;/li&gt;
&lt;li data-end=&quot;4386&quot; data-section-id=&quot;czv3ct&quot; data-start=&quot;4360&quot;&gt;
sits on a dedicated page
&lt;/li&gt;
&lt;li data-end=&quot;4436&quot; data-section-id=&quot;1y5v04h&quot; data-start=&quot;4387&quot;&gt;
includes page numbers in a recognizable pattern
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;4459&quot; data-start=&quot;4438&quot;&gt;Sometimes this works.&lt;/p&gt;
&lt;p data-end=&quot;4511&quot; data-start=&quot;4461&quot;&gt;The problem is that it often works only by chance.&lt;/p&gt;
&lt;p data-end=&quot;4805&quot; data-start=&quot;4513&quot;&gt;And “it works by chance” is one of the most dangerous states in production automation. It creates false confidence. A script appears successful in one template, one language, or one document family, then quietly fails when a different template, language, or editorial variation is introduced.&lt;/p&gt;
&lt;p data-end=&quot;4954&quot; data-start=&quot;4807&quot;&gt;This is especially risky in multilingual workflows, where layout conventions, naming, language length, and TOC formatting can vary across editions.&lt;/p&gt;
&lt;p data-end=&quot;5029&quot; data-start=&quot;4956&quot;&gt;If identification is ambiguous, automation becomes a reliability problem.&lt;/p&gt;
&lt;p data-end=&quot;5179&quot; data-start=&quot;5031&quot;&gt;That is the real turning point: some problems should not be solved by increasingly clever detection logic. They should be solved by document design.&lt;/p&gt;
&lt;h2 data-end=&quot;5228&quot; data-section-id=&quot;3l54jf&quot; data-start=&quot;5181&quot;&gt;A better approach: design for identification&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/04/why-toc-is-hard-to-automate-in-indesign/01.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Diagram comparing a person who identifies the TOC frame by its appearance with a script that identifies it by a script label ID&quot; border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1408&quot; height=&quot;310&quot; src=&quot;/images/2026/04/why-toc-is-hard-to-automate-in-indesign/01.png&quot; width=&quot;566&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p data-end=&quot;5281&quot; data-start=&quot;5230&quot;&gt;The safer approach is not to guess what the TOC is.&lt;/p&gt;
&lt;p data-end=&quot;5344&quot; data-start=&quot;5283&quot;&gt;The safer approach is to make the TOC identifiable by design.&lt;/p&gt;
&lt;p data-end=&quot;5568&quot; data-start=&quot;5346&quot;&gt;That means embedding reliable structure into the document so automation does not depend on interpretation. Instead of asking a script to infer whether a frame is a TOC, make that information explicit in the file structure.&lt;/p&gt;
&lt;p data-end=&quot;5618&quot; data-start=&quot;5570&quot;&gt;Depending on your workflow, that can mean using:&lt;/p&gt;
&lt;ul data-end=&quot;5772&quot; data-start=&quot;5620&quot;&gt;
&lt;li data-end=&quot;5649&quot; data-section-id=&quot;1sumdhn&quot; data-start=&quot;5620&quot;&gt;
a dedicated paragraph style
&lt;/li&gt;
&lt;li data-end=&quot;5676&quot; data-section-id=&quot;p2k180&quot; data-start=&quot;5650&quot;&gt;
a dedicated object style
&lt;/li&gt;
&lt;li data-end=&quot;5696&quot; data-section-id=&quot;198zhxt&quot; data-start=&quot;5677&quot;&gt;
a dedicated layer
&lt;/li&gt;
&lt;li data-end=&quot;5720&quot; data-section-id=&quot;10zapai&quot; data-start=&quot;5697&quot;&gt;
fixed placement rules
&lt;/li&gt;
&lt;li data-end=&quot;5772&quot; data-section-id=&quot;ozatrx&quot; data-start=&quot;5721&quot;&gt;
a script label attached to the relevant page item
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;6147&quot; data-start=&quot;5774&quot;&gt;This last option is especially practical. In InDesign’s object model, page items support labels and key-value style metadata methods such as &lt;code data-end=&quot;5930&quot; data-start=&quot;5915&quot;&gt;insertLabel()&lt;/code&gt; and &lt;code data-end=&quot;5951&quot; data-start=&quot;5935&quot;&gt;extractLabel()&lt;/code&gt;, which makes them useful as lightweight automation identifiers. In real workflows, that is often far more reliable than guessing from layout or text content. &lt;span class=&quot;&quot; data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-end=&quot;6233&quot; data-start=&quot;6149&quot;&gt;The safest automation is often not smarter detection, but better document structure.&lt;/p&gt;
&lt;p data-end=&quot;6422&quot; data-start=&quot;6235&quot;&gt;Once you adopt that mindset, the whole problem changes. You are no longer trying to reverse-engineer the file. You are designing the file so automation can work safely from the beginning.&lt;/p&gt;
&lt;h2 data-end=&quot;6475&quot; data-section-id=&quot;172dbnb&quot; data-start=&quot;6424&quot;&gt;In some cases, regeneration is safer than update&lt;/h2&gt;
&lt;p data-end=&quot;6533&quot; data-start=&quot;6477&quot;&gt;There is another practical shift that follows from this.&lt;/p&gt;
&lt;p data-end=&quot;6595&quot; data-start=&quot;6535&quot;&gt;If detection is weak, regeneration may be safer than update.&lt;/p&gt;
&lt;p data-end=&quot;6743&quot; data-start=&quot;6597&quot;&gt;Instead of trying to find an existing TOC frame and update it in place, you may get a more stable workflow by treating TOC as a controlled output:&lt;/p&gt;
&lt;ol data-end=&quot;6947&quot; data-start=&quot;6745&quot;&gt;
&lt;li data-end=&quot;6808&quot; data-section-id=&quot;q8ilau&quot; data-start=&quot;6745&quot;&gt;
identify the target area through explicit document structure
&lt;/li&gt;
&lt;li data-end=&quot;6853&quot; data-section-id=&quot;9t8yoy&quot; data-start=&quot;6809&quot;&gt;
remove the old TOC under known conditions
&lt;/li&gt;
&lt;li data-end=&quot;6902&quot; data-section-id=&quot;1kjn9uj&quot; data-start=&quot;6854&quot;&gt;
regenerate the TOC from the correct TOC style
&lt;/li&gt;
&lt;li data-end=&quot;6947&quot; data-section-id=&quot;awgnzt&quot; data-start=&quot;6903&quot;&gt;
place it back into a known layout context
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;6998&quot; data-start=&quot;6949&quot;&gt;This has an important advantage beyond stability.&lt;/p&gt;
&lt;p data-end=&quot;7364&quot; data-start=&quot;7000&quot;&gt;Regeneration does not just rebuild content. It also lets you reapply the correct TOC style every time. That matters in real production, because hand-adjusted formatting often accumulates over time. If someone manually tweaks the TOC, an “update” workflow may preserve unwanted leftovers. A regeneration workflow gives you a cleaner reset to the intended structure.&lt;/p&gt;
&lt;p data-end=&quot;7627&quot; data-start=&quot;7366&quot;&gt;Of course, this only works well when the surrounding rules are controlled. If placement, style usage, and layout boundaries are undefined, regeneration can be just as risky. But in a template-driven workflow, regeneration is often the more predictable strategy.&lt;/p&gt;
&lt;p data-end=&quot;7666&quot; data-start=&quot;7629&quot;&gt;Not because it is more sophisticated.&lt;/p&gt;
&lt;p data-end=&quot;7700&quot; data-start=&quot;7668&quot;&gt;Because it is more controllable.&lt;/p&gt;
&lt;h2 data-end=&quot;7742&quot; data-section-id=&quot;13but2j&quot; data-start=&quot;7702&quot;&gt;What this means for automation design&lt;/h2&gt;
&lt;p data-end=&quot;7781&quot; data-start=&quot;7744&quot;&gt;This is not really a TOC-only lesson.&lt;/p&gt;
&lt;p data-end=&quot;7826&quot; data-start=&quot;7783&quot;&gt;It is a broader InDesign automation lesson.&lt;/p&gt;
&lt;p data-end=&quot;8039&quot; data-start=&quot;7828&quot;&gt;Some parts of a document are easy to automate because the DOM exposes them clearly. Some are hard not because they are conceptually complex, but because the information you need is not exposed in a reliable way.&lt;/p&gt;
&lt;p data-end=&quot;8093&quot; data-start=&quot;8041&quot;&gt;When that happens, there are two possible responses.&lt;/p&gt;
&lt;p data-end=&quot;8184&quot; data-start=&quot;8095&quot;&gt;One is to keep adding more detection logic, more exceptions, and more edge-case handling.&lt;/p&gt;
&lt;p data-end=&quot;8259&quot; data-start=&quot;8186&quot;&gt;The other is to redesign the workflow so identification becomes explicit.&lt;/p&gt;
&lt;p data-end=&quot;8295&quot; data-start=&quot;8261&quot;&gt;The second path is usually better.&lt;/p&gt;
&lt;p data-end=&quot;8488&quot; data-start=&quot;8297&quot;&gt;If your automation depends on fragile guessing, the real fix is often not better code. It is better structure. Better naming. Better labels. Better layout rules. Better production discipline.&lt;/p&gt;
&lt;p data-end=&quot;8538&quot; data-start=&quot;8490&quot;&gt;That is the real shift from detection to design.&lt;/p&gt;
&lt;p data-end=&quot;8637&quot; data-start=&quot;8540&quot;&gt;And once you make that shift, your scripts usually become simpler, safer, and easier to maintain.&lt;/p&gt;
&lt;h2 data-end=&quot;8652&quot; data-section-id=&quot;8dtpi&quot; data-start=&quot;8639&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p data-end=&quot;8750&quot; data-start=&quot;8654&quot;&gt;TOC is one of those classic InDesign cases where the UI makes something look simpler than it is.&lt;/p&gt;
&lt;p data-end=&quot;8783&quot; data-start=&quot;8752&quot;&gt;Yes, InDesign can update a TOC.&lt;/p&gt;
&lt;p data-end=&quot;8989&quot; data-start=&quot;8785&quot;&gt;But from the scripting side, reliably identifying a TOC as a specific frame or story is much harder than many people expect. That is why TOC automation often becomes brittle when it is built on inference.&lt;/p&gt;
&lt;p data-end=&quot;9095&quot; data-start=&quot;8991&quot;&gt;The practical solution is not to write increasingly clever code that tries to guess what the file means.&lt;/p&gt;
&lt;p data-end=&quot;9182&quot; data-start=&quot;9097&quot;&gt;The practical solution is to make the file readable to automation in the first place.&lt;/p&gt;
&lt;p data-end=&quot;9312&quot; data-start=&quot;9184&quot;&gt;When the DOM is a black box, document structure has to become your map.&lt;br data-end=&quot;9258&quot; data-start=&quot;9255&quot; /&gt;
Stop guessing in code. Start designing for automation.&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>Scaling Multilingual DTP by Detecting Objects Outside the Layout (Low Judgment Workflows)</title>
    <id>https://www.linguist-coder.com/2026/04/scaling-multilingual-dtp-by-detecting.html</id>
    <link href="https://www.linguist-coder.com/2026/04/scaling-multilingual-dtp-by-detecting.html"/>
    <published>2026-04-10T22:48:00.000Z</published>
    <updated>2026-04-10T22:48:28.515Z</updated>
    <summary>Where this fits in the series This article completes the automation prioritization framework. In this series, we looked at three key dimensions: What should you automate first High frequency tasks High instability workflows And now, the final piece: Low Judgment…</summary>
    <content type="html">&lt;p&gt;&lt;/p&gt;&lt;h2 data-end=&quot;204&quot; data-section-id=&quot;5rp1f&quot; data-start=&quot;172&quot;&gt;Where this fits in the series&lt;/h2&gt;&lt;p data-end=&quot;273&quot; data-start=&quot;206&quot;&gt;&lt;strong data-end=&quot;273&quot; data-start=&quot;206&quot;&gt;This article completes the automation prioritization framework.&lt;/strong&gt;&lt;/p&gt;&lt;p data-end=&quot;325&quot; data-start=&quot;275&quot;&gt;In this series, we looked at three key dimensions:&lt;/p&gt;&lt;ul data-end=&quot;417&quot; data-start=&quot;327&quot;&gt;&lt;li data-end=&quot;361&quot; data-section-id=&quot;1li4xb4&quot; data-start=&quot;327&quot;&gt;What should you automate first&lt;/li&gt;&lt;li data-end=&quot;386&quot; data-section-id=&quot;1dhkk64&quot; data-start=&quot;362&quot;&gt;High frequency tasks&lt;/li&gt;&lt;li data-end=&quot;417&quot; data-section-id=&quot;1o99i84&quot; data-start=&quot;387&quot;&gt;High instability workflows&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;444&quot; data-start=&quot;419&quot;&gt;And now, the final piece:&lt;/p&gt;&lt;ul data-end=&quot;474&quot; data-start=&quot;446&quot;&gt;&lt;li data-end=&quot;474&quot; data-section-id=&quot;188cq4y&quot; data-start=&quot;446&quot;&gt;&lt;strong data-end=&quot;474&quot; data-start=&quot;448&quot;&gt;Low Judgment workflows&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;532&quot; data-start=&quot;476&quot;&gt;This is where automation becomes both safe and scalable.&lt;/p&gt;&lt;hr data-end=&quot;537&quot; data-start=&quot;534&quot; /&gt;&lt;h2 data-end=&quot;589&quot; data-section-id=&quot;1kpplyu&quot; data-start=&quot;539&quot;&gt;The problem: invisible objects that still exist&lt;/h2&gt;&lt;p data-end=&quot;641&quot; data-start=&quot;591&quot;&gt;In multilingual DTP, not all problems are visible.&lt;/p&gt;&lt;p data-end=&quot;697&quot; data-start=&quot;643&quot;&gt;Objects outside the layout area are a typical example.&lt;/p&gt;&lt;ul data-end=&quot;831&quot; data-start=&quot;699&quot;&gt;&lt;li data-end=&quot;740&quot; data-section-id=&quot;1fiie2&quot; data-start=&quot;699&quot;&gt;They don’t appear in the final output&lt;/li&gt;&lt;li data-end=&quot;780&quot; data-section-id=&quot;mw3bp6&quot; data-start=&quot;741&quot;&gt;They don’t trigger obvious warnings&lt;/li&gt;&lt;li data-end=&quot;831&quot; data-section-id=&quot;1i0re8i&quot; data-start=&quot;781&quot;&gt;But they still exist in the document structure&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;882&quot; data-start=&quot;833&quot;&gt;And because of that, they quietly introduce risk.&lt;/p&gt;&lt;hr data-end=&quot;887&quot; data-start=&quot;884&quot; /&gt;&lt;h2 data-end=&quot;926&quot; data-section-id=&quot;abddov&quot; data-start=&quot;889&quot;&gt;Why this is a Low Judgment problem&lt;/h2&gt;&lt;p data-end=&quot;992&quot; data-start=&quot;928&quot;&gt;&lt;strong data-end=&quot;992&quot; data-start=&quot;928&quot;&gt;Low Judgment tasks are the safest place to start automation.&lt;/strong&gt;&lt;/p&gt;&lt;p data-end=&quot;1039&quot; data-start=&quot;994&quot;&gt;This type of issue has three characteristics:&lt;/p&gt;&lt;ul data-end=&quot;1124&quot; data-start=&quot;1041&quot;&gt;&lt;li data-end=&quot;1067&quot; data-section-id=&quot;ey5jci&quot; data-start=&quot;1041&quot;&gt;detection is objective&lt;/li&gt;&lt;li data-end=&quot;1093&quot; data-section-id=&quot;dtazaz&quot; data-start=&quot;1068&quot;&gt;action is predictable&lt;/li&gt;&lt;li data-end=&quot;1124&quot; data-section-id=&quot;58pfyq&quot; data-start=&quot;1094&quot;&gt;decision complexity is low&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;1157&quot; data-start=&quot;1126&quot;&gt;For objects outside the layout:&lt;/p&gt;&lt;ul data-end=&quot;1232&quot; data-start=&quot;1159&quot;&gt;&lt;li data-end=&quot;1190&quot; data-section-id=&quot;4m42f&quot; data-start=&quot;1159&quot;&gt;“Is it outside?” → Yes / No&lt;/li&gt;&lt;li data-end=&quot;1232&quot; data-section-id=&quot;163ir4r&quot; data-start=&quot;1191&quot;&gt;“Should it exist?” → Almost always No&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;1291&quot; data-start=&quot;1234&quot;&gt;This is exactly what defines a &lt;strong data-end=&quot;1290&quot; data-start=&quot;1265&quot;&gt;Low Judgment workflow&lt;/strong&gt;.&lt;/p&gt;&lt;hr data-end=&quot;1296&quot; data-start=&quot;1293&quot; /&gt;&lt;h2 data-end=&quot;1341&quot; data-section-id=&quot;vawt96&quot; data-start=&quot;1298&quot;&gt;Why “invisible” does not mean “harmless”&lt;/h2&gt;&lt;p data-end=&quot;1424&quot; data-start=&quot;1343&quot;&gt;&lt;strong data-end=&quot;1424&quot; data-start=&quot;1343&quot;&gt;Hidden objects are not harmless — they introduce ambiguity into the document.&lt;/strong&gt;&lt;/p&gt;&lt;p data-end=&quot;1502&quot; data-start=&quot;1426&quot;&gt;Because these objects are not visible in the layout, they are often ignored.&lt;/p&gt;&lt;p data-end=&quot;1579&quot; data-start=&quot;1504&quot;&gt;However, in real workflows, they can cause problems across multiple layers:&lt;/p&gt;&lt;ul data-end=&quot;2057&quot; data-start=&quot;1581&quot;&gt;&lt;li data-end=&quot;1699&quot; data-section-id=&quot;19v0zeh&quot; data-start=&quot;1581&quot;&gt;&lt;strong data-end=&quot;1611&quot; data-start=&quot;1583&quot;&gt;CAT tools (e.g., Trados)&lt;/strong&gt; may count them as translation content&lt;br data-end=&quot;1652&quot; data-start=&quot;1649&quot; /&gt;→ increasing workload and cost unexpectedly&lt;/li&gt;&lt;li data-end=&quot;1805&quot; data-section-id=&quot;wf4iux&quot; data-start=&quot;1701&quot;&gt;&lt;strong data-end=&quot;1726&quot; data-start=&quot;1703&quot;&gt;Packaging workflows&lt;/strong&gt; may exclude them&lt;br data-end=&quot;1746&quot; data-start=&quot;1743&quot; /&gt;→ causing missing link errors when files are handed off&lt;/li&gt;&lt;li data-end=&quot;1920&quot; data-section-id=&quot;orrbeb&quot; data-start=&quot;1807&quot;&gt;&lt;strong data-end=&quot;1835&quot; data-start=&quot;1809&quot;&gt;Scripts and automation&lt;/strong&gt; may pick them up as valid objects&lt;br data-end=&quot;1872&quot; data-start=&quot;1869&quot; /&gt;→ introducing noise and reducing reliability&lt;/li&gt;&lt;li data-end=&quot;2057&quot; data-section-id=&quot;10a1r5l&quot; data-start=&quot;1922&quot;&gt;&lt;strong data-end=&quot;1954&quot; data-start=&quot;1924&quot;&gt;Handover between operators&lt;/strong&gt; becomes less predictable&lt;br data-end=&quot;1982&quot; data-start=&quot;1979&quot; /&gt;→ it is no longer clear which objects are intentional and which are not&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;2135&quot; data-start=&quot;2059&quot;&gt;Even though each issue is small,&lt;br data-end=&quot;2094&quot; data-start=&quot;2091&quot; /&gt;they all come from the same root problem:&lt;/p&gt;&lt;p data-end=&quot;2194&quot; data-start=&quot;2137&quot;&gt;→ &lt;strong data-end=&quot;2194&quot; data-start=&quot;2139&quot;&gt;the document contains objects that should not exist&lt;/strong&gt;&lt;/p&gt;&lt;hr data-end=&quot;2199&quot; data-start=&quot;2196&quot; /&gt;&lt;h2 data-end=&quot;2229&quot; data-section-id=&quot;1lq0yav&quot; data-start=&quot;2201&quot;&gt;Why manual handling fails&lt;/h2&gt;&lt;p data-end=&quot;2288&quot; data-start=&quot;2231&quot;&gt;Even if the decision is simple,&lt;br data-end=&quot;2265&quot; data-start=&quot;2262&quot; /&gt;manual handling is not.&lt;/p&gt;&lt;ul data-end=&quot;2395&quot; data-start=&quot;2290&quot;&gt;&lt;li data-end=&quot;2322&quot; data-section-id=&quot;jajvyn&quot; data-start=&quot;2290&quot;&gt;you don’t know where to look&lt;/li&gt;&lt;li data-end=&quot;2356&quot; data-section-id=&quot;yvusqu&quot; data-start=&quot;2323&quot;&gt;you don’t know how many exist&lt;/li&gt;&lt;li data-end=&quot;2395&quot; data-section-id=&quot;t87vo8&quot; data-start=&quot;2357&quot;&gt;you don’t notice them consistently&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;2414&quot; data-start=&quot;2397&quot;&gt;So the result is:&lt;/p&gt;&lt;p data-end=&quot;2445&quot; data-start=&quot;2416&quot;&gt;→ ignored problems accumulate&lt;/p&gt;&lt;p data-end=&quot;2484&quot; data-start=&quot;2447&quot;&gt;This is typical of Low Judgment work:&lt;/p&gt;&lt;ul data-end=&quot;2529&quot; data-start=&quot;2486&quot;&gt;&lt;li data-end=&quot;2504&quot; data-section-id=&quot;1oo6rcn&quot; data-start=&quot;2486&quot;&gt;easy to decide&lt;/li&gt;&lt;li data-end=&quot;2529&quot; data-section-id=&quot;1l235fb&quot; data-start=&quot;2505&quot;&gt;but easy to overlook&lt;/li&gt;&lt;/ul&gt;&lt;hr data-end=&quot;2534&quot; data-start=&quot;2531&quot; /&gt;&lt;h2 data-end=&quot;2583&quot; data-section-id=&quot;9reyf1&quot; data-start=&quot;2536&quot;&gt;A minimal approach: detect → count → confirm&lt;/h2&gt;&lt;p data-end=&quot;2634&quot; data-start=&quot;2585&quot;&gt;&lt;strong data-end=&quot;2634&quot; data-start=&quot;2585&quot;&gt;Low Judgment does not mean “fully automatic.”&lt;/strong&gt;&lt;/p&gt;&lt;p data-end=&quot;2662&quot; data-start=&quot;2636&quot;&gt;The correct first step is:&lt;/p&gt;&lt;ul data-end=&quot;2699&quot; data-start=&quot;2664&quot;&gt;&lt;li data-end=&quot;2674&quot; data-section-id=&quot;1rextxr&quot; data-start=&quot;2664&quot;&gt;detect&lt;/li&gt;&lt;li data-end=&quot;2687&quot; data-section-id=&quot;1v5p1k1&quot; data-start=&quot;2675&quot;&gt;quantify&lt;/li&gt;&lt;li data-end=&quot;2699&quot; data-section-id=&quot;1bbbauy&quot; data-start=&quot;2688&quot;&gt;confirm&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;2744&quot; data-start=&quot;2701&quot;&gt;This keeps control while removing friction.&lt;/p&gt;&lt;hr data-end=&quot;2749&quot; data-start=&quot;2746&quot; /&gt;

&lt;h3 data-end=&quot;2878&quot; data-section-id=&quot;1c0viu2&quot; data-start=&quot;2846&quot;&gt;Sample script (InDesign JSX)&lt;/h3&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/vuT3xbUdJzY&quot; width=&quot;320&quot; youtube-src-id=&quot;vuT3xbUdJzY&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;

&lt;div&gt;&lt;div style=&quot;background: rgb(31, 41, 55); border-radius: 10px; border: 1px solid rgb(55, 65, 81); color: #f9fafb; margin: 20px 0px; padding: 18px;&quot;&gt;
  &lt;div style=&quot;color: #f9fafb; font-size: 18px; font-weight: 700; margin-bottom: 8px;&quot;&gt;
    Want the ready-to-use version?
  &lt;/div&gt;
  &lt;div style=&quot;color: #d1d5db; font-size: 15px; line-height: 1.6; margin-bottom: 14px;&quot;&gt;
    Skip the copy-paste and download the script directly from Gumroad.
  &lt;/div&gt;
  &lt;a href=&quot;https://linguistcoder.gumroad.com/l/pasteboard-object-cleaner&quot; style=&quot;background: rgb(79, 70, 229); border-radius: 8px; color: white; display: inline-block; font-weight: 600; padding: 10px 16px; text-decoration: none;&quot;&gt;
    Download on Gumroad (Free) →
  &lt;/a&gt;
&lt;/div&gt;
  
  &lt;pre style=&quot;background: rgb(17, 24, 39); border-radius: 8px; color: #e5e7eb; font-family: Consolas, Monaco, monospace; overflow: auto; padding: 16px; white-space: pre;&quot;&gt;&lt;code&gt;#target indesign

(function () {
    function isTopLevelPasteboardItem(item) {
        if (!item || !item.isValid) {
            return false;
        }

        if (item.parentPage !== null) {
            return false;
        }

        try {
            var parent = item.parent;

            // Avoid double-counting children inside groups or other containers.
            if (parent &amp;amp;&amp;amp; parent.hasOwnProperty(&quot;parentPage&quot;)) {
                return false;
            }
        } catch (e) {}

        return true;
    }

    if (app.documents.length === 0) {
        alert(&quot;No documents are open.&quot;);
        return;
    }

    var doc = app.activeDocument;
    var pasteboardItems = [];

    var items = doc.allPageItems;

    for (var i = 0; i &amp;lt; items.length; i++) {
        try {
            if (isTopLevelPasteboardItem(items[i])) {
                pasteboardItems.push(items[i]);
            }
        } catch (e) {}
    }

    var count = pasteboardItems.length;

    if (count === 0) {
        alert(&quot;No pasteboard objects were found.&quot;);
        return;
    }

    var confirmDelete = confirm(
        &quot;Found &quot; + count + &quot; pasteboard object(s).\n\nDelete them?&quot;
    );

    if (!confirmDelete) return;

    var deletedCount = 0;
    var failedCount = 0;

    for (var j = pasteboardItems.length - 1; j &amp;gt;= 0; j--) {
        try {
            if (pasteboardItems[j].isValid) {
                pasteboardItems[j].remove();
                deletedCount++;
            }
        } catch (e) {
            failedCount++;
        }
    }

    if (failedCount &amp;gt; 0) {
        alert(
            &quot;Deleted &quot; + deletedCount + &quot; object(s).\n&quot; +
            &quot;Failed to delete &quot; + failedCount + &quot; object(s).&quot;
        );
        return;
    }

    alert(&quot;Deleted &quot; + deletedCount + &quot; object(s).&quot;);
})();&lt;/code&gt;
&lt;/pre&gt;

&lt;hr data-end=&quot;3826&quot; data-start=&quot;3823&quot; /&gt;&lt;h2 data-end=&quot;3845&quot; data-section-id=&quot;dhunqv&quot; data-start=&quot;3828&quot;&gt;Why this works&lt;/h2&gt;&lt;p data-end=&quot;3909&quot; data-start=&quot;3847&quot;&gt;&lt;strong data-end=&quot;3909&quot; data-start=&quot;3847&quot;&gt;Low Judgment workflows benefit from controlled automation.&lt;/strong&gt;&lt;/p&gt;&lt;p data-end=&quot;3948&quot; data-start=&quot;3911&quot;&gt;This script does not try to be smart.&lt;/p&gt;&lt;p data-end=&quot;3960&quot; data-start=&quot;3950&quot;&gt;It simply:&lt;/p&gt;&lt;ol data-end=&quot;3996&quot; data-start=&quot;3962&quot;&gt;&lt;li data-end=&quot;3974&quot; data-section-id=&quot;1uq48oe&quot; data-start=&quot;3962&quot;&gt;detects&lt;/li&gt;&lt;li data-end=&quot;3986&quot; data-section-id=&quot;mz4mrt&quot; data-start=&quot;3975&quot;&gt;counts&lt;/li&gt;&lt;li data-end=&quot;3996&quot; data-section-id=&quot;156lmfm&quot; data-start=&quot;3987&quot;&gt;asks&lt;/li&gt;&lt;/ol&gt;&lt;p data-end=&quot;4031&quot; data-start=&quot;3998&quot;&gt;This aligns with a key principle:&lt;/p&gt;&lt;ul data-end=&quot;4106&quot; data-start=&quot;4033&quot;&gt;&lt;li data-end=&quot;4049&quot; data-section-id=&quot;1qhef8b&quot; data-start=&quot;4033&quot;&gt;reveal first&lt;/li&gt;&lt;li data-end=&quot;4106&quot; data-section-id=&quot;bl4qjt&quot; data-start=&quot;4050&quot;&gt;automate later&lt;/li&gt;&lt;/ul&gt;&lt;hr data-end=&quot;4111&quot; data-start=&quot;4108&quot; /&gt;&lt;h2 data-end=&quot;4150&quot; data-section-id=&quot;b29k85&quot; data-start=&quot;4113&quot;&gt;From Low Judgment to system design&lt;/h2&gt;&lt;p data-end=&quot;4186&quot; data-start=&quot;4152&quot;&gt;This is not just a cleanup script.&lt;/p&gt;&lt;p data-end=&quot;4221&quot; data-start=&quot;4188&quot;&gt;It represents a reusable pattern:&lt;/p&gt;&lt;ul data-end=&quot;4295&quot; data-start=&quot;4223&quot;&gt;&lt;li data-end=&quot;4246&quot; data-section-id=&quot;86h7r1&quot; data-start=&quot;4223&quot;&gt;invisible → visible&lt;/li&gt;&lt;li data-end=&quot;4271&quot; data-section-id=&quot;gy6lgl&quot; data-start=&quot;4247&quot;&gt;unknown → measurable&lt;/li&gt;&lt;li data-end=&quot;4295&quot; data-section-id=&quot;1cxnawz&quot; data-start=&quot;4272&quot;&gt;implicit → explicit&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;4328&quot; data-start=&quot;4297&quot;&gt;This same structure applies to:&lt;/p&gt;&lt;ul data-end=&quot;4390&quot; data-start=&quot;4330&quot;&gt;&lt;li data-end=&quot;4346&quot; data-section-id=&quot;t7gu6x&quot; data-start=&quot;4330&quot;&gt;overset text&lt;/li&gt;&lt;li data-end=&quot;4364&quot; data-section-id=&quot;1p44kv3&quot; data-start=&quot;4347&quot;&gt;missing links&lt;/li&gt;&lt;li data-end=&quot;4390&quot; data-section-id=&quot;122zxg0&quot; data-start=&quot;4365&quot;&gt;style inconsistencies&lt;/li&gt;&lt;/ul&gt;&lt;hr data-end=&quot;4395&quot; data-start=&quot;4392&quot; /&gt;&lt;h2 data-end=&quot;4428&quot; data-section-id=&quot;3msiiz&quot; data-start=&quot;4397&quot;&gt;Why this matters for scaling&lt;/h2&gt;&lt;p data-end=&quot;4493&quot; data-start=&quot;4430&quot;&gt;&lt;strong data-end=&quot;4493&quot; data-start=&quot;4430&quot;&gt;Low Judgment workflows are where automation scales cleanly.&lt;/strong&gt;&lt;/p&gt;&lt;p data-end=&quot;4503&quot; data-start=&quot;4495&quot;&gt;Because:&lt;/p&gt;&lt;ul data-end=&quot;4588&quot; data-start=&quot;4505&quot;&gt;&lt;li data-end=&quot;4533&quot; data-section-id=&quot;vcdr5p&quot; data-start=&quot;4505&quot;&gt;decisions are consistent&lt;/li&gt;&lt;li data-end=&quot;4560&quot; data-section-id=&quot;m63vny&quot; data-start=&quot;4534&quot;&gt;edge cases are limited&lt;/li&gt;&lt;li data-end=&quot;4588&quot; data-section-id=&quot;1d9jn49&quot; data-start=&quot;4561&quot;&gt;behavior is predictable&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;4616&quot; data-start=&quot;4590&quot;&gt;This makes them ideal for:&lt;/p&gt;&lt;ul data-end=&quot;4670&quot; data-start=&quot;4618&quot;&gt;&lt;li data-end=&quot;4637&quot; data-section-id=&quot;1dmbtr1&quot; data-start=&quot;4618&quot;&gt;standardization&lt;/li&gt;&lt;li data-end=&quot;4647&quot; data-section-id=&quot;frcb4s&quot; data-start=&quot;4638&quot;&gt;reuse&lt;/li&gt;&lt;li data-end=&quot;4670&quot; data-section-id=&quot;1am866r&quot; data-start=&quot;4648&quot;&gt;system integration&lt;/li&gt;&lt;/ul&gt;&lt;hr data-end=&quot;4675&quot; data-start=&quot;4672&quot; /&gt;&lt;h2 data-end=&quot;4694&quot; data-section-id=&quot;i25d30&quot; data-start=&quot;4677&quot;&gt;Final takeaway&lt;/h2&gt;&lt;p data-end=&quot;4739&quot; data-start=&quot;4696&quot;&gt;&lt;strong data-end=&quot;4739&quot; data-start=&quot;4696&quot;&gt;Start automation where judgment is low.&lt;/strong&gt;&lt;/p&gt;&lt;p data-end=&quot;4792&quot; data-start=&quot;4741&quot;&gt;Not because it is easy,&lt;br data-end=&quot;4767&quot; data-start=&quot;4764&quot; /&gt;but because it is stable.&lt;/p&gt;&lt;ul data-end=&quot;4882&quot; data-start=&quot;4794&quot;&gt;&lt;li data-end=&quot;4821&quot; data-section-id=&quot;p2j636&quot; data-start=&quot;4794&quot;&gt;High frequency → impact&lt;/li&gt;&lt;li data-end=&quot;4854&quot; data-section-id=&quot;183syin&quot; data-start=&quot;4822&quot;&gt;High instability → necessity&lt;/li&gt;&lt;li data-end=&quot;4882&quot; data-section-id=&quot;7a8uak&quot; data-start=&quot;4855&quot;&gt;&lt;strong data-end=&quot;4882&quot; data-start=&quot;4857&quot;&gt;Low Judgment → safety&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;4952&quot; data-start=&quot;4884&quot;&gt;And when all three align,&lt;br data-end=&quot;4912&quot; data-start=&quot;4909&quot; /&gt;you get automation that actually scales.&lt;/p&gt;&lt;/div&gt;</content>
  </entry>

  <entry>
    <title>High Instability in Multilingual DTP</title>
    <id>https://www.linguist-coder.com/2026/03/high-instability-in-multilingual-dtp.html</id>
    <link href="https://www.linguist-coder.com/2026/03/high-instability-in-multilingual-dtp.html"/>
    <published>2026-03-28T22:25:00.000Z</published>
    <updated>2026-03-28T22:25:33.323Z</updated>
    <summary>Introduction In multilingual DTP, some problems are not difficult — but they are dangerous. Imagine this: You have just finished updating a document in 20 languages. All corrections are complete. All verification checks are done. The project is ready for…</summary>
    <content type="html">&lt;h2 style=&quot;text-align: left;&quot;&gt;Introduction&lt;/h2&gt;
&lt;p data-end=&quot;233&quot; data-start=&quot;155&quot;&gt;In multilingual DTP, some problems are not difficult — but they are dangerous.&lt;/p&gt;
&lt;p data-end=&quot;248&quot; data-start=&quot;235&quot;&gt;Imagine this:&lt;/p&gt;
&lt;p data-end=&quot;412&quot; data-start=&quot;250&quot;&gt;You have just finished updating a document in 20 languages.&lt;br data-end=&quot;312&quot; data-start=&quot;309&quot; /&gt;
All corrections are complete. All verification checks are done.&lt;br data-end=&quot;378&quot; data-start=&quot;375&quot; /&gt;
The project is ready for delivery.&lt;/p&gt;
&lt;p data-end=&quot;438&quot; data-start=&quot;414&quot;&gt;Then a request comes in:&lt;/p&gt;
&lt;blockquote data-end=&quot;496&quot; data-start=&quot;440&quot;&gt;
&lt;p data-end=&quot;496&quot; data-start=&quot;442&quot;&gt;“This one line is no longer needed. Please remove it.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p data-end=&quot;537&quot; data-start=&quot;498&quot;&gt;For the client, this is a small change.&lt;/p&gt;
&lt;p data-end=&quot;558&quot; data-start=&quot;539&quot;&gt;For you, it is not.&lt;/p&gt;
&lt;ul data-end=&quot;750&quot; data-start=&quot;560&quot;&gt;
&lt;li data-end=&quot;644&quot; data-section-id=&quot;t4vex6&quot; data-start=&quot;560&quot;&gt;
If the layout relies on reflow, a single line change can break the entire layout
&lt;/li&gt;
&lt;li data-end=&quot;699&quot; data-section-id=&quot;xqzqmn&quot; data-start=&quot;645&quot;&gt;
Every page in the document may need to be reviewed
&lt;/li&gt;
&lt;li data-end=&quot;750&quot; data-section-id=&quot;1g0406s&quot; data-start=&quot;700&quot;&gt;
And this must be repeated across all languages
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;777&quot; data-start=&quot;752&quot;&gt;This is not an edge case.&lt;/p&gt;
&lt;p data-end=&quot;830&quot; data-start=&quot;779&quot;&gt;It is a structural property of document production.&lt;/p&gt;
&lt;hr data-end=&quot;835&quot; data-start=&quot;832&quot; /&gt;
&lt;h2 data-end=&quot;882&quot; data-section-id=&quot;17dqwab&quot; data-start=&quot;837&quot;&gt;What Is “Instability” in Multilingual DTP?&lt;/h2&gt;
&lt;p data-end=&quot;945&quot; data-start=&quot;884&quot;&gt;&lt;strong data-end=&quot;945&quot; data-start=&quot;884&quot;&gt;Small changes can produce disproportionate layout shifts.&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;990&quot; data-start=&quot;947&quot;&gt;Instability in multilingual DTP means that:&lt;/p&gt;
&lt;ul data-end=&quot;1075&quot; data-start=&quot;992&quot;&gt;
&lt;li data-end=&quot;1016&quot; data-section-id=&quot;4os4na&quot; data-start=&quot;992&quot;&gt;
a small input change
&lt;/li&gt;
&lt;li data-end=&quot;1075&quot; data-section-id=&quot;ekij79&quot; data-start=&quot;1017&quot;&gt;
produces a large and often unpredictable output change
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1103&quot; data-start=&quot;1077&quot;&gt;A single line can trigger:&lt;/p&gt;
&lt;ul data-end=&quot;1184&quot; data-start=&quot;1105&quot;&gt;
&lt;li data-end=&quot;1120&quot; data-section-id=&quot;1ovip3k&quot; data-start=&quot;1105&quot;&gt;
text reflow
&lt;/li&gt;
&lt;li data-end=&quot;1139&quot; data-section-id=&quot;3qiczm&quot; data-start=&quot;1121&quot;&gt;
frame resizing
&lt;/li&gt;
&lt;li data-end=&quot;1155&quot; data-section-id=&quot;15zqrd4&quot; data-start=&quot;1140&quot;&gt;
page shifts
&lt;/li&gt;
&lt;li data-end=&quot;1184&quot; data-section-id=&quot;dooagg&quot; data-start=&quot;1156&quot;&gt;
cascading layout changes&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/03/high-instability-in-multilingual-dtp/01.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Five threaded text frames in InDesign; a change in one frame reflows text through the rest&quot; border=&quot;0&quot; data-original-height=&quot;486&quot; data-original-width=&quot;851&quot; height=&quot;183&quot; src=&quot;/images/2026/03/high-instability-in-multilingual-dtp/01.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p data-end=&quot;1253&quot; data-start=&quot;1186&quot;&gt;And this effect becomes stronger in multilingual production, where:&lt;/p&gt;
&lt;ul data-end=&quot;1370&quot; data-start=&quot;1255&quot;&gt;
&lt;li data-end=&quot;1292&quot; data-section-id=&quot;q2jy67&quot; data-start=&quot;1255&quot;&gt;
text expansion varies by language
&lt;/li&gt;
&lt;li data-end=&quot;1327&quot; data-section-id=&quot;1xsbzrb&quot; data-start=&quot;1293&quot;&gt;
line breaks behave differently
&lt;/li&gt;
&lt;li data-end=&quot;1370&quot; data-section-id=&quot;4v8lc9&quot; data-start=&quot;1328&quot;&gt;
layout density changes across versions
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1375&quot; data-start=&quot;1372&quot; /&gt;
&lt;h2 data-end=&quot;1401&quot; data-section-id=&quot;n840x1&quot; data-start=&quot;1377&quot;&gt;Why Does This Happen?&lt;/h2&gt;
&lt;p data-end=&quot;1464&quot; data-start=&quot;1403&quot;&gt;&lt;strong data-end=&quot;1464&quot; data-start=&quot;1403&quot;&gt;Layouts are not static — they are interconnected systems.&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;1509&quot; data-start=&quot;1466&quot;&gt;InDesign layouts are not isolated elements.&lt;/p&gt;
&lt;p data-end=&quot;1538&quot; data-start=&quot;1511&quot;&gt;They are connected through:&lt;/p&gt;
&lt;ul data-end=&quot;1598&quot; data-start=&quot;1540&quot;&gt;
&lt;li data-end=&quot;1553&quot; data-section-id=&quot;k5g93&quot; data-start=&quot;1540&quot;&gt;
text flow
&lt;/li&gt;
&lt;li data-end=&quot;1577&quot; data-section-id=&quot;r52htu&quot; data-start=&quot;1554&quot;&gt;
frame relationships
&lt;/li&gt;
&lt;li data-end=&quot;1598&quot; data-section-id=&quot;kw6o6b&quot; data-start=&quot;1578&quot;&gt;
page composition
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1661&quot; data-start=&quot;1600&quot;&gt;A small change in one place can propagate through the system.&lt;/p&gt;
&lt;p data-end=&quot;1720&quot; data-start=&quot;1663&quot;&gt;In multilingual workflows, this instability is amplified:&lt;/p&gt;
&lt;ul data-end=&quot;1840&quot; data-start=&quot;1722&quot;&gt;
&lt;li data-end=&quot;1764&quot; data-section-id=&quot;19cyvfe&quot; data-start=&quot;1722&quot;&gt;
different languages expand differently
&lt;/li&gt;
&lt;li data-end=&quot;1800&quot; data-section-id=&quot;jym39y&quot; data-start=&quot;1765&quot;&gt;
text breaks at different points
&lt;/li&gt;
&lt;li data-end=&quot;1840&quot; data-section-id=&quot;1xllet3&quot; data-start=&quot;1801&quot;&gt;
layout balance shifts unpredictably
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1906&quot; data-start=&quot;1842&quot;&gt;This is why even minor edits can require large-scale rechecking.&lt;/p&gt;
&lt;hr data-end=&quot;1911&quot; data-start=&quot;1908&quot; /&gt;
&lt;h2 data-end=&quot;1940&quot; data-section-id=&quot;1gjn7zl&quot; data-start=&quot;1913&quot;&gt;How Do You Deal With It?&lt;/h2&gt;
&lt;p data-end=&quot;1994&quot; data-start=&quot;1942&quot;&gt;&lt;strong data-end=&quot;1994&quot; data-start=&quot;1942&quot;&gt;Instability cannot be eliminated — only managed.&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;2024&quot; data-start=&quot;1996&quot;&gt;There is no single solution.&lt;/p&gt;
&lt;p data-end=&quot;2086&quot; data-start=&quot;2026&quot;&gt;Instead, there are several strategies, each with trade-offs.&lt;/p&gt;
&lt;hr data-end=&quot;2091&quot; data-start=&quot;2088&quot; /&gt;
&lt;h3 data-end=&quot;2122&quot; data-section-id=&quot;1pth5k0&quot; data-start=&quot;2093&quot;&gt;1. Make the Layout Static&lt;/h3&gt;
&lt;p data-end=&quot;2183&quot; data-start=&quot;2124&quot;&gt;The most straightforward approach is to remove flexibility.&lt;/p&gt;
&lt;ul data-end=&quot;2292&quot; data-start=&quot;2185&quot;&gt;
&lt;li data-end=&quot;2209&quot; data-section-id=&quot;4znhqm&quot; data-start=&quot;2185&quot;&gt;prevent automatic frame expansion&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/03/high-instability-in-multilingual-dtp/02.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Auto-Sizing set to Off in the Text Frame Options dialog&quot; data-original-height=&quot;260&quot; data-original-width=&quot;610&quot; height=&quot;136&quot; src=&quot;/images/2026/03/high-instability-in-multilingual-dtp/02.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul data-end=&quot;2292&quot; data-start=&quot;2185&quot;&gt;
&lt;li data-end=&quot;2292&quot; data-section-id=&quot;1g8bo9z&quot; data-start=&quot;2248&quot;&gt;
ensure each text frame is self-contained*&lt;br /&gt;* You can split text frames using the sample script (&lt;b data-index-in-node=&quot;53&quot; data-path-to-node=&quot;10,2&quot;&gt;Scripts panel &amp;gt; Application &amp;gt; Samples &amp;gt; Split Story&lt;/b&gt;) provided with InDesign.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/03/high-instability-in-multilingual-dtp/03.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Running the Split Story sample script from the Scripts panel on five threaded text frames&quot; border=&quot;0&quot; data-original-height=&quot;579&quot; data-original-width=&quot;1023&quot; height=&quot;181&quot; src=&quot;/images/2026/03/high-instability-in-multilingual-dtp/03.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p data-end=&quot;2328&quot; data-start=&quot;2294&quot;&gt;This limits the impact of changes:&lt;/p&gt;
&lt;ul data-end=&quot;2402&quot; data-start=&quot;2330&quot;&gt;
&lt;li data-end=&quot;2370&quot; data-section-id=&quot;1s45eup&quot; data-start=&quot;2330&quot;&gt;
a line change stays within one frame
&lt;/li&gt;
&lt;li data-end=&quot;2402&quot; data-section-id=&quot;rvehag&quot; data-start=&quot;2371&quot;&gt;
layout shifts are localized
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2412&quot; data-start=&quot;2404&quot;&gt;However:&lt;/p&gt;
&lt;ul data-end=&quot;2530&quot; data-start=&quot;2414&quot;&gt;
&lt;li data-end=&quot;2440&quot; data-section-id=&quot;1u5nj2j&quot; data-start=&quot;2414&quot;&gt;
flexibility is reduced
&lt;/li&gt;
&lt;li data-end=&quot;2481&quot; data-section-id=&quot;9ulygi&quot; data-start=&quot;2441&quot;&gt;
larger edits become harder to handle
&lt;/li&gt;
&lt;li data-end=&quot;2530&quot; data-section-id=&quot;brxnm8&quot; data-start=&quot;2482&quot;&gt;
layout adjustments can become time-consuming
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2599&quot; data-start=&quot;2532&quot;&gt;This approach is robust, but not efficient for everyday production.&lt;/p&gt;
&lt;p data-end=&quot;2692&quot; data-start=&quot;2601&quot;&gt;It is also not always possible — for example, when working with files exported from a CCMS.&lt;/p&gt;
&lt;hr data-end=&quot;2697&quot; data-start=&quot;2694&quot; /&gt;
&lt;h3 data-end=&quot;2731&quot; data-section-id=&quot;klzn8v&quot; data-start=&quot;2699&quot;&gt;2. Introduce Flow Boundaries&lt;/h3&gt;
&lt;p data-end=&quot;2792&quot; data-start=&quot;2733&quot;&gt;Another approach is to limit how far changes can propagate.&lt;/p&gt;
&lt;p data-end=&quot;2814&quot; data-start=&quot;2794&quot;&gt;This can be done by:&lt;/p&gt;
&lt;ul data-end=&quot;2932&quot; data-start=&quot;2816&quot;&gt;
&lt;li data-end=&quot;2859&quot; data-section-id=&quot;1myidtq&quot; data-start=&quot;2816&quot;&gt;
splitting documents at logical sections
&lt;/li&gt;
&lt;li data-end=&quot;2896&quot; data-section-id=&quot;1up0tm&quot; data-start=&quot;2860&quot;&gt;
inserting controlled page breaks (&lt;b&gt;Type&lt;/b&gt; &amp;gt; &lt;b&gt;Insert Break Character&lt;/b&gt;)&lt;/li&gt;
&lt;li data-end=&quot;2932&quot; data-section-id=&quot;1s1k6e4&quot; data-start=&quot;2897&quot;&gt;
leaving buffer space in layouts
&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/03/high-instability-in-multilingual-dtp/04.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;InDesign Type menu open at Insert Break Character, listing Column, Frame, and Page Break&quot; data-original-height=&quot;321&quot; data-original-width=&quot;999&quot; height=&quot;103&quot; src=&quot;/images/2026/03/high-instability-in-multilingual-dtp/04.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p data-end=&quot;2965&quot; data-start=&quot;2934&quot;&gt;This helps contain instability:&lt;/p&gt;
&lt;ul data-end=&quot;3036&quot; data-start=&quot;2967&quot;&gt;
&lt;li data-end=&quot;3004&quot; data-section-id=&quot;1c0q4cs&quot; data-start=&quot;2967&quot;&gt;
the affected area becomes smaller
&lt;/li&gt;
&lt;li data-end=&quot;3036&quot; data-section-id=&quot;djk0q5&quot; data-start=&quot;3005&quot;&gt;
rechecking scope is reduced
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3046&quot; data-start=&quot;3038&quot;&gt;However:&lt;/p&gt;
&lt;ul data-end=&quot;3218&quot; data-start=&quot;3048&quot;&gt;
&lt;li data-end=&quot;3096&quot; data-section-id=&quot;1ik3viv&quot; data-start=&quot;3048&quot;&gt;
too many splits increase management overhead
&lt;/li&gt;
&lt;li data-end=&quot;3158&quot; data-section-id=&quot;1nov8fg&quot; data-start=&quot;3097&quot;&gt;
page breaks only reduce impact — they do not eliminate it
&lt;/li&gt;
&lt;li data-end=&quot;3218&quot; data-section-id=&quot;n36ln9&quot; data-start=&quot;3159&quot;&gt;
larger edits can still break layout beyond the boundary
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3266&quot; data-start=&quot;3220&quot;&gt;This is a mitigation strategy, not a solution.&lt;/p&gt;
&lt;hr data-end=&quot;3271&quot; data-start=&quot;3268&quot; /&gt;
&lt;h3 data-end=&quot;3310&quot; data-section-id=&quot;tfondg&quot; data-start=&quot;3273&quot;&gt;3. Design for Controlled Behavior&lt;/h3&gt;
&lt;p data-end=&quot;3389&quot; data-start=&quot;3312&quot;&gt;A more structural approach is to design layouts that behave more predictably.&lt;/p&gt;
&lt;p data-end=&quot;3443&quot; data-start=&quot;3391&quot;&gt;This is done using paragraph style settings such as:&lt;/p&gt;
&lt;ul data-end=&quot;3544&quot; data-start=&quot;3445&quot;&gt;
&lt;li data-end=&quot;3503&quot; data-section-id=&quot;17ycng2&quot; data-start=&quot;3445&quot;&gt;
Keep Options (&lt;b&gt;Paragraph Styles&lt;/b&gt; panel &amp;gt; &lt;b&gt;Keep Opetions&lt;/b&gt;&amp;nbsp;&amp;gt;&amp;nbsp;&lt;b&gt;Keep Opetions&lt;/b&gt;&amp;nbsp;&amp;gt; &lt;b&gt;Keep with Previous&lt;/b&gt;, &lt;b&gt;Keep Lines Together&lt;/b&gt;)
&lt;/li&gt;
&lt;li data-end=&quot;3544&quot; data-section-id=&quot;z1sdek&quot; data-start=&quot;3504&quot;&gt;
Start Paragraph (e.g., On Next Page)
&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/03/high-instability-in-multilingual-dtp/05.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Keep Options in the Paragraph Style Options dialog, including Keep with Previous, Keep Lines Together, and Start Paragraph&quot; data-original-height=&quot;490&quot; data-original-width=&quot;1061&quot; height=&quot;148&quot; src=&quot;/images/2026/03/high-instability-in-multilingual-dtp/05.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;ul data-end=&quot;3544&quot; data-start=&quot;3445&quot;&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3558&quot; data-start=&quot;3546&quot;&gt;For example:&lt;/p&gt;
&lt;ul data-end=&quot;3659&quot; data-start=&quot;3560&quot;&gt;
&lt;li data-end=&quot;3609&quot; data-section-id=&quot;1gvz1es&quot; data-start=&quot;3560&quot;&gt;
forcing major headings to start on a new page
&lt;/li&gt;
&lt;li data-end=&quot;3659&quot; data-section-id=&quot;151i4ki&quot; data-start=&quot;3610&quot;&gt;
keeping headings and their lead text together
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3711&quot; data-start=&quot;3661&quot;&gt;These settings reduce undesirable layout behavior.&lt;/p&gt;
&lt;p data-end=&quot;3721&quot; data-start=&quot;3713&quot;&gt;However:&lt;/p&gt;
&lt;ul data-end=&quot;3859&quot; data-start=&quot;3723&quot;&gt;
&lt;li data-end=&quot;3761&quot; data-section-id=&quot;cv9b1t&quot; data-start=&quot;3723&quot;&gt;
setup requires time and experience
&lt;/li&gt;
&lt;li data-end=&quot;3814&quot; data-section-id=&quot;1av59us&quot; data-start=&quot;3762&quot;&gt;
optimal settings vary depending on layout design
&lt;/li&gt;
&lt;li data-end=&quot;3859&quot; data-section-id=&quot;1arflnk&quot; data-start=&quot;3815&quot;&gt;
there is no universal best configuration
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3914&quot; data-start=&quot;3861&quot;&gt;Despite this, it is often the most balanced approach:&lt;/p&gt;
&lt;ul data-end=&quot;3999&quot; data-start=&quot;3916&quot;&gt;
&lt;li data-end=&quot;3954&quot; data-section-id=&quot;1fut5tu&quot; data-start=&quot;3916&quot;&gt;
flexible enough for real workflows
&lt;/li&gt;
&lt;li data-end=&quot;3999&quot; data-section-id=&quot;12lnkfx&quot; data-start=&quot;3955&quot;&gt;
stable enough to reduce cascading issues
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;4172&quot; data-start=&quot;4001&quot;&gt;If you want to reduce the impact of layout instability, one practical approach is to design your paragraph styles carefully and reapply them consistently across languages.&lt;/p&gt;
&lt;p data-end=&quot;4288&quot; data-start=&quot;4174&quot;&gt;I’ve written about this approach here:&lt;br data-end=&quot;4215&quot; data-start=&quot;4212&quot; /&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_15.html&quot;&gt;
[Scaling Multilingual DTP by Automating Style Reloads Before Translation]&lt;/a&gt;&lt;/p&gt;
&lt;hr data-end=&quot;4293&quot; data-start=&quot;4290&quot; /&gt;
&lt;h2 data-end=&quot;4334&quot; data-section-id=&quot;wp15al&quot; data-start=&quot;4295&quot;&gt;What These Strategies Have in Common&lt;/h2&gt;
&lt;p data-end=&quot;4376&quot; data-start=&quot;4336&quot;&gt;&lt;strong data-end=&quot;4376&quot; data-start=&quot;4336&quot;&gt;None of these eliminate instability.&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;4413&quot; data-start=&quot;4378&quot;&gt;They only change how you manage it.&lt;/p&gt;
&lt;ul data-end=&quot;4533&quot; data-start=&quot;4415&quot;&gt;
&lt;li data-end=&quot;4452&quot; data-section-id=&quot;106sguc&quot; data-start=&quot;4415&quot;&gt;
Static layouts reduce flexibility
&lt;/li&gt;
&lt;li data-end=&quot;4490&quot; data-section-id=&quot;ykqr6f&quot; data-start=&quot;4453&quot;&gt;
Flow boundaries limit propagation
&lt;/li&gt;
&lt;li data-end=&quot;4533&quot; data-section-id=&quot;kjp739&quot; data-start=&quot;4491&quot;&gt;
Design-based approaches shape behavior
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;4574&quot; data-start=&quot;4535&quot;&gt;But the underlying instability remains.&lt;/p&gt;
&lt;hr data-end=&quot;4579&quot; data-start=&quot;4576&quot; /&gt;
&lt;h2 data-end=&quot;4594&quot; data-section-id=&quot;8dtpi&quot; data-start=&quot;4581&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p data-end=&quot;4658&quot; data-start=&quot;4596&quot;&gt;&lt;strong data-end=&quot;4658&quot; data-start=&quot;4596&quot;&gt;Instability is not a bug — it is a property of the system.&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;4680&quot; data-start=&quot;4660&quot;&gt;In multilingual DTP:&lt;/p&gt;
&lt;ul data-end=&quot;4775&quot; data-start=&quot;4682&quot;&gt;
&lt;li data-end=&quot;4712&quot; data-section-id=&quot;dz8lqk&quot; data-start=&quot;4682&quot;&gt;
layouts are interconnected
&lt;/li&gt;
&lt;li data-end=&quot;4745&quot; data-section-id=&quot;xwjktg&quot; data-start=&quot;4713&quot;&gt;
languages behave differently
&lt;/li&gt;
&lt;li data-end=&quot;4775&quot; data-section-id=&quot;1f4gwho&quot; data-start=&quot;4746&quot;&gt;
small changes can cascade
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;4818&quot; data-start=&quot;4777&quot;&gt;This means instability cannot be avoided.&lt;/p&gt;
&lt;p data-end=&quot;4855&quot; data-start=&quot;4820&quot;&gt;It must be anticipated and managed.&lt;/p&gt;
&lt;p data-end=&quot;4934&quot; data-start=&quot;4857&quot;&gt;In the &lt;a href=&quot;https://www.linguist-coder.com/2026/03/high-frequency-tasks-worth-automating.html&quot;&gt;previous article&lt;/a&gt;, we discussed &lt;strong data-end=&quot;4913&quot; data-start=&quot;4895&quot;&gt;High Frequency&lt;/strong&gt; — tasks that repeat.&lt;/p&gt;
&lt;p data-end=&quot;5037&quot; data-start=&quot;4936&quot;&gt;In this article, we looked at &lt;strong data-end=&quot;4986&quot; data-start=&quot;4966&quot;&gt;High Instability&lt;/strong&gt; — tasks where small changes produce large effects.&lt;/p&gt;
&lt;p data-end=&quot;5093&quot; data-start=&quot;5039&quot;&gt;In the next article, we will explore the third factor:&lt;/p&gt;
&lt;p data-end=&quot;5148&quot; data-start=&quot;5095&quot;&gt;&lt;strong data-end=&quot;5148&quot; data-start=&quot;5095&quot;&gt;Low Judgment — where automation becomes possible.&lt;/strong&gt;&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>High Frequency Tasks Worth Automating in Multilingual DTP</title>
    <id>https://www.linguist-coder.com/2026/03/high-frequency-tasks-worth-automating.html</id>
    <link href="https://www.linguist-coder.com/2026/03/high-frequency-tasks-worth-automating.html"/>
    <published>2026-03-17T00:44:00.000Z</published>
    <updated>2026-03-21T21:57:37.502Z</updated>
    <summary>Introduction In multilingual DTP, the difficulty of a task is often less important than how often it appears. Layout adjustments, date updates, missing links, small formatting fixes — none of these tasks are particularly complex. But when they repeat across…</summary>
    <content type="html">&lt;h2 style=&quot;text-align: left;&quot;&gt;Introduction&lt;/h2&gt;&lt;p&gt;In multilingual DTP, the difficulty of a task is often less important than how often it appears.&lt;/p&gt;&lt;p&gt;Layout adjustments, date updates, missing links, small formatting fixes — none of these tasks are particularly complex. But when they repeat across languages and revisions, they quickly become a significant source of manual work.&lt;/p&gt;&lt;p&gt;This is why the first automation target is rarely the most technically impressive task.&lt;br /&gt;
It is usually the task that happens the most often.&lt;/p&gt;&lt;p&gt;In the &lt;a href=&quot;https://www.linguist-coder.com/2026/02/what-should-you-automate-first-in.html&quot;&gt;previous article&lt;/a&gt;, I introduced a simple framework for identifying good automation candidates.&lt;/p&gt;&lt;p&gt;In this article, we will look at the first of those criteria: &lt;strong&gt;High Frequency&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;Recap: The Automation Framework&quot;&gt;Recap: The Automation Framework&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;This framework helps identify which tasks are actually worth automating.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;In the &lt;a href=&quot;https://www.linguist-coder.com/2026/02/what-should-you-automate-first-in.html&quot;&gt;previous article&lt;/a&gt;, I introduced three criteria that make a task a strong automation candidate:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;High Frequency&lt;/strong&gt; – the task occurs repeatedly&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;High Instability&lt;/strong&gt; – the conditions change each time&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Low Judgment&lt;/strong&gt; – the handling rules are predictable&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The strongest automation opportunities appear where these forces overlap.&lt;/p&gt;&lt;p&gt;In this article, we focus on the first one: &lt;strong&gt;High Frequency&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;What “High Frequency” Really Means&quot;&gt;What “High Frequency” Really Means&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;High-frequency friction scales across languages and production cycles.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;High Frequency does not simply mean that a task happens often.&lt;/p&gt;&lt;p&gt;In multilingual production, repetition multiplies across several dimensions:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;number of languages&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;number of documents&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;number of revisions&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;p&gt;1 issue&lt;br /&gt;
× 10 languages&lt;br /&gt;
× 3 revisions&lt;br /&gt;
= 30 manual fixes&lt;/p&gt;&lt;p&gt;A small issue in a single layout can quickly become dozens of repeated corrections across a project.&lt;/p&gt;&lt;p&gt;This multiplication effect is why High Frequency tasks are often the best starting point for automation.&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;A Real Example: Missing Links&quot;&gt;A Real Example: Missing Links&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;A small asset problem can propagate across every translated layout.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Many multilingual workflows begin with an English &lt;strong&gt;source layout&lt;/strong&gt; — the base document from which translated layouts are produced.&lt;/p&gt;&lt;p&gt;Translated versions are then created from that structure:&lt;/p&gt;&lt;p&gt;English source layout&lt;br /&gt;
↓&lt;br /&gt;
Translated layouts&lt;br /&gt;
(JA / DE / FR / IT / ES ...)&lt;/p&gt;&lt;p&gt;This structure works well — until the asset structure changes.&lt;/p&gt;&lt;p&gt;For example, the English asset folder may be:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;renamed&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;moved to a different directory&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;reorganized during a project update&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;When that happens, translated documents can suddenly lose their links.&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;Why This Becomes a High-Frequency Problem&quot;&gt;Why This Becomes a High-Frequency Problem&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;One missing link can multiply across every language version.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;In multilingual production, the same layout may exist in many language versions.&lt;/p&gt;&lt;p&gt;A single missing asset can therefore propagate across multiple documents.&lt;/p&gt;&lt;p&gt;1 broken asset&lt;br /&gt;
↓&lt;br /&gt;
10 translated layouts&lt;br /&gt;
↓&lt;br /&gt;
10 missing links&lt;/p&gt;&lt;p&gt;What looks like a minor issue in one file quickly becomes repeated friction across the entire production set.&lt;/p&gt;&lt;p&gt;This is exactly the kind of situation where automation becomes valuable.&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;The Limitation of Preflight Detection&quot;&gt;The Limitation of Preflight Detection&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Preflight detects missing links, but it does not remove the manual tracing step.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;InDesign’s Preflight feature can detect missing links reliably.&lt;/p&gt;&lt;p&gt;However, it does not immediately provide the information operators often need most:&lt;br /&gt;
the &lt;strong&gt;expected file path&lt;/strong&gt; of the missing asset.&lt;/p&gt;&lt;p&gt;To resolve the issue, the operator typically has to:&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;open the &lt;strong&gt;Links panel&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;inspect the link information&lt;/li&gt;
&lt;li&gt;identify the original file location&lt;/li&gt;
&lt;li&gt;attempt to relink manually&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;This extra tracing step becomes repetitive when the same issue appears across multiple layouts.&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;The Packaging Alternative&quot;&gt;The Packaging Alternative&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Packaging avoids missing links but introduces asset maintenance overhead.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Another common workaround is to package the document.&lt;/p&gt;&lt;p&gt;Packaging gathers all linked assets into a single folder together with the document.&lt;/p&gt;&lt;p&gt;This can prevent missing link problems, but it also introduces new complications:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;assets are duplicated&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;shared resources become harder to update&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;folder structures grow more complex&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;In multilingual projects, this becomes particularly problematic when shared assets change.&lt;/p&gt;&lt;p&gt;If a common asset — such as a logo or illustration — is updated, every packaged language folder may need to be updated manually.&lt;/p&gt;&lt;p&gt;In other words, the problem shifts from &lt;strong&gt;link detection&lt;/strong&gt; to &lt;strong&gt;asset maintenance&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;A Minimal Script: Missing Link Reporter&quot;&gt;A Minimal Script: Missing Link Reporter&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;This removes the repeated step of manually tracing where a file should be.&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/KXxkwIhdslA&quot; width=&quot;320&quot; youtube-src-id=&quot;KXxkwIhdslA&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;The goal here is not to automatically repair links.&lt;/p&gt;&lt;p&gt;Instead, the goal is to remove one repeated manual step:&lt;br /&gt;
&lt;strong&gt;identifying where the missing file was expected to be located.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;A small helper script can scan the document and generate a simple report of missing links.&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;Script Example&quot;&gt;Script Example&lt;/h2&gt;
&lt;div&gt;&lt;div style=&quot;background: rgb(31, 41, 55); border-radius: 10px; border: 1px solid rgb(55, 65, 81); color: #f9fafb; margin: 20px 0px; padding: 18px;&quot;&gt;
  &lt;div style=&quot;color: #f9fafb; font-size: 18px; font-weight: 700; margin-bottom: 8px;&quot;&gt;
    Want the ready-to-use version?
  &lt;/div&gt;
  &lt;div style=&quot;color: #d1d5db; font-size: 15px; line-height: 1.6; margin-bottom: 14px;&quot;&gt;
    Skip the copy-paste and download the script directly from Gumroad.
  &lt;/div&gt;
  &lt;a href=&quot;https://linguistcoder.gumroad.com/l/missing-links-report&quot; style=&quot;background: rgb(79, 70, 229); border-radius: 8px; color: white; display: inline-block; font-weight: 600; padding: 10px 16px; text-decoration: none;&quot;&gt;
    Download on Gumroad (Free) →
  &lt;/a&gt;
&lt;/div&gt;
&lt;pre style=&quot;background: rgb(17, 24, 39); border-radius: 8px; color: #e5e7eb; font-family: Consolas, Monaco, monospace; overflow: auto; padding: 16px; white-space: pre;&quot;&gt;&lt;code&gt;#target indesign

if (app.documents.length === 0) {
    alert(&quot;Open a document first.&quot;);
    exit();
}

var doc = app.activeDocument;
var links = doc.links;
var report = &quot;&quot;;
var missingCount = 0;

// Header
report += &quot;Missing Links Report\r&quot;;
report += &quot;Document: &quot; + (doc.name || &quot;Untitled&quot;) + &quot;\r&quot;;
report += &quot;Generated: &quot; + new Date().toString() + &quot;\r&quot;;
report += &quot;----------------------------------------\r\r&quot;;

// Scan links
for (var i = 0; i &amp;lt; links.length; i++) {
    var link = links[i];

    if (link.status === LinkStatus.LINK_MISSING) {
        missingCount++;
        report += &quot;Link name: &quot; + (link.name || &quot;(no name)&quot;) + &quot;\r&quot;;
        report += &quot;Expected path:\r&quot;;
        report += (link.filePath != null ? link.filePath : &quot;(unknown)&quot;) + &quot;\r&quot;;
        report += &quot;----------------------------------------\r\r&quot;;
    }
}

if (missingCount === 0) {
    alert(&quot;No missing links found.&quot;);
    exit();
}

// Save report: use document folder only if document has been saved
var reportFile;
var docPath = doc.filePath;

if (docPath &amp;amp;&amp;amp; docPath !== &quot;&quot;) {
    var docFolder = new Folder(docPath);
    reportFile = new File(docFolder.fsName + &quot;/Missing_Links_Report.txt&quot;);
} else {
    reportFile = File.saveDialog(&quot;Save Missing Links Report As&quot;, &quot;Missing_Links_Report.txt&quot;);
    if (reportFile === null) {
        alert(&quot;Save cancelled.&quot;);
        exit();
    }
}

reportFile.encoding = &quot;UTF-8&quot;;

if (reportFile.open(&quot;w&quot;)) {
    reportFile.write(report);
    reportFile.close();
    alert(&quot;Report created:\r&quot; + reportFile.fsName);
    reportFile.execute();
} else {
    alert(&quot;Failed to create the report file.&quot;);
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This script focuses on only two pieces of information:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;link name&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;expected file path&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;This is usually enough to quickly identify the missing asset using the Links panel.&lt;/p&gt;&lt;p&gt;After generating the report, the script automatically opens the text file using the system’s default application (for example, Notepad on Windows).&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;Example Output&quot;&gt;Example Output&lt;/h2&gt;&lt;p&gt;A simple report might look like this:&lt;/p&gt;&lt;p&gt;Missing Links Report&lt;br /&gt;
Document: example.indd&lt;br /&gt;
Generated: YYYY-MM-DD  &lt;/p&gt;&lt;hr /&gt;&lt;p&gt;Link name: image_023.tif&lt;br /&gt;
Expected path:&lt;br /&gt;
C:\project\images\image_023.tif  &lt;/p&gt;&lt;hr /&gt;&lt;p&gt;Link name: diagram_A3.ai&lt;br /&gt;
Expected path:&lt;br /&gt;
D:\assets\illustrations\diagram_A3.ai&lt;/p&gt;&lt;p&gt;With this information available immediately, operators no longer need to manually trace the original file location through the Links panel.&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;Why Minimal Automation Works&quot;&gt;Why Minimal Automation Works&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Small scripts often remove the largest repeated friction.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The interesting thing about this example is that the script itself is extremely simple.&lt;/p&gt;&lt;p&gt;It does not:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;repair links automatically&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;search folders&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;perform batch relinking&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;modify document structure&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Yet it still removes a repeated manual step that occurs frequently in multilingual production.&lt;/p&gt;&lt;p&gt;Automation does not need to be complex to be useful.&lt;br /&gt;
It only needs to remove friction that appears repeatedly.&lt;/p&gt;&lt;hr /&gt;&lt;h2 data-heading=&quot;Conclusion&quot;&gt;Conclusion&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Automation becomes valuable when small friction repeats across projects.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;In multilingual workflows, many tasks are not difficult.&lt;br /&gt;
They are simply repeated.&lt;/p&gt;&lt;p&gt;A small issue can multiply across:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;languages&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;documents&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;revisions&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;When this happens, even small improvements can produce significant time savings.&lt;/p&gt;&lt;p&gt;This is why &lt;strong&gt;High Frequency tasks&lt;/strong&gt; are often the best place to start automation.&lt;/p&gt;&lt;p&gt;High Frequency is often the easiest signal to recognize — but it is only one part of the automation decision.&lt;/p&gt;&lt;p&gt;&lt;!--obsidian--&gt;












































































































&lt;/p&gt;&lt;p&gt;In the next article, we will explore the second criterion from the framework:&lt;br /&gt;
&lt;strong&gt;High Instability&lt;/strong&gt;, and why layout behavior after translation often becomes unpredictable.&lt;/p&gt;&lt;/div&gt;</content>
  </entry>

  <entry>
    <title>What Should You Automate First in Multilingual DTP?</title>
    <id>https://www.linguist-coder.com/2026/02/what-should-you-automate-first-in.html</id>
    <link href="https://www.linguist-coder.com/2026/02/what-should-you-automate-first-in.html"/>
    <published>2026-02-28T22:45:00.000Z</published>
    <updated>2026-03-21T21:57:21.289Z</updated>
    <summary>Introduction Automation is everywhere. You can automate layout adjustments, file packaging, PDF export, translation import, style cleanup—the list is long. But if you automate the wrong thing first, your workflow doesn’t scale. It just becomes more complicated. So here’s the…</summary>
    <content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Introduction&lt;/h2&gt;
&lt;p data-end=&quot;97&quot; data-start=&quot;72&quot;&gt;Automation is everywhere.&lt;/p&gt;
&lt;p data-end=&quot;215&quot; data-start=&quot;99&quot;&gt;You can automate layout adjustments, file packaging, PDF export, translation import, style cleanup—the list is long.&lt;/p&gt;
&lt;p data-end=&quot;324&quot; data-start=&quot;217&quot;&gt;But if you automate the wrong thing first, your workflow doesn’t scale.&lt;br data-end=&quot;291&quot; data-start=&quot;288&quot; /&gt;
It just becomes more complicated.&lt;/p&gt;
&lt;p data-end=&quot;354&quot; data-start=&quot;326&quot;&gt;So here’s the real question:&lt;/p&gt;
&lt;p data-end=&quot;445&quot; data-start=&quot;356&quot;&gt;&lt;strong data-end=&quot;445&quot; data-start=&quot;356&quot;&gt;If you could automate only one thing in multilingual DTP this year, what would it be?&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;513&quot; data-start=&quot;447&quot;&gt;This is not a technical question.&lt;br data-end=&quot;483&quot; data-start=&quot;480&quot; /&gt;
It’s a prioritization problem.&lt;/p&gt;
&lt;hr data-end=&quot;518&quot; data-start=&quot;515&quot; /&gt;
&lt;h2 data-end=&quot;569&quot; data-start=&quot;520&quot;&gt;Common Mistakes When Choosing What to Automate&lt;/h2&gt;
&lt;p data-end=&quot;634&quot; data-start=&quot;571&quot;&gt;Before defining criteria, it helps to look at what &lt;em data-end=&quot;627&quot; data-start=&quot;622&quot;&gt;not&lt;/em&gt; to do.&lt;/p&gt;
&lt;h3 data-end=&quot;677&quot; data-start=&quot;636&quot;&gt;1) Starting with something impressive&lt;/h3&gt;
&lt;p data-end=&quot;736&quot; data-start=&quot;679&quot;&gt;I once tried to automate text importing across documents.&lt;/p&gt;
&lt;p data-end=&quot;862&quot; data-start=&quot;738&quot;&gt;The idea was clean: writers prepare text files, and a script finds placeholders in InDesign and replaces them automatically.&lt;/p&gt;
&lt;p data-end=&quot;887&quot; data-start=&quot;864&quot;&gt;Technically, it worked.&lt;/p&gt;
&lt;p data-end=&quot;928&quot; data-start=&quot;889&quot;&gt;Practically, it didn’t move the needle.&lt;/p&gt;
&lt;p data-end=&quot;1132&quot; data-start=&quot;930&quot;&gt;Copy-paste was often faster. And the real friction didn’t come from importing text—it came &lt;em data-end=&quot;1033&quot; data-start=&quot;1021&quot;&gt;afterwards&lt;/em&gt;: overset text, layout breaks, exceptions in tables, grouped objects, and all the messy edge cases.&lt;/p&gt;
&lt;p data-end=&quot;1194&quot; data-start=&quot;1134&quot;&gt;It was a wide-scope automation, but not a high-leverage one.&lt;/p&gt;
&lt;hr data-end=&quot;1199&quot; data-start=&quot;1196&quot; /&gt;
&lt;h3 data-end=&quot;1239&quot; data-start=&quot;1201&quot;&gt;2) Automating a one-time emergency&lt;/h3&gt;
&lt;p data-end=&quot;1351&quot; data-start=&quot;1241&quot;&gt;At one point, I wrote a script that reduced every paragraph style’s point size by 1pt to solve a layout issue.&lt;/p&gt;
&lt;p data-end=&quot;1370&quot; data-start=&quot;1353&quot;&gt;It saved the day.&lt;/p&gt;
&lt;p data-end=&quot;1377&quot; data-start=&quot;1372&quot;&gt;Once.&lt;/p&gt;
&lt;p data-end=&quot;1439&quot; data-start=&quot;1379&quot;&gt;But that wasn’t a scalable improvement. It was a workaround.&lt;/p&gt;
&lt;p data-end=&quot;1505&quot; data-start=&quot;1441&quot;&gt;One-off automation often optimizes a single fire—not the system.&lt;/p&gt;
&lt;hr data-end=&quot;1510&quot; data-start=&quot;1507&quot; /&gt;
&lt;h3 data-end=&quot;1550&quot; data-start=&quot;1512&quot;&gt;3) Prioritizing what is “possible”&lt;/h3&gt;
&lt;p data-end=&quot;1640&quot; data-start=&quot;1552&quot;&gt;I also built a date-change script with a UI that let users choose multiple update modes.&lt;/p&gt;
&lt;p data-end=&quot;1661&quot; data-start=&quot;1642&quot;&gt;It looked flexible.&lt;/p&gt;
&lt;p data-end=&quot;1687&quot; data-start=&quot;1663&quot;&gt;Later, I removed the UI.&lt;/p&gt;
&lt;p data-end=&quot;1693&quot; data-start=&quot;1689&quot;&gt;Why?&lt;/p&gt;
&lt;p data-end=&quot;1760&quot; data-start=&quot;1695&quot;&gt;Because in actual usage, the requirement was almost always fixed:&lt;/p&gt;
&lt;ul data-end=&quot;1876&quot; data-start=&quot;1762&quot;&gt;
&lt;li data-end=&quot;1816&quot; data-start=&quot;1762&quot;&gt;
&lt;p data-end=&quot;1816&quot; data-start=&quot;1764&quot;&gt;If the date contains “xx”, update to today’s date.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1876&quot; data-start=&quot;1817&quot;&gt;
&lt;p data-end=&quot;1876&quot; data-start=&quot;1819&quot;&gt;Otherwise, set the day to “xx” while updating month/year.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1980&quot; data-start=&quot;1878&quot;&gt;The extra flexibility added friction. I built it because I could—not because it improved the workflow.&lt;/p&gt;
&lt;p data-end=&quot;2029&quot; data-start=&quot;1982&quot;&gt;“Can be done” is not the same as “worth doing.”&lt;/p&gt;
&lt;hr data-end=&quot;2034&quot; data-start=&quot;2031&quot; /&gt;
&lt;h2 data-end=&quot;2079&quot; data-start=&quot;2036&quot;&gt;Three Criteria for Your First Automation&lt;/h2&gt;
&lt;p data-end=&quot;2167&quot; data-start=&quot;2081&quot;&gt;If you want automation that actually scales multilingual DTP, use these three filters:&lt;/p&gt;
&lt;h3 data-end=&quot;2190&quot; data-start=&quot;2169&quot;&gt;1) High Frequency&lt;/h3&gt;
&lt;p data-end=&quot;2213&quot; data-start=&quot;2192&quot;&gt;It must happen often.&lt;/p&gt;
&lt;p data-end=&quot;2293&quot; data-start=&quot;2215&quot;&gt;If you only encounter the task twice a year, it’s rarely your first candidate.&lt;/p&gt;
&lt;h3 data-end=&quot;2318&quot; data-start=&quot;2295&quot;&gt;2) High Instability&lt;/h3&gt;
&lt;p data-end=&quot;2359&quot; data-start=&quot;2320&quot;&gt;The task behaves differently each time.&lt;/p&gt;
&lt;p data-end=&quot;2411&quot; data-start=&quot;2361&quot;&gt;In multilingual production, instability is common:&lt;/p&gt;
&lt;ul data-end=&quot;2562&quot; data-start=&quot;2413&quot;&gt;
&lt;li data-end=&quot;2449&quot; data-start=&quot;2413&quot;&gt;
&lt;p data-end=&quot;2449&quot; data-start=&quot;2415&quot;&gt;text expansion after translation&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2483&quot; data-start=&quot;2450&quot;&gt;
&lt;p data-end=&quot;2483&quot; data-start=&quot;2452&quot;&gt;language-specific line breaks&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2528&quot; data-start=&quot;2484&quot;&gt;
&lt;p data-end=&quot;2528&quot; data-start=&quot;2486&quot;&gt;tables breaking differently per language&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2562&quot; data-start=&quot;2529&quot;&gt;
&lt;p data-end=&quot;2562&quot; data-start=&quot;2531&quot;&gt;layout shifts across versions&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2646&quot; data-start=&quot;2564&quot;&gt;Instability does not mean the rule is complex.&lt;br data-end=&quot;2613&quot; data-start=&quot;2610&quot; /&gt;
It means the &lt;em data-end=&quot;2637&quot; data-start=&quot;2626&quot;&gt;condition&lt;/em&gt; changes.&lt;/p&gt;
&lt;p data-end=&quot;2723&quot; data-start=&quot;2648&quot;&gt;The condition may be unpredictable—but the rule to fix it should be simple.&lt;/p&gt;
&lt;h3 data-end=&quot;2744&quot; data-start=&quot;2725&quot;&gt;3) Low Judgment&lt;/h3&gt;
&lt;p data-end=&quot;2801&quot; data-start=&quot;2746&quot;&gt;The task does not require complex human interpretation.&lt;/p&gt;
&lt;p data-end=&quot;2915&quot; data-start=&quot;2803&quot;&gt;If the decision can be expressed as rules, conditions, or predictable logic, it’s a strong automation candidate.&lt;/p&gt;
&lt;p data-end=&quot;3031&quot; data-start=&quot;2917&quot;&gt;If it requires contextual understanding, regulatory interpretation, or content nuance, it’s not your first target.&lt;/p&gt;
&lt;p data-end=&quot;3154&quot; data-start=&quot;3033&quot;&gt;Look for tasks where at least two of these forces strongly overlap.&lt;br data-end=&quot;3103&quot; data-start=&quot;3100&quot; /&gt;
The strongest candidates usually satisfy all three.&lt;/p&gt;
&lt;hr data-end=&quot;3159&quot; data-start=&quot;3156&quot; /&gt;
&lt;h2 data-end=&quot;3197&quot; data-start=&quot;3161&quot;&gt;Applying the Criteria in Practice&lt;/h2&gt;
&lt;h3 data-end=&quot;3232&quot; data-start=&quot;3199&quot;&gt;Case 1: Minimal Date Update&lt;/h3&gt;
&lt;p data-end=&quot;3259&quot; data-start=&quot;3233&quot;&gt;(Frequency × Low Judgment)&lt;/p&gt;
&lt;p data-end=&quot;3338&quot; data-start=&quot;3261&quot;&gt;Date updates happen repeatedly, and the correct behavior is often rule-based.&lt;/p&gt;
&lt;p data-end=&quot;3392&quot; data-start=&quot;3340&quot;&gt;In my case, most updates followed predictable logic:&lt;/p&gt;
&lt;ul data-end=&quot;3516&quot; data-start=&quot;3394&quot;&gt;
&lt;li data-end=&quot;3452&quot; data-start=&quot;3394&quot;&gt;
&lt;p data-end=&quot;3452&quot; data-start=&quot;3396&quot;&gt;&lt;strong data-end=&quot;3450&quot; data-start=&quot;3396&quot;&gt;If the date contains “xx”, update to today’s date.&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3516&quot; data-start=&quot;3453&quot;&gt;
&lt;p data-end=&quot;3516&quot; data-start=&quot;3455&quot;&gt;&lt;strong data-end=&quot;3516&quot; data-start=&quot;3455&quot;&gt;Otherwise, set the day to “xx” while updating month/year.&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3618&quot; data-start=&quot;3518&quot;&gt;Instead of adding options, I removed them.&lt;br data-end=&quot;3563&quot; data-start=&quot;3560&quot; /&gt;
I embedded the decision logic directly into the script.&lt;/p&gt;
&lt;p data-end=&quot;3631&quot; data-start=&quot;3620&quot;&gt;The result:&lt;/p&gt;
&lt;ul data-end=&quot;3693&quot; data-start=&quot;3633&quot;&gt;
&lt;li data-end=&quot;3649&quot; data-start=&quot;3633&quot;&gt;
&lt;p data-end=&quot;3649&quot; data-start=&quot;3635&quot;&gt;fewer clicks&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3669&quot; data-start=&quot;3650&quot;&gt;
&lt;p data-end=&quot;3669&quot; data-start=&quot;3652&quot;&gt;fewer decisions&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3693&quot; data-start=&quot;3670&quot;&gt;
&lt;p data-end=&quot;3693&quot; data-start=&quot;3672&quot;&gt;less room for error&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3900&quot; data-start=&quot;3695&quot;&gt;This example uses a simple English date format for clarity.&lt;br data-end=&quot;3757&quot; data-start=&quot;3754&quot; /&gt;
In multilingual environments, it is often better to create separate minimal scripts per language rather than adding complex UI branching logic.&lt;/p&gt;
&lt;p data-end=&quot;3972&quot; data-start=&quot;3902&quot;&gt;Here’s a minimal example (no UI, no options—just rule-based behavior):&lt;/p&gt;
&lt;div&gt;&lt;div style=&quot;background: rgb(31, 41, 55); border-radius: 10px; border: 1px solid rgb(55, 65, 81); color: #f9fafb; margin: 20px 0px; padding: 18px;&quot;&gt;
  &lt;div style=&quot;color: #f9fafb; font-size: 18px; font-weight: 700; margin-bottom: 8px;&quot;&gt;
    Want the ready-to-use version?
  &lt;/div&gt;
  &lt;div style=&quot;color: #d1d5db; font-size: 15px; line-height: 1.6; margin-bottom: 14px;&quot;&gt;
    Skip the copy-paste and download the script directly from Gumroad.
  &lt;/div&gt;
  &lt;a href=&quot;https://linguistcoder.gumroad.com/l/indesign-date-toggle-script&quot; style=&quot;background: rgb(79, 70, 229); border-radius: 8px; color: white; display: inline-block; font-weight: 600; padding: 10px 16px; text-decoration: none;&quot;&gt;
    Download on Gumroad (Free) →
  &lt;/a&gt;
&lt;/div&gt;

&lt;pre style=&quot;background: rgb(17, 24, 39); border-radius: 8px; color: #e5e7eb; font-family: Consolas, Monaco, monospace; overflow: auto; padding: 16px; white-space: pre;&quot;&gt;&lt;code&gt;#target indesign

if (app.selection.length === 0) {
    alert(&quot;Please select text containing a date.&quot;);
    exit();
}

var sel = app.selection[0];
if (!sel.hasOwnProperty(&quot;contents&quot;)) {
    alert(&quot;Selected object does not contain editable text.&quot;);
    exit();
}

var text = sel.contents;

// Match: &quot;xx Xxx 20xx&quot; or &quot;12 Jan 2025&quot; etc.
var regex = /([0-9xX]{2})\s+([A-Za-z]{3})\s+([0-9xX]{4})/;
var match = text.match(regex);

if (!match) {
    alert(&quot;No date pattern found (expected: dd MMM yyyy).&quot;);
    exit();
}

var oldDay = match[1];
var oldMonth = match[2];
var oldYear = match[3];

var hasX = /x/i.test(oldDay + oldMonth + oldYear);

var now = new Date();
var dayNum = now.getDate();
var day2 = (dayNum &amp;lt; 10) ? (&quot;0&quot; + dayNum) : String(dayNum);

var months = [&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;,&quot;Sep&quot;,&quot;Oct&quot;,&quot;Nov&quot;,&quot;Dec&quot;];
var curMonth = months[now.getMonth()];
var curYear = String(now.getFullYear());

var newDate;

if (hasX) {
    // If the date contains &quot;xx&quot; (or any x), update to today&apos;s full date.
    newDate = day2 + &quot; &quot; + curMonth + &quot; &quot; + curYear;
} else {
    // Otherwise, set the day to &quot;xx&quot; while updating month/year.
    newDate = &quot;xx &quot; + curMonth + &quot; &quot; + curYear;
}

sel.contents = text.replace(regex, newDate);

alert(&quot;Date updated to: &quot; + newDate);&lt;/code&gt;
&lt;/pre&gt;


&lt;p data-end=&quot;5348&quot; data-start=&quot;5276&quot;&gt;This is not sophisticated automation.&lt;br data-end=&quot;5316&quot; data-start=&quot;5313&quot; /&gt;
It is targeted friction removal.&lt;br /&gt;&lt;/p&gt;&lt;p data-end=&quot;5348&quot; data-start=&quot;5276&quot;&gt;This shows the script in action:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/56s0U8sN8jg&quot; width=&quot;320&quot; youtube-src-id=&quot;56s0U8sN8jg&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;p data-end=&quot;5348&quot; data-start=&quot;5276&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;hr data-end=&quot;5353&quot; data-start=&quot;5350&quot; /&gt;
&lt;h3 data-end=&quot;5412&quot; data-start=&quot;5355&quot;&gt;Case 2: From a Font-Shrinking Hack to Overset Fixer&lt;/h3&gt;
&lt;p data-end=&quot;5453&quot; data-start=&quot;5413&quot;&gt;(Frequency × Instability × Low Judgment)&lt;/p&gt;
&lt;p data-end=&quot;5501&quot; data-start=&quot;5455&quot;&gt;Shrinking all paragraph styles was a reaction.&lt;/p&gt;
&lt;p data-end=&quot;5547&quot; data-start=&quot;5503&quot;&gt;Overset text after translation is a pattern.&lt;/p&gt;
&lt;p data-end=&quot;5641&quot; data-start=&quot;5549&quot;&gt;The real issue wasn’t “make text smaller.”&lt;br data-end=&quot;5594&quot; data-start=&quot;5591&quot; /&gt;
It was that translated layouts become unstable.&lt;/p&gt;
&lt;p data-end=&quot;5809&quot; data-start=&quot;5643&quot;&gt;Different languages expand differently.&lt;br data-end=&quot;5685&quot; data-start=&quot;5682&quot; /&gt;
Tables overflow unpredictably.&lt;br data-end=&quot;5718&quot; data-start=&quot;5715&quot; /&gt;
Anchored objects behave inconsistently.&lt;br data-end=&quot;5760&quot; data-start=&quot;5757&quot; /&gt;
Even small upstream changes can shift pagination.&lt;/p&gt;
&lt;p data-end=&quot;5889&quot; data-start=&quot;5811&quot;&gt;Overset is both frequent and unstable—making it a strong automation candidate.&lt;/p&gt;
&lt;p data-end=&quot;5982&quot; data-start=&quot;5891&quot;&gt;Although overset behaves differently each time, the handling logic can still be rule-based:&lt;/p&gt;
&lt;ul data-end=&quot;6048&quot; data-start=&quot;5984&quot;&gt;
&lt;li data-end=&quot;6002&quot; data-start=&quot;5984&quot;&gt;
&lt;p data-end=&quot;6002&quot; data-start=&quot;5986&quot;&gt;detect overset&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;6035&quot; data-start=&quot;6003&quot;&gt;
&lt;p data-end=&quot;6035&quot; data-start=&quot;6005&quot;&gt;apply controlled adjustments&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;6048&quot; data-start=&quot;6036&quot;&gt;
&lt;p data-end=&quot;6048&quot; data-start=&quot;6038&quot;&gt;re-check&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;6104&quot; data-start=&quot;6050&quot;&gt;The judgment required is procedural, not interpretive.&lt;/p&gt;
&lt;p data-end=&quot;6209&quot; data-start=&quot;6106&quot;&gt;Instead of a destructive global font reduction, the solution evolved toward a more controlled approach:&lt;/p&gt;
&lt;ul data-end=&quot;6305&quot; data-start=&quot;6211&quot;&gt;
&lt;li data-end=&quot;6238&quot; data-start=&quot;6211&quot;&gt;
&lt;p data-end=&quot;6238&quot; data-start=&quot;6213&quot;&gt;detect overset reliably&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;6263&quot; data-start=&quot;6239&quot;&gt;
&lt;p data-end=&quot;6263&quot; data-start=&quot;6241&quot;&gt;adjust strategically&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;6305&quot; data-start=&quot;6264&quot;&gt;
&lt;p data-end=&quot;6305&quot; data-start=&quot;6266&quot;&gt;preserve design intent where possible&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;6350&quot; data-start=&quot;6307&quot;&gt;The difference is not technical complexity.&lt;/p&gt;
&lt;p data-end=&quot;6423&quot; data-start=&quot;6352&quot;&gt;It is alignment with frequency, instability, and low-judgment handling.&lt;/p&gt;&lt;p data-end=&quot;6423&quot; data-start=&quot;6352&quot;&gt;I’ve written &lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-eliminating.html&quot;&gt;separately&lt;/a&gt; about how this thinking evolved into a more structured overset-handling approach.&lt;/p&gt;
&lt;hr data-end=&quot;6428&quot; data-start=&quot;6425&quot; /&gt;
&lt;h2 data-end=&quot;6470&quot; data-start=&quot;6430&quot;&gt;Where the Bottleneck Eventually Moves&lt;/h2&gt;
&lt;p data-end=&quot;6531&quot; data-start=&quot;6472&quot;&gt;Once repetitive friction is reduced, the constraint shifts.&lt;/p&gt;
&lt;p data-end=&quot;6575&quot; data-start=&quot;6533&quot;&gt;Not to file handling.&lt;br data-end=&quot;6557&quot; data-start=&quot;6554&quot; /&gt;
Not to formatting.&lt;/p&gt;
&lt;p data-end=&quot;6593&quot; data-start=&quot;6577&quot;&gt;But to judgment.&lt;/p&gt;
&lt;p data-end=&quot;6634&quot; data-start=&quot;6595&quot;&gt;What should change—and what should not?&lt;/p&gt;
&lt;p data-end=&quot;6728&quot; data-start=&quot;6636&quot;&gt;Automation can remove mechanical repetition.&lt;br data-end=&quot;6683&quot; data-start=&quot;6680&quot; /&gt;
It cannot replace structured decision design.&lt;/p&gt;
&lt;p data-end=&quot;6769&quot; data-start=&quot;6730&quot;&gt;And that is where scaling truly begins.&lt;/p&gt;
&lt;hr data-end=&quot;6774&quot; data-start=&quot;6771&quot; /&gt;
&lt;p data-end=&quot;6939&quot; data-start=&quot;6776&quot;&gt;If you had to choose just one thing to automate this year, choose the one that happens often, behaves unpredictably in input, but can be handled with simple rules.&lt;/p&gt;
&lt;p data-end=&quot;6953&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;6941&quot;&gt;Start there.&lt;/p&gt;&lt;/div&gt;</content>
  </entry>

  <entry>
    <title>Your First Practical InDesign Automation: Opening and Closing Multiple Files</title>
    <id>https://www.linguist-coder.com/2026/02/your-first-practical-indesign.html</id>
    <link href="https://www.linguist-coder.com/2026/02/your-first-practical-indesign.html"/>
    <published>2026-02-20T22:24:00.000Z</published>
    <updated>2026-03-21T21:53:04.205Z</updated>
    <summary>0. Who This Article Is For This is the second article in the beginner automation series. It assumes you already know how to run a simple .jsx file in InDesign. (If not, please read the first article in this series…</summary>
    <content type="html">&lt;h2 style=&quot;text-align: left;&quot;&gt;0. Who This Article Is For&lt;/h2&gt;
&lt;p data-end=&quot;266&quot; data-start=&quot;205&quot;&gt;This is the second article in the beginner automation series.&lt;/p&gt;
&lt;p data-end=&quot;404&quot; data-start=&quot;268&quot;&gt;It assumes you already know how to run a simple &lt;code data-end=&quot;322&quot; data-start=&quot;316&quot;&gt;.jsx&lt;/code&gt; file in InDesign.&lt;br data-end=&quot;343&quot; data-start=&quot;340&quot; /&gt;
(If not, please read the&lt;a href=&quot;https://www.linguist-coder.com/2026/01/how-to-run-javascript-in-adobe-indesign.html&quot;&gt; first article in this series&lt;/a&gt; first.)&lt;/p&gt;
&lt;p data-end=&quot;452&quot; data-start=&quot;406&quot;&gt;You do not need advanced JavaScript knowledge.&lt;/p&gt;
&lt;p data-end=&quot;572&quot; data-start=&quot;454&quot;&gt;If you work with InDesign Books and regularly open multiple documents for checking or review, this article is for you.&lt;/p&gt;
&lt;p data-end=&quot;593&quot; data-start=&quot;574&quot;&gt;The goal is simple:&lt;/p&gt;
&lt;p data-end=&quot;620&quot; data-start=&quot;595&quot;&gt;Remove repeated friction.&lt;/p&gt;
&lt;hr data-end=&quot;625&quot; data-start=&quot;622&quot; /&gt;
&lt;h2 data-end=&quot;671&quot; data-start=&quot;627&quot;&gt;1. The Problem: Opening 15 Files Manually&lt;/h2&gt;
&lt;p data-end=&quot;696&quot; data-start=&quot;673&quot;&gt;Imagine this situation:&lt;/p&gt;
&lt;ul data-end=&quot;772&quot; data-start=&quot;698&quot;&gt;
&lt;li data-end=&quot;715&quot; data-start=&quot;698&quot;&gt;
&lt;p data-end=&quot;715&quot; data-start=&quot;700&quot;&gt;One Book file&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;748&quot; data-start=&quot;716&quot;&gt;
&lt;p data-end=&quot;748&quot; data-start=&quot;718&quot;&gt;15 InDesign documents inside&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;772&quot; data-start=&quot;749&quot;&gt;
&lt;p data-end=&quot;772&quot; data-start=&quot;751&quot;&gt;5 language versions&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;865&quot; data-start=&quot;774&quot;&gt;After translation, you need to open every file to check layout, overset, images, or styles.&lt;/p&gt;
&lt;p data-end=&quot;960&quot; data-start=&quot;867&quot;&gt;Opening 15 files once is not a problem.&lt;br data-end=&quot;909&quot; data-start=&quot;906&quot; /&gt;
Opening them 100 times over a project lifecycle is.&lt;/p&gt;
&lt;p data-end=&quot;1016&quot; data-start=&quot;962&quot;&gt;The action itself is trivial.&lt;br data-end=&quot;994&quot; data-start=&quot;991&quot; /&gt;
The repetition is not.&lt;/p&gt;
&lt;hr data-end=&quot;1021&quot; data-start=&quot;1018&quot; /&gt;
&lt;h2 data-end=&quot;1051&quot; data-start=&quot;1023&quot;&gt;2. Why This Doesn’t Scale&lt;/h2&gt;
&lt;p data-end=&quot;1088&quot; data-start=&quot;1053&quot;&gt;Automation is not about complexity.&lt;/p&gt;
&lt;p data-end=&quot;1113&quot; data-start=&quot;1090&quot;&gt;It is about repetition.&lt;/p&gt;
&lt;p data-end=&quot;1138&quot; data-start=&quot;1115&quot;&gt;Opening files manually:&lt;/p&gt;
&lt;ul data-end=&quot;1177&quot; data-start=&quot;1140&quot;&gt;
&lt;li data-end=&quot;1149&quot; data-start=&quot;1140&quot;&gt;
&lt;p data-end=&quot;1149&quot; data-start=&quot;1142&quot;&gt;Click&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1158&quot; data-start=&quot;1150&quot;&gt;
&lt;p data-end=&quot;1158&quot; data-start=&quot;1152&quot;&gt;Wait&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1168&quot; data-start=&quot;1159&quot;&gt;
&lt;p data-end=&quot;1168&quot; data-start=&quot;1161&quot;&gt;Click&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1177&quot; data-start=&quot;1169&quot;&gt;
&lt;p data-end=&quot;1177&quot; data-start=&quot;1171&quot;&gt;Wait&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1257&quot; data-start=&quot;1179&quot;&gt;This pattern seems small, but in multilingual workflows it multiplies quickly.&lt;/p&gt;
&lt;p data-end=&quot;1319&quot; data-start=&quot;1259&quot;&gt;Scaling means removing actions that do not require judgment.&lt;/p&gt;
&lt;p data-end=&quot;1421&quot; data-start=&quot;1321&quot;&gt;Opening and closing files require no judgment.&lt;br data-end=&quot;1370&quot; data-start=&quot;1367&quot; /&gt;
Therefore, they are good candidates for automation.&lt;/p&gt;
&lt;hr data-end=&quot;1426&quot; data-start=&quot;1423&quot; /&gt;
&lt;h2 data-end=&quot;1456&quot; data-start=&quot;1428&quot;&gt;3. Minimal Script Example&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/kdcBjltVlv8&quot; width=&quot;320&quot; youtube-src-id=&quot;kdcBjltVlv8&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p data-end=&quot;1496&quot; data-start=&quot;1458&quot;&gt;Before using these scripts, make sure:&lt;/p&gt;
&lt;ul data-end=&quot;1542&quot; data-start=&quot;1498&quot;&gt;
&lt;li data-end=&quot;1518&quot; data-start=&quot;1498&quot;&gt;
&lt;p data-end=&quot;1518&quot; data-start=&quot;1500&quot;&gt;InDesign is open&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1542&quot; data-start=&quot;1519&quot;&gt;
&lt;p data-end=&quot;1542&quot; data-start=&quot;1521&quot;&gt;A Book file is open&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1623&quot; data-start=&quot;1544&quot;&gt;(You already know how to run a &lt;code data-end=&quot;1581&quot; data-start=&quot;1575&quot;&gt;.jsx&lt;/code&gt; file from the &lt;a href=&quot;https://www.linguist-coder.com/2026/01/how-to-run-javascript-in-adobe-indesign.html&quot;&gt;previous beginner article&lt;/a&gt;.)&lt;/p&gt;
&lt;hr data-end=&quot;1628&quot; data-start=&quot;1625&quot; /&gt;
&lt;h3 data-end=&quot;1675&quot; data-start=&quot;1630&quot;&gt;3.1 Open All Documents in the Active Book&lt;/h3&gt;
&lt;pre style=&quot;background: rgb(17, 24, 39); border-radius: 8px; color: #e5e7eb; font-family: Consolas, Monaco, monospace; overflow: auto; padding: 16px; white-space: pre;&quot;&gt;&lt;code&gt;#target indesign
// Open all documents in the active Book (.indb)
//
// Beginner version:
// - No GUI (no dialogs)
// - Minimal guards
// - No heavy error handling
// - No OS-specific path logic

(function () {
    if (app.books.length === 0) {
        alert(&quot;No Book is currently open.\nOpen a .indb file first, then run this script.&quot;);
        return;
    }

    var book = app.activeBook;
    var contents = book.bookContents;

    if (contents.length === 0) {
        alert(&quot;The active Book has no documents.&quot;);
        return;
    }

    for (var i = 0; i &amp;lt; contents.length; i++) {
        // Opens the INDD referenced by the Book content.
        // If the document is already open, InDesign may show a notice or simply activate it.
        app.open(contents[i].fullName);
    }

    alert(&quot;Completed.\nOpened: &quot; + contents.length + &quot; document(s).&quot;);
})();&lt;/code&gt;
&lt;/pre&gt;
&lt;p data-end=&quot;2197&quot; data-start=&quot;2185&quot;&gt;This script:&lt;/p&gt;
&lt;ul data-end=&quot;2284&quot; data-start=&quot;2199&quot;&gt;
&lt;li data-end=&quot;2229&quot; data-start=&quot;2199&quot;&gt;
&lt;p data-end=&quot;2229&quot; data-start=&quot;2201&quot;&gt;Assumes one Book is active&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2264&quot; data-start=&quot;2230&quot;&gt;
&lt;p data-end=&quot;2264&quot; data-start=&quot;2232&quot;&gt;Loops through all bookContents&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2284&quot; data-start=&quot;2265&quot;&gt;
&lt;p data-end=&quot;2284&quot; data-start=&quot;2267&quot;&gt;Opens each file&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2299&quot; data-start=&quot;2286&quot;&gt;Nothing more.&lt;/p&gt;
&lt;hr data-end=&quot;2304&quot; data-start=&quot;2301&quot; /&gt;
&lt;h3 data-end=&quot;2350&quot; data-start=&quot;2306&quot;&gt;3.2 Close All Open Documents (and Books)&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;2935&quot; data-start=&quot;2352&quot;&gt;&lt;div class=&quot;w-full my-4&quot;&gt;&lt;div&gt;&lt;div class=&quot;relative&quot;&gt;&lt;div class=&quot;h-full min-h-0 min-w-0&quot;&gt;&lt;div class=&quot;h-full min-h-0 min-w-0&quot;&gt;&lt;div class=&quot;border corner-superellipse/1.1 border-token-border-light bg-token-bg-elevated-secondary rounded-3xl&quot;&gt;&lt;div class=&quot;pointer-events-none absolute inset-x-4 top-12 bottom-4&quot;&gt;&lt;div class=&quot;pointer-events-none sticky z-40 shrink-0 z-1!&quot;&gt;&lt;div class=&quot;sticky bg-token-border-light&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;pointer-events-none absolute inset-x-px top-0 bottom-96&quot;&gt;&lt;div class=&quot;pointer-events-none sticky z-40 shrink-0 z-1!&quot;&gt;&lt;div class=&quot;sticky bg-token-bg-elevated-secondary&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;corner-superellipse/1.1 rounded-3xl bg-token-bg-elevated-secondary&quot;&gt;&lt;div class=&quot;relative z-0 flex max-w-full&quot;&gt;&lt;div class=&quot;q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼk ͼy&quot; dir=&quot;ltr&quot; id=&quot;code-block-viewer&quot;&gt;&lt;div class=&quot;cm-scroller&quot;&gt;&lt;div class=&quot;cm-content q9tKkq_readonly&quot;&gt;#target indesign
// Close all open documents (without forcing a save)
// Optional: close all open Books as well
//
// Beginner version:
// - Does NOT force saving (SaveOptions.NO)
// - Skips unsaved documents (new/dirty) to avoid risky loss
// - Loops backward to avoid index shifting while closing

(function () {
    if (app.documents.length === 0 &amp;amp;&amp;amp; app.books.length === 0) {
        alert(&quot;Nothing to close.\nNo documents or Books are currently open.&quot;);
        return;
    }

    // Close documents (backward loop is important)
    var docs = app.documents;
    var closedDocs = 0;
    var skippedDocs = 0;

    for (var i = docs.length - 1; i &amp;gt;= 0; i--) {
        var doc = docs[i];

        // doc.saved is true when the document has no unsaved changes.
        // We only close &quot;clean&quot; documents in this beginner example.
        if (doc.saved) {
            doc.close(SaveOptions.NO);
            closedDocs++;
        } else {
            skippedDocs++;
        }
    }

    // Optional: close Books too (also without forcing a save)
    var closeBooks = confirm(&quot;Documents closed: &quot; + closedDocs +
        &quot;\nSkipped (unsaved/dirty): &quot; + skippedDocs +
        &quot;\n\nDo you want to close all open Books as well?&quot;);

    var closedBooks = 0;

    if (closeBooks) {
        // Close all open Books (backward loop to be safe)
        for (var b = app.books.length - 1; b &amp;gt;= 0; b--) {
            app.books[b].close(SaveOptions.NO);
            closedBooks++;
        }
        alert(&quot;Completed.\nClosed Books: &quot; + closedBooks);
    } else {
        alert(&quot;Completed.\nClosed Docs: &quot; + closedDocs + &quot;\nSkipped Docs: &quot; + skippedDocs);
    }
})();&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;h3 data-end=&quot;2959&quot; data-start=&quot;2937&quot;&gt;Why loop backward?&lt;/h3&gt;
&lt;p data-end=&quot;3019&quot; data-start=&quot;2961&quot;&gt;When closing items inside a collection, the index changes.&lt;/p&gt;
&lt;p data-end=&quot;3049&quot; data-start=&quot;3021&quot;&gt;If you close from the front:&lt;/p&gt;
&lt;ul data-end=&quot;3134&quot; data-start=&quot;3051&quot;&gt;
&lt;li data-end=&quot;3071&quot; data-start=&quot;3051&quot;&gt;
&lt;p data-end=&quot;3071&quot; data-start=&quot;3053&quot;&gt;You close item 0&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3113&quot; data-start=&quot;3072&quot;&gt;
&lt;p data-end=&quot;3113&quot; data-start=&quot;3074&quot;&gt;What used to be item 1 becomes item 0&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3134&quot; data-start=&quot;3114&quot;&gt;
&lt;p data-end=&quot;3134&quot; data-start=&quot;3116&quot;&gt;The loop skips one&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3165&quot; data-start=&quot;3136&quot;&gt;Looping backward avoids this.&lt;/p&gt;
&lt;hr data-end=&quot;3170&quot; data-start=&quot;3167&quot; /&gt;
&lt;h2 data-end=&quot;3199&quot; data-start=&quot;3172&quot;&gt;4. What This Teaches You&lt;/h2&gt;
&lt;p data-end=&quot;3249&quot; data-start=&quot;3201&quot;&gt;Even this small script introduces core concepts:&lt;/p&gt;
&lt;ul data-end=&quot;3303&quot; data-start=&quot;3251&quot;&gt;
&lt;li data-end=&quot;3258&quot; data-start=&quot;3251&quot;&gt;
&lt;p data-end=&quot;3258&quot; data-start=&quot;3253&quot;&gt;&lt;code data-end=&quot;3258&quot; data-start=&quot;3253&quot;&gt;app&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3268&quot; data-start=&quot;3259&quot;&gt;
&lt;p data-end=&quot;3268&quot; data-start=&quot;3261&quot;&gt;&lt;code data-end=&quot;3268&quot; data-start=&quot;3261&quot;&gt;books&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3282&quot; data-start=&quot;3269&quot;&gt;
&lt;p data-end=&quot;3282&quot; data-start=&quot;3271&quot;&gt;&lt;code data-end=&quot;3282&quot; data-start=&quot;3271&quot;&gt;documents&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3290&quot; data-start=&quot;3283&quot;&gt;
&lt;p data-end=&quot;3290&quot; data-start=&quot;3285&quot;&gt;loops&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3303&quot; data-start=&quot;3291&quot;&gt;
&lt;p data-end=&quot;3303&quot; data-start=&quot;3293&quot;&gt;conditions&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3355&quot; data-start=&quot;3305&quot;&gt;You do not need complex logic to start automating.&lt;/p&gt;
&lt;p data-end=&quot;3389&quot; data-start=&quot;3357&quot;&gt;You need to identify repetition.&lt;/p&gt;
&lt;hr data-end=&quot;3394&quot; data-start=&quot;3391&quot; /&gt;
&lt;h2 data-end=&quot;3418&quot; data-start=&quot;3396&quot;&gt;5. Where This Leads&lt;/h2&gt;
&lt;p data-end=&quot;3455&quot; data-start=&quot;3420&quot;&gt;From here, you can extend the idea:&lt;/p&gt;
&lt;ul data-end=&quot;3602&quot; data-start=&quot;3457&quot;&gt;
&lt;li data-end=&quot;3497&quot; data-start=&quot;3457&quot;&gt;
&lt;p data-end=&quot;3497&quot; data-start=&quot;3459&quot;&gt;Open only files matching a condition&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3523&quot; data-start=&quot;3498&quot;&gt;
&lt;p data-end=&quot;3523&quot; data-start=&quot;3500&quot;&gt;Skip certain chapters&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3567&quot; data-start=&quot;3524&quot;&gt;
&lt;p data-end=&quot;3567&quot; data-start=&quot;3526&quot;&gt;Run a check automatically after opening&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3602&quot; data-start=&quot;3568&quot;&gt;
&lt;p data-end=&quot;3602&quot; data-start=&quot;3570&quot;&gt;Combine open → process → close&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3633&quot; data-start=&quot;3604&quot;&gt;This is how automation grows.&lt;/p&gt;
&lt;p data-end=&quot;3667&quot; data-start=&quot;3635&quot;&gt;Not by jumping to complex tools.&lt;/p&gt;
&lt;p data-end=&quot;3708&quot; data-start=&quot;3669&quot;&gt;But by removing friction, step by step.&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>Detecting Text Overset in InDesign: A Minimal Script Before Automation</title>
    <id>https://www.linguist-coder.com/2026/02/detecting-text-overset-in-indesign.html</id>
    <link href="https://www.linguist-coder.com/2026/02/detecting-text-overset-in-indesign.html"/>
    <published>2026-02-02T00:31:00.000Z</published>
    <updated>2026-03-21T22:04:34.902Z</updated>
    <summary>Update (2026-02-18): Fixed a restore issue that could leave a black 1pt stroke in certain environments. Please use the updated script below. Note: In some localized versions of InDesign, the internal name of the built-in “None” swatch may differ. If…</summary>
    <content type="html">&lt;p data-end=&quot;307&quot; data-start=&quot;161&quot;&gt;&lt;strong data-end=&quot;185&quot; data-start=&quot;161&quot;&gt;Update (2026-02-18):&lt;/strong&gt;&lt;br data-end=&quot;188&quot; data-start=&quot;185&quot; /&gt;
Fixed a restore issue that could leave a black 1pt stroke in certain environments. Please use the updated script below.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p data-end=&quot;575&quot; data-start=&quot;309&quot;&gt;&lt;strong data-end=&quot;318&quot; data-start=&quot;309&quot;&gt;Note:&lt;/strong&gt;&lt;br data-end=&quot;321&quot; data-start=&quot;318&quot; /&gt;
In some localized versions of InDesign, the internal name of the built-in “None” swatch may differ. If the restore script does not correctly remove the stroke, verify the swatch name in your document and adjust the &lt;code data-end=&quot;553&quot; data-start=&quot;536&quot;&gt;getNoneSwatch()&lt;/code&gt; function accordingly.&lt;/p&gt;&lt;h2 data-end=&quot;182&quot; data-start=&quot;110&quot;&gt;Context&lt;/h2&gt;&lt;p data-end=&quot;341&quot; data-start=&quot;196&quot;&gt;In the previous article, I explained why text overset is not just a layout problem, but a &lt;strong data-end=&quot;305&quot; data-start=&quot;286&quot;&gt;scaling problem&lt;/strong&gt; in multilingual InDesign workflows.&lt;/p&gt;&lt;p data-end=&quot;491&quot; data-start=&quot;343&quot;&gt;When overset handling depends on manual inspection and ad-hoc fixes, the workflow breaks down quickly as document count and language count increase.&lt;/p&gt;&lt;p data-end=&quot;582&quot; data-start=&quot;493&quot;&gt;This article is a follow-up.&lt;br data-end=&quot;524&quot; data-start=&quot;521&quot; /&gt;It intentionally does &lt;strong data-end=&quot;553&quot; data-start=&quot;546&quot;&gt;not&lt;/strong&gt; attempt to fix overset text.&lt;/p&gt;&lt;p data-end=&quot;635&quot; data-start=&quot;584&quot;&gt;Instead, it focuses on a more fundamental question:&lt;/p&gt;&lt;blockquote data-end=&quot;713&quot; data-start=&quot;637&quot;&gt;&lt;p data-end=&quot;713&quot; data-start=&quot;639&quot;&gt;How do you reliably &lt;em data-end=&quot;664&quot; data-start=&quot;659&quot;&gt;see&lt;/em&gt; where overset exists before deciding what to do?&lt;/p&gt;&lt;/blockquote&gt;&lt;p data-end=&quot;869&quot; data-start=&quot;715&quot;&gt;If you have not read the previous article yet, it provides important context on &lt;strong data-end=&quot;838&quot; data-start=&quot;795&quot;&gt;why overset detection itself must scale&lt;/strong&gt;, not just the correction step.&lt;/p&gt;&lt;p data-end=&quot;974&quot; data-start=&quot;871&quot;&gt;Previous article:&lt;br data-end=&quot;891&quot; data-start=&quot;888&quot; /&gt;&lt;a class=&quot;decorated-link&quot; data-end=&quot;974&quot; data-start=&quot;891&quot; href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-eliminating.html&quot; rel=&quot;noopener&quot; target=&quot;_new&quot;&gt;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-eliminating.html&lt;span aria-hidden=&quot;true&quot; class=&quot;ms-0.5 inline-block align-middle leading-none&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;block h-[0.75em] w-[0.75em] stroke-current stroke-[0.75]&quot; data-rtl-flip=&quot;&quot; height=&quot;20&quot; width=&quot;20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;use fill=&quot;currentColor&quot; href=&quot;/cdn/assets/sprites-core-c9exbsc1.svg#304883&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;hr data-end=&quot;979&quot; data-start=&quot;976&quot; /&gt;&lt;h2 data-end=&quot;1033&quot; data-start=&quot;981&quot;&gt;Why Detection Still Matters (Even with Preflight)&lt;/h2&gt;&lt;p data-end=&quot;1109&quot; data-start=&quot;1035&quot;&gt;InDesign already has a Preflight feature, and it does detect overset text.&lt;/p&gt;&lt;p data-end=&quot;1169&quot; data-start=&quot;1111&quot;&gt;The problem is not &lt;em data-end=&quot;1142&quot; data-start=&quot;1130&quot;&gt;capability&lt;/em&gt;, but &lt;em data-end=&quot;1168&quot; data-start=&quot;1148&quot;&gt;usability at scale&lt;/em&gt;.&lt;/p&gt;&lt;ul data-end=&quot;1268&quot; data-start=&quot;1171&quot;&gt;&lt;li data-end=&quot;1211&quot; data-start=&quot;1171&quot;&gt;&lt;p data-end=&quot;1211&quot; data-start=&quot;1173&quot;&gt;Preflight reports issues as a &lt;strong data-end=&quot;1211&quot; data-start=&quot;1203&quot;&gt;list&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li data-end=&quot;1268&quot; data-start=&quot;1212&quot;&gt;&lt;p data-end=&quot;1268&quot; data-start=&quot;1214&quot;&gt;This script visualizes issues &lt;strong data-end=&quot;1268&quot; data-start=&quot;1244&quot;&gt;directly on the page&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;1371&quot; data-start=&quot;1270&quot;&gt;Instead of scanning rows in a panel, you flip through pages and immediately see where overset exists.&lt;/p&gt;&lt;p data-end=&quot;1423&quot; data-start=&quot;1373&quot;&gt;Think of it as a &lt;strong data-end=&quot;1413&quot; data-start=&quot;1390&quot;&gt;visual pressure map&lt;/strong&gt; for text.&lt;/p&gt;&lt;p data-end=&quot;1488&quot; data-start=&quot;1425&quot;&gt;Before fixing anything, this answers a more important question:&lt;/p&gt;&lt;blockquote data-end=&quot;1578&quot; data-start=&quot;1490&quot;&gt;&lt;p data-end=&quot;1578&quot; data-start=&quot;1492&quot;&gt;Are these a few isolated problems, or a structural issue that will not scale manually?&lt;/p&gt;&lt;/blockquote&gt;&lt;hr data-end=&quot;1583&quot; data-start=&quot;1580&quot; /&gt;&lt;h2 data-end=&quot;1625&quot; data-start=&quot;1585&quot;&gt;Design Philosophy of This Free Sample&lt;/h2&gt;&lt;p data-end=&quot;1664&quot; data-start=&quot;1627&quot;&gt;This script is intentionally limited.&lt;/p&gt;&lt;h3 data-end=&quot;1682&quot; data-start=&quot;1666&quot;&gt;What it does&lt;/h3&gt;&lt;ul data-end=&quot;1891&quot; data-start=&quot;1684&quot;&gt;&lt;li data-end=&quot;1750&quot; data-start=&quot;1684&quot;&gt;&lt;p data-end=&quot;1750&quot; data-start=&quot;1686&quot;&gt;Scans all text frames in the document (including master spreads)&lt;/p&gt;&lt;/li&gt;&lt;li data-end=&quot;1780&quot; data-start=&quot;1751&quot;&gt;&lt;p data-end=&quot;1780&quot; data-start=&quot;1753&quot;&gt;Detects overset text frames&lt;/p&gt;&lt;/li&gt;&lt;li data-end=&quot;1847&quot; data-start=&quot;1781&quot;&gt;&lt;p data-end=&quot;1847&quot; data-start=&quot;1783&quot;&gt;Makes them visually obvious using stroke color and stroke weight&lt;/p&gt;&lt;/li&gt;&lt;li data-end=&quot;1891&quot; data-start=&quot;1848&quot;&gt;&lt;p data-end=&quot;1891&quot; data-start=&quot;1850&quot;&gt;Stores minimal metadata for later cleanup&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 data-end=&quot;1918&quot; data-start=&quot;1893&quot;&gt;What it does &lt;em data-end=&quot;1915&quot; data-start=&quot;1910&quot;&gt;not&lt;/em&gt; do&lt;/h3&gt;&lt;ul data-end=&quot;2015&quot; data-start=&quot;1920&quot;&gt;&lt;li data-end=&quot;1947&quot; data-start=&quot;1920&quot;&gt;&lt;p data-end=&quot;1947&quot; data-start=&quot;1922&quot;&gt;Automatically fix overset&lt;/p&gt;&lt;/li&gt;&lt;li data-end=&quot;1973&quot; data-start=&quot;1948&quot;&gt;&lt;p data-end=&quot;1973&quot; data-start=&quot;1950&quot;&gt;Change text composition&lt;/p&gt;&lt;/li&gt;&lt;li data-end=&quot;2015&quot; data-start=&quot;1974&quot;&gt;&lt;p data-end=&quot;2015&quot; data-start=&quot;1976&quot;&gt;Adjust fonts, tracking, or layout rules&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;2036&quot; data-start=&quot;2017&quot;&gt;This is deliberate.&lt;/p&gt;&lt;p data-end=&quot;2171&quot; data-start=&quot;2038&quot;&gt;Overset correction requires context and judgment.&lt;br data-end=&quot;2090&quot; data-start=&quot;2087&quot; /&gt;Blind automation in this area is more likely to damage layouts than improve them.&lt;/p&gt;&lt;p data-end=&quot;2245&quot; data-start=&quot;2173&quot;&gt;This sample exists to support &lt;strong data-end=&quot;2228&quot; data-start=&quot;2203&quot;&gt;human decision-making&lt;/strong&gt;, not replace it.&lt;/p&gt;&lt;hr data-end=&quot;2250&quot; data-start=&quot;2247&quot; /&gt;&lt;h2 data-end=&quot;2287&quot; data-start=&quot;2252&quot;&gt;Why Stroke Color + Stroke Weight&lt;/h2&gt;&lt;p data-end=&quot;2318&quot; data-start=&quot;2289&quot;&gt;Overset frames are marked by:&lt;/p&gt;&lt;ul data-end=&quot;2435&quot; data-start=&quot;2320&quot;&gt;&lt;li data-end=&quot;2393&quot; data-start=&quot;2320&quot;&gt;&lt;p data-end=&quot;2393&quot; data-start=&quot;2322&quot;&gt;Changing the &lt;strong data-end=&quot;2351&quot; data-start=&quot;2335&quot;&gt;stroke color&lt;/strong&gt; (e.g. a bright warning color such as red)&lt;/p&gt;&lt;/li&gt;&lt;li data-end=&quot;2435&quot; data-start=&quot;2394&quot;&gt;&lt;p data-end=&quot;2435&quot; data-start=&quot;2396&quot;&gt;Increasing the &lt;strong data-end=&quot;2435&quot; data-start=&quot;2411&quot;&gt;stroke weight to 2pt&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;2512&quot; data-start=&quot;2437&quot;&gt;The fill is left untouched to avoid interfering with layout or readability.&lt;/p&gt;&lt;p data-end=&quot;2605&quot; data-start=&quot;2514&quot;&gt;Increasing stroke weight is intentional.&lt;br data-end=&quot;2557&quot; data-start=&quot;2554&quot; /&gt;Without it, visibility is poor in dense layouts.&lt;/p&gt;&lt;p data-end=&quot;2631&quot; data-start=&quot;2607&quot;&gt;Important clarification:&lt;br /&gt;&lt;b&gt;This script does not change text content or layout decisions.&lt;/b&gt;&lt;/p&gt;&lt;p data-end=&quot;2631&quot; data-start=&quot;2607&quot;&gt;It only adds a temporary visual marker to help you identify where overset occurs.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/5RRmToc_yLo&quot; width=&quot;320&quot; youtube-src-id=&quot;5RRmToc_yLo&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;p data-end=&quot;2631&quot; data-start=&quot;2607&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;hr data-end=&quot;2731&quot; data-start=&quot;2728&quot; /&gt;&lt;h2 data-end=&quot;2778&quot; data-start=&quot;2733&quot;&gt;Detection Script: Mark Overset Text Frames&lt;/h2&gt;

&lt;pre style=&quot;background: rgb(17, 24, 39); border-radius: 8px; color: #e5e7eb; font-family: Consolas, Monaco, monospace; overflow: auto; padding: 16px; white-space: pre;&quot;&gt;&lt;code&gt;#target indesign

/*
Detect overset text frames and mark them with a warning stroke.
Marker is stored in TextFrame.label as:
  |LC_OVRSET_V1{c=&amp;lt;origStrokeColorToken&amp;gt;;w=&amp;lt;origStrokeWeight&amp;gt;}
Where c=@NONE means &quot;no stroke&quot; (None).

Note:
- Some environments are sensitive to file encoding. If the script does not run, save as &quot;UTF-8 with BOM&quot;.
*/

(function () {
    var MARK_KEY = &quot;LC_OVRSET_V1&quot;;
    var NONE_TOKEN = &quot;@NONE&quot;;
    var WARN_STROKE_WEIGHT = 2; // pt
    var WARN_SWATCH_NAME = &quot;LC_Overset_Warn&quot;;

    if (app.documents.length === 0) {
        alert(&quot;No documents are currently open.&quot;);
        return;
    }

    var doc = app.activeDocument;
    var frames = collectAllTextFrames(doc);

    var scanned = frames.length;
    var oversetFound = 0;
    var marked = 0;
    var alreadyMarked = 0;
    var skippedLocked = 0;
    var skippedErrors = 0;

    for (var i = 0; i &amp;lt; frames.length; i++) {
        var tf = frames[i];
        if (!tf || !tf.isValid) continue;

        try {
            if (!tf.overflows) continue;
            oversetFound++;

            // Avoid label pollution on repeated runs
            if (tf.label &amp;amp;&amp;amp; tf.label.indexOf(&quot;|&quot; + MARK_KEY + &quot;{&quot;) !== -1) {
                alreadyMarked++;
                continue;
            }

            if (isLockedOrOnLockedLayer(tf)) {
                skippedLocked++;
                continue;
            }

            // Capture original stroke
            var origColorToken = getStrokeColorToken(doc, tf, NONE_TOKEN);
            var origWeight = safeNumber(tf.strokeWeight, 0);

            // Apply warning stroke
            tf.strokeColor = getWarningSwatch(doc, WARN_SWATCH_NAME);
            tf.strokeWeight = WARN_STROKE_WEIGHT;

            // Store marker
            tf.label = (tf.label || &quot;&quot;) +
                &quot;|&quot; + MARK_KEY + &quot;{c=&quot; + origColorToken + &quot;;w=&quot; + origWeight + &quot;}&quot;;

            marked++;

        } catch (e) {
            skippedErrors++;
        }
    }

    alert(buildSummary());

    function buildSummary() {
        var lines = [];
        lines.push(&quot;Overset detection completed.&quot;);
        lines.push(&quot;&quot;);
        lines.push(&quot;Text frames scanned: &quot; + scanned);
        lines.push(&quot;Overset frames found: &quot; + oversetFound);
        lines.push(&quot;Marked: &quot; + marked);
        lines.push(&quot;Already marked: &quot; + alreadyMarked);

        if (skippedLocked &amp;gt; 0 || skippedErrors &amp;gt; 0) {
            lines.push(&quot;&quot;);
            lines.push(&quot;Warnings:&quot;);
            if (skippedLocked &amp;gt; 0) lines.push(&quot;- Skipped (locked object or layer): &quot; + skippedLocked);
            if (skippedErrors &amp;gt; 0) lines.push(&quot;- Skipped (other errors): &quot; + skippedErrors);
        }
        return lines.join(&quot;\n&quot;);
    }

    function collectAllTextFrames(doc) {
        var result = [];

        try { collectFromItems(doc.allPageItems, result); } catch (e) {}

        // Include master items
        try {
            for (var m = 0; m &amp;lt; doc.masterSpreads.length; m++) {
                try { collectFromItems(doc.masterSpreads[m].allPageItems, result); } catch (e2) {}
            }
        } catch (e3) {}

        return result;

        function collectFromItems(items, out) {
            var len = 0;
            try { len = items.length; } catch (e) { return; }
            for (var i = 0; i &amp;lt; len; i++) {
                try {
                    var it = items[i];
                    if (it &amp;amp;&amp;amp; it.isValid &amp;amp;&amp;amp; it.constructor.name === &quot;TextFrame&quot;) out.push(it);
                } catch (e2) {}
            }
        }
    }

    function isLockedOrOnLockedLayer(tf) {
        try { if (tf.locked) return true; } catch (e) {}
        try { if (tf.itemLayer &amp;amp;&amp;amp; tf.itemLayer.locked) return true; } catch (e2) {}
        return false;
    }

    function getStrokeColorToken(doc, tf, noneToken) {
        try {
            var c = tf.strokeColor;
            if (isNoneLike(doc, c)) return noneToken;
            return (c &amp;amp;&amp;amp; c.isValid &amp;amp;&amp;amp; c.name) ? c.name : noneToken;
        } catch (e) {
            return noneToken;
        }
    }

    // Robust &quot;None&quot; detection (locale-safe enough for common environments)
    function isNoneLike(doc, colorObj) {
        if (!colorObj) return true;
        try { if (!colorObj.isValid) return true; } catch (e0) { return true; }

        // Name-based (works in your environment: &quot;None&quot;)
        try {
            var n = colorObj.name;
            if (n === &quot;None&quot; || n === &quot;[None]&quot;) return true;
        } catch (e1) {}

        // Identity-based fallback
        try {
            var noneSw = getNoneSwatch(doc);
            if (noneSw &amp;amp;&amp;amp; noneSw.isValid &amp;amp;&amp;amp; colorObj === noneSw) return true;
        } catch (e2) {}

        return false;
    }

    function getNoneSwatch(doc) {
        // Your environment uses &quot;None&quot;, but keep both for portability.
        try { var s0 = doc.swatches.itemByName(&quot;None&quot;); s0.name; return s0; } catch (e0) {}
        try { var s1 = doc.swatches.itemByName(&quot;[None]&quot;); s1.name; return s1; } catch (e1) {}

        // Minimal scan fallback
        try {
            for (var i = 0; i &amp;lt; doc.swatches.length; i++) {
                var sw = doc.swatches[i];
                if (!sw || !sw.isValid) continue;
                var nm = &quot;&quot;;
                try { nm = sw.name; } catch (e2) {}
                if (nm === &quot;None&quot; || nm === &quot;[None]&quot;) return sw;
            }
        } catch (e3) {}

        return null;
    }

    function getWarningSwatch(doc, swatchName) {
        try {
            var s = doc.colors.itemByName(swatchName);
            s.name; // validate
            return s;
        } catch (e) {
            return doc.colors.add({
                name: swatchName,
                model: ColorModel.PROCESS,
                space: ColorSpace.RGB,
                colorValue: [255, 0, 0]
            });
        }
    }

    function safeNumber(n, fallback) {
        var v = parseFloat(n);
        return isNaN(v) ? fallback : v;
    }

})();&lt;/code&gt;
&lt;/pre&gt;

&lt;hr data-end=&quot;7260&quot; data-start=&quot;7257&quot; /&gt;&lt;h2 data-end=&quot;7299&quot; data-start=&quot;7262&quot;&gt;Restore Script (Cleanup, Not Undo)&lt;/h2&gt;&lt;p data-end=&quot;3466&quot; data-start=&quot;3397&quot;&gt;This restore script exists for &lt;strong data-end=&quot;3439&quot; data-start=&quot;3428&quot;&gt;cleanup&lt;/strong&gt;, not for perfect rollback.&lt;/p&gt;&lt;p data-end=&quot;3585&quot; data-start=&quot;3468&quot;&gt;If your goal is simply to undo the script execution,&lt;br data-end=&quot;3523&quot; data-start=&quot;3520&quot; /&gt;
&lt;strong data-end=&quot;3584&quot; data-start=&quot;3523&quot;&gt;InDesign’s built-in “Revert” feature is the safest option&lt;/strong&gt;.&lt;/p&gt;&lt;p data-end=&quot;3646&quot; data-start=&quot;3587&quot;&gt;The restore script is intended for two specific situations:&lt;/p&gt;&lt;ul data-end=&quot;3787&quot; data-start=&quot;3648&quot;&gt;
&lt;li data-end=&quot;3725&quot; data-start=&quot;3648&quot;&gt;
&lt;p data-end=&quot;3725&quot; data-start=&quot;3650&quot;&gt;After you manually fix overset text and want to remove the visual markers&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3787&quot; data-start=&quot;3726&quot;&gt;
&lt;p data-end=&quot;3787&quot; data-start=&quot;3728&quot;&gt;When you forgot to save before running the detection script&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;3898&quot; data-start=&quot;3789&quot;&gt;It removes &lt;strong data-end=&quot;3832&quot; data-start=&quot;3800&quot;&gt;only the visualization layer&lt;/strong&gt;&lt;br data-end=&quot;3835&quot; data-start=&quot;3832&quot; /&gt;
(stroke color and stroke weight added by the detection script).&lt;/p&gt;&lt;p data-end=&quot;4028&quot; data-start=&quot;3900&quot;&gt;It does &lt;strong data-end=&quot;3915&quot; data-start=&quot;3908&quot;&gt;not&lt;/strong&gt; attempt to restore all original appearance details&lt;br data-end=&quot;3969&quot; data-start=&quot;3966&quot; /&gt;
such as stroke style, tint, or other decorative attributes.&lt;/p&gt;&lt;h3 data-end=&quot;4054&quot; data-start=&quot;4030&quot;&gt;Implementation notes&lt;/h3&gt;&lt;p data-end=&quot;4137&quot; data-start=&quot;4056&quot;&gt;The restore logic is written defensively to handle real-world InDesign documents:&lt;/p&gt;&lt;ul data-end=&quot;4397&quot; data-start=&quot;4139&quot;&gt;
&lt;li data-end=&quot;4212&quot; data-start=&quot;4139&quot;&gt;
&lt;p data-end=&quot;4212&quot; data-start=&quot;4141&quot;&gt;Frames that became invalid (e.g. after ungrouping) are skipped safely&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4266&quot; data-start=&quot;4213&quot;&gt;
&lt;p data-end=&quot;4266&quot; data-start=&quot;4215&quot;&gt;Locked objects and locked layers are not modified&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4324&quot; data-start=&quot;4267&quot;&gt;
&lt;p data-end=&quot;4324&quot; data-start=&quot;4269&quot;&gt;Multiple markers from previous runs are fully removed&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4397&quot; data-start=&quot;4325&quot;&gt;
&lt;p data-end=&quot;4397&quot; data-start=&quot;4327&quot;&gt;Frames that originally had no stroke are explicitly restored to “None”&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;4474&quot; data-start=&quot;4399&quot;&gt;This keeps the script predictable and avoids leaving warning styles behind.&lt;/p&gt;&lt;h3 data-end=&quot;4498&quot; data-start=&quot;4476&quot;&gt;About Undo support&lt;/h3&gt;&lt;p data-end=&quot;4572&quot; data-start=&quot;4500&quot;&gt;For simplicity, this sample does not wrap changes in a single Undo step.&lt;/p&gt;&lt;p data-end=&quot;4740&quot; data-start=&quot;4574&quot;&gt;If you adapt this logic for production use,&lt;br data-end=&quot;4620&quot; data-start=&quot;4617&quot; /&gt;
wrapping the script with &lt;code data-end=&quot;4664&quot; data-start=&quot;4645&quot;&gt;app.doScript(...)&lt;/code&gt; and &lt;code data-end=&quot;4694&quot; data-start=&quot;4669&quot;&gt;UndoModes.ENTIRE_SCRIPT&lt;/code&gt;&lt;br data-end=&quot;4697&quot; data-start=&quot;4694&quot; /&gt;
is the standard approach to improve safety.&lt;/p&gt;&lt;p data-end=&quot;7370&quot; data-start=&quot;7301&quot;&gt;













&lt;/p&gt;&lt;p data-end=&quot;4861&quot; data-start=&quot;4742&quot;&gt;This sample intentionally avoids that step&lt;br data-end=&quot;4787&quot; data-start=&quot;4784&quot; /&gt;
to keep the focus on &lt;strong data-end=&quot;4860&quot; data-start=&quot;4808&quot;&gt;conceptual clarity rather than tool completeness&lt;/strong&gt;.&lt;/p&gt;&lt;hr data-end=&quot;7807&quot; data-start=&quot;7804&quot; /&gt;&lt;h2 data-end=&quot;7850&quot; data-start=&quot;7809&quot;&gt;Restore Script: Remove Overset Markers&lt;/h2&gt;

&lt;pre style=&quot;background: rgb(17, 24, 39); border-radius: 8px; color: #e5e7eb; font-family: Consolas, Monaco, monospace; overflow: auto; padding: 16px; white-space: pre;&quot;&gt;&lt;code&gt;#target indesign

(function () {
    var MARK_KEY = &quot;LC_OVRSET_V1&quot;;
    var NONE_TOKEN = &quot;@NONE&quot;;

    if (app.documents.length === 0) {
        alert(&quot;No documents are currently open.&quot;);
        return;
    }

    var doc = app.activeDocument;
    var frames = collectAllTextFrames(doc);

    var scanned = frames.length;
    var restored = 0;
    var notMarked = 0;
    var skippedLocked = 0;
    var skippedErrors = 0;
    var failedSetNone = 0;

    for (var i = 0; i &amp;lt; frames.length; i++) {
        var tf = frames[i];
        if (!tf || !tf.isValid) continue;

        try {
            var parsed = parseLastMark(tf.label, MARK_KEY);
            if (!parsed) { notMarked++; continue; }

            if (isLockedOrOnLockedLayer(tf)) { skippedLocked++; continue; }

            if (parsed.colorToken === NONE_TOKEN) {
                // Force None + 0
                if (!setNoStroke(doc, tf)) {
                    failedSetNone++;
                }
            } else {
                // Restore original color if resolvable
                var restoredColor = resolveColorOrSwatch(doc, parsed.colorToken);
                if (restoredColor) tf.strokeColor = restoredColor;

                if (!isNaN(parsed.weight)) tf.strokeWeight = parsed.weight;
            }

            tf.label = removeAllMarks(tf.label, MARK_KEY);
            restored++;

        } catch (e) {
            skippedErrors++;
        }
    }

    alert(
        &quot;Restore completed.\n\n&quot; +
        &quot;Text frames scanned: &quot; + scanned + &quot;\n&quot; +
        &quot;Restored (marker removed): &quot; + restored + &quot;\n&quot; +
        &quot;Not marked: &quot; + notMarked + &quot;\n&quot; +
        (skippedLocked ? (&quot;Skipped locked: &quot; + skippedLocked + &quot;\n&quot;) : &quot;&quot;) +
        (failedSetNone ? (&quot;Failed to set None (kept stroke): &quot; + failedSetNone + &quot;\n&quot;) : &quot;&quot;) +
        (skippedErrors ? (&quot;Errors: &quot; + skippedErrors + &quot;\n&quot;) : &quot;&quot;)
    );

    function setNoStroke(doc, tf) {
        // Get &quot;None&quot; swatch fresh each time (environment-safe)
        var noneSw = getNoneSwatch(doc);
        if (!noneSw) {
            // If we can&apos;t even find None, at least set weight=0
            try { tf.strokeWeight = 0; } catch (e0) {}
            return false;
        }

        // Apply
        try { tf.strokeColor = noneSw; } catch (e1) {}
        try { tf.strokeWeight = 0; } catch (e2) {}

        // Verify (some environments keep old strokeColor)
        try {
            var sc = tf.strokeColor;
            var nm = sc &amp;amp;&amp;amp; sc.isValid ? sc.name : &quot;&quot;;
            if (nm === &quot;None&quot; || nm === &quot;[None]&quot; || nm === &quot;なし&quot; || nm === &quot;[なし]&quot;) return true;
        } catch (e3) {}

        // Retry once
        try { tf.strokeColor = noneSw; } catch (e4) {}
        return true;
    }

    function collectAllTextFrames(doc) {
        var result = [];
        try { collectFromItems(doc.allPageItems, result); } catch (e) {}
        try {
            for (var m = 0; m &amp;lt; doc.masterSpreads.length; m++) {
                try { collectFromItems(doc.masterSpreads[m].allPageItems, result); } catch (e2) {}
            }
        } catch (e3) {}
        return result;

        function collectFromItems(items, out) {
            var len = 0;
            try { len = items.length; } catch (e) { return; }
            for (var i = 0; i &amp;lt; len; i++) {
                try {
                    var it = items[i];
                    if (it &amp;amp;&amp;amp; it.isValid &amp;amp;&amp;amp; it.constructor.name === &quot;TextFrame&quot;) out.push(it);
                } catch (e2) {}
            }
        }
    }

    function isLockedOrOnLockedLayer(tf) {
        try { if (tf.locked) return true; } catch (e) {}
        try { if (tf.itemLayer &amp;amp;&amp;amp; tf.itemLayer.locked) return true; } catch (e2) {}
        return false;
    }

    function parseLastMark(label, key) {
        if (!label) return null;

        var needle = &quot;|&quot; + key + &quot;{&quot;;
        var pos = label.lastIndexOf(needle);
        if (pos === -1) return null;

        var end = label.indexOf(&quot;}&quot;, pos);
        if (end === -1) return null;

        var token = label.substring(pos + needle.length, end);
        var parts = token.split(&quot;;&quot;);

        var colorToken = &quot;&quot;;
        var weight = NaN;

        for (var i = 0; i &amp;lt; parts.length; i++) {
            var kv = parts[i].split(&quot;=&quot;);
            if (kv.length !== 2) continue;
            if (kv[0] === &quot;c&quot;) colorToken = kv[1];
            if (kv[0] === &quot;w&quot;) weight = parseFloat(kv[1]);
        }

        return { colorToken: colorToken, weight: weight };
    }

    function removeAllMarks(label, key) {
        if (!label) return &quot;&quot;;
        var needle = &quot;|&quot; + key + &quot;{&quot;;
        var out = label;
        while (true) {
            var start = out.indexOf(needle);
            if (start === -1) break;
            var end = out.indexOf(&quot;}&quot;, start);
            if (end === -1) break;
            out = out.substring(0, start) + out.substring(end + 1);
        }
        return out;
    }

    function getNoneSwatch(doc) {
        // Your environment shows &quot;None (Swatch)&quot; so try &quot;None&quot; first.
        try { var s0 = doc.swatches.itemByName(&quot;None&quot;); s0.name; return s0; } catch (e0) {}
        try { var s1 = doc.swatches.itemByName(&quot;[None]&quot;); s1.name; return s1; } catch (e1) {}

        // Scan by name / constructor
        try {
            for (var i = 0; i &amp;lt; doc.swatches.length; i++) {
                var sw = doc.swatches[i];
                if (!sw || !sw.isValid) continue;
                var nm = &quot;&quot;;
                var cn = &quot;&quot;;
                try { nm = sw.name; } catch (e2) {}
                try { cn = sw.constructor &amp;amp;&amp;amp; sw.constructor.name ? sw.constructor.name : &quot;&quot;; } catch (e3) {}
                if (nm === &quot;None&quot; || nm === &quot;[None]&quot; || nm === &quot;なし&quot; || nm === &quot;[なし]&quot; || cn === &quot;NoColor&quot;) return sw;
            }
        } catch (e4) {}

        return null;
    }

    function resolveColorOrSwatch(doc, name) {
        if (!name) return null;

        try {
            var c = doc.colors.itemByName(name);
            if (c &amp;amp;&amp;amp; c.isValid) return c;
        } catch (e1) {}

        try {
            var s = doc.swatches.itemByName(name);
            if (s &amp;amp;&amp;amp; s.isValid) return s;
        } catch (e2) {}

        return null;
    }

})();&lt;/code&gt;
&lt;/pre&gt;

&lt;hr data-end=&quot;13241&quot; data-start=&quot;13238&quot; /&gt;&lt;h2 data-end=&quot;13262&quot; data-start=&quot;13243&quot;&gt;Closing Thoughts&lt;/h2&gt;&lt;p data-end=&quot;13303&quot; data-start=&quot;13264&quot;&gt;Overset itself is not the real problem.&lt;/p&gt;&lt;p data-end=&quot;13399&quot; data-start=&quot;13305&quot;&gt;The real problem is mixing &lt;strong data-end=&quot;13345&quot; data-start=&quot;13332&quot;&gt;detection&lt;/strong&gt;, &lt;strong data-end=&quot;13359&quot; data-start=&quot;13347&quot;&gt;judgment&lt;/strong&gt;, and &lt;strong data-end=&quot;13379&quot; data-start=&quot;13365&quot;&gt;correction&lt;/strong&gt; into a single step.&lt;/p&gt;&lt;p data-end=&quot;13534&quot; data-start=&quot;13401&quot;&gt;This free sample exists to separate those concerns —&lt;br data-end=&quot;13456&quot; data-start=&quot;13453&quot; /&gt;not to fix everything, but to help you decide &lt;strong data-end=&quot;13533&quot; data-start=&quot;13502&quot;&gt;what deserves fixing at all&lt;/strong&gt;.&lt;/p&gt;&lt;p data-end=&quot;13603&quot; data-start=&quot;13536&quot;&gt;That separation is what allows multilingual DTP workflows to scale.&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>Scaling Multilingual DTP – Maintenance / Recovery: When and How to Clean Up InDesign Files with IDML</title>
    <id>https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-maintenance.html</id>
    <link href="https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-maintenance.html"/>
    <published>2026-01-29T01:36:00.000Z</published>
    <updated>2026-09-18T23:12:07.013Z</updated>
    <summary>0. Why This Article Exists Recovery as Part of Scaling The Scaling Multilingual DTP series has covered the parts that are easier to systematize: pre-export for translation (IDML export from books) automation before/after translation (style reloads, relinking) final QA (PDF…</summary>
    <content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 data-end=&quot;144&quot; data-start=&quot;113&quot;&gt;0. Why This Article Exists&lt;/h2&gt;
&lt;h3 data-end=&quot;176&quot; data-start=&quot;145&quot;&gt;Recovery as Part of Scaling&lt;/h3&gt;
&lt;p data-end=&quot;269&quot; data-start=&quot;178&quot;&gt;The &lt;em data-end=&quot;208&quot; data-start=&quot;182&quot;&gt;Scaling Multilingual DTP&lt;/em&gt; series has covered the parts that are easier to systematize:&lt;/p&gt;
&lt;ul data-end=&quot;517&quot; data-start=&quot;271&quot;&gt;
&lt;li data-end=&quot;326&quot; data-start=&quot;271&quot;&gt;
&lt;p data-end=&quot;326&quot; data-start=&quot;273&quot;&gt;pre-export for translation (IDML export from books)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;393&quot; data-start=&quot;327&quot;&gt;
&lt;p data-end=&quot;393&quot; data-start=&quot;329&quot;&gt;automation before/after translation (style reloads, relinking)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;435&quot; data-start=&quot;394&quot;&gt;
&lt;p data-end=&quot;435&quot; data-start=&quot;396&quot;&gt;final QA (PDF required-string checks)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;517&quot; data-start=&quot;436&quot;&gt;
&lt;p data-end=&quot;517&quot; data-start=&quot;438&quot;&gt;“escape hatches” when the layout pressure becomes too high (bulk image scaling)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;661&quot; data-start=&quot;519&quot;&gt;This final article is different. It is not about adding another layer of automation.&lt;br data-end=&quot;606&quot; data-start=&quot;603&quot; /&gt;
It is about &lt;strong data-end=&quot;660&quot; data-start=&quot;618&quot;&gt;protecting what you have already built&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;870&quot; data-start=&quot;663&quot;&gt;When you scale a workflow, you eventually hit a different kind of problem:&lt;br data-end=&quot;740&quot; data-start=&quot;737&quot; /&gt;
files that become unstable, inconsistent, or unpredictable—often after years of edits, template reuse, or a major InDesign update.&lt;/p&gt;
&lt;p data-end=&quot;1110&quot; data-start=&quot;872&quot;&gt;IDML cleanup is not a magic wand.&lt;br data-end=&quot;908&quot; data-start=&quot;905&quot; /&gt;
Especially in multilingual production, you may see &lt;strong data-end=&quot;1010&quot; data-start=&quot;959&quot;&gt;unexpected line breaks or subtle reflow changes&lt;/strong&gt; after an IDML round trip. That is exactly why this is a &lt;strong data-end=&quot;1089&quot; data-start=&quot;1067&quot;&gt;strategic decision&lt;/strong&gt;, not a routine step.&lt;/p&gt;
&lt;p data-end=&quot;1210&quot; data-start=&quot;1112&quot;&gt;Scaling is not about “never breaking.”&lt;br data-end=&quot;1153&quot; data-start=&quot;1150&quot; /&gt;
It is about having a reliable way back when things break.&lt;/p&gt;
&lt;hr data-end=&quot;1215&quot; data-start=&quot;1212&quot; /&gt;
&lt;h2 data-end=&quot;1257&quot; data-start=&quot;1217&quot;&gt;1. IDML Cleanup Is Not a Routine Task&lt;/h2&gt;
&lt;p data-end=&quot;1325&quot; data-start=&quot;1259&quot;&gt;IDML cleanup is best treated as a &lt;strong data-end=&quot;1324&quot; data-start=&quot;1293&quot;&gt;maintenance / recovery tool&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;1388&quot; data-start=&quot;1327&quot;&gt;If it becomes part of your daily workflow, two things happen:&lt;/p&gt;
&lt;ul data-end=&quot;1489&quot; data-start=&quot;1390&quot;&gt;
&lt;li data-end=&quot;1446&quot; data-start=&quot;1390&quot;&gt;
&lt;p data-end=&quot;1446&quot; data-start=&quot;1392&quot;&gt;you increase the amount of “extra work” you generate&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1489&quot; data-start=&quot;1447&quot;&gt;
&lt;p data-end=&quot;1489&quot; data-start=&quot;1449&quot;&gt;you pay the verification cost repeatedly&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1568&quot; data-start=&quot;1491&quot;&gt;In other words, frequent cleanup can reduce stability rather than improve it.&lt;/p&gt;
&lt;p data-end=&quot;1598&quot; data-start=&quot;1570&quot;&gt;The correct mental model is:&lt;/p&gt;
&lt;ul data-end=&quot;1714&quot; data-start=&quot;1600&quot;&gt;
&lt;li data-end=&quot;1644&quot; data-start=&quot;1600&quot;&gt;
&lt;p data-end=&quot;1644&quot; data-start=&quot;1602&quot;&gt;&lt;strong data-end=&quot;1619&quot; data-start=&quot;1602&quot;&gt;Routine steps&lt;/strong&gt; keep production moving&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1714&quot; data-start=&quot;1645&quot;&gt;
&lt;p data-end=&quot;1714&quot; data-start=&quot;1647&quot;&gt;&lt;strong data-end=&quot;1665&quot; data-start=&quot;1647&quot;&gt;Recovery steps&lt;/strong&gt; exist to restore stability when something is off&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1839&quot; data-start=&quot;1716&quot;&gt;IDML cleanup belongs to the second category.&lt;br data-end=&quot;1763&quot; data-start=&quot;1760&quot; /&gt;
It is a “last resort” tool—useful, powerful, and not meant for everyday use.&lt;/p&gt;
&lt;hr data-end=&quot;1844&quot; data-start=&quot;1841&quot; /&gt;
&lt;h2 data-end=&quot;1892&quot; data-start=&quot;1846&quot;&gt;2. When IDML Cleanup Actually Makes Sense&lt;/h2&gt;
&lt;h3 data-end=&quot;1919&quot; data-start=&quot;1893&quot;&gt;A Go / No-Go Checklist&lt;/h3&gt;
&lt;p data-end=&quot;1968&quot; data-start=&quot;1921&quot;&gt;This is the most important part of the article.&lt;/p&gt;
&lt;h3 data-end=&quot;2000&quot; data-start=&quot;1970&quot;&gt;Go (consider IDML cleanup)&lt;/h3&gt;
&lt;p data-end=&quot;2100&quot; data-start=&quot;2002&quot;&gt;Use IDML cleanup when you have a clear reason to believe the file’s internal state is the problem:&lt;/p&gt;
&lt;ul data-end=&quot;2415&quot; data-start=&quot;2102&quot;&gt;
&lt;li data-end=&quot;2180&quot; data-start=&quot;2102&quot;&gt;
&lt;p data-end=&quot;2180&quot; data-start=&quot;2104&quot;&gt;&lt;strong data-end=&quot;2137&quot; data-start=&quot;2104&quot;&gt;After a major InDesign update&lt;/strong&gt;, especially for high-stakes deliverables&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2264&quot; data-start=&quot;2181&quot;&gt;
&lt;p data-end=&quot;2264&quot; data-start=&quot;2183&quot;&gt;&lt;strong data-end=&quot;2216&quot; data-start=&quot;2183&quot;&gt;Unexplained unstable behavior&lt;/strong&gt; (random glitches, unexpected errors, crashes)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2343&quot; data-start=&quot;2265&quot;&gt;
&lt;p data-end=&quot;2343&quot; data-start=&quot;2267&quot;&gt;&lt;strong data-end=&quot;2290&quot; data-start=&quot;2267&quot;&gt;Abnormal file bloat&lt;/strong&gt; (file size grows beyond what the content explains)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2415&quot; data-start=&quot;2344&quot;&gt;
&lt;p data-end=&quot;2415&quot; data-start=&quot;2346&quot;&gt;&lt;strong data-end=&quot;2377&quot; data-start=&quot;2346&quot;&gt;Long-lived master templates&lt;/strong&gt; reused for years across many projects&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;2449&quot; data-start=&quot;2417&quot;&gt;No-Go (probably unnecessary)&lt;/h3&gt;
&lt;p data-end=&quot;2513&quot; data-start=&quot;2451&quot;&gt;Avoid it when the issue is likely caused by something simpler:&lt;/p&gt;
&lt;ul data-end=&quot;2653&quot; data-start=&quot;2515&quot;&gt;
&lt;li data-end=&quot;2574&quot; data-start=&quot;2515&quot;&gt;
&lt;p data-end=&quot;2574&quot; data-start=&quot;2517&quot;&gt;minor, visible layout issues that can be fixed directly&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2601&quot; data-start=&quot;2575&quot;&gt;
&lt;p data-end=&quot;2601&quot; data-start=&quot;2577&quot;&gt;clear editing mistakes&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2653&quot; data-start=&quot;2602&quot;&gt;
&lt;p data-end=&quot;2653&quot; data-start=&quot;2604&quot;&gt;“just in case” cleanup without a concrete trigger&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2813&quot; data-start=&quot;2655&quot;&gt;The goal is not to “keep files clean.”&lt;br data-end=&quot;2696&quot; data-start=&quot;2693&quot; /&gt;
The goal is to &lt;strong data-end=&quot;2732&quot; data-start=&quot;2711&quot;&gt;recover stability&lt;/strong&gt; when the cost of instability becomes higher than the cost of an IDML round trip.&lt;/p&gt;
&lt;hr data-end=&quot;2818&quot; data-start=&quot;2815&quot; /&gt;
&lt;h2 data-end=&quot;2849&quot; data-start=&quot;2820&quot;&gt;3. Save / Save As / IDML&lt;/h2&gt;
&lt;h3 data-end=&quot;2880&quot; data-start=&quot;2850&quot;&gt;What Is Actually Different&lt;/h3&gt;
&lt;p data-end=&quot;2929&quot; data-start=&quot;2882&quot;&gt;When InDesign feels unstable, people often try:&lt;/p&gt;
&lt;ul data-end=&quot;2969&quot; data-start=&quot;2931&quot;&gt;
&lt;li data-end=&quot;2939&quot; data-start=&quot;2931&quot;&gt;
&lt;p data-end=&quot;2939&quot; data-start=&quot;2933&quot;&gt;Save&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2951&quot; data-start=&quot;2940&quot;&gt;
&lt;p data-end=&quot;2951&quot; data-start=&quot;2942&quot;&gt;Save As&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2969&quot; data-start=&quot;2952&quot;&gt;
&lt;p data-end=&quot;2969&quot; data-start=&quot;2954&quot;&gt;IDML round trip&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2996&quot; data-start=&quot;2971&quot;&gt;These are not equivalent.&lt;/p&gt;
&lt;p data-end=&quot;3041&quot; data-start=&quot;2998&quot;&gt;A useful way to think about the difference:&lt;/p&gt;
&lt;ul data-end=&quot;3172&quot; data-start=&quot;3043&quot;&gt;
&lt;li data-end=&quot;3085&quot; data-start=&quot;3043&quot;&gt;
&lt;p data-end=&quot;3085&quot; data-start=&quot;3045&quot;&gt;&lt;strong data-end=&quot;3053&quot; data-start=&quot;3045&quot;&gt;Save&lt;/strong&gt;: putting a bandage on a wound&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3120&quot; data-start=&quot;3086&quot;&gt;
&lt;p data-end=&quot;3120&quot; data-start=&quot;3088&quot;&gt;&lt;strong data-end=&quot;3099&quot; data-start=&quot;3088&quot;&gt;Save As&lt;/strong&gt;: cleaning the room&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3172&quot; data-start=&quot;3121&quot;&gt;
&lt;p data-end=&quot;3172&quot; data-start=&quot;3123&quot;&gt;&lt;strong data-end=&quot;3131&quot; data-start=&quot;3123&quot;&gt;IDML&lt;/strong&gt;: rebuilding the house from the ground up&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3280&quot; data-start=&quot;3174&quot;&gt;Save and Save As operate inside the existing structure.&lt;br data-end=&quot;3232&quot; data-start=&quot;3229&quot; /&gt;
IDML forces a rebuild via an interchange format.&lt;/p&gt;
&lt;p data-end=&quot;3461&quot; data-start=&quot;3282&quot;&gt;That difference is exactly why IDML can work when the other options don’t.&lt;br data-end=&quot;3359&quot; data-start=&quot;3356&quot; /&gt;
It also explains why IDML comes with risk: rebuilding can change small behaviors, including text flow.&lt;/p&gt;
&lt;hr data-end=&quot;3466&quot; data-start=&quot;3463&quot; /&gt;
&lt;h2 data-end=&quot;3508&quot; data-start=&quot;3468&quot;&gt;4. What IDML Cleanup Does &lt;em data-end=&quot;3502&quot; data-start=&quot;3497&quot;&gt;Not&lt;/em&gt; Solve&lt;/h2&gt;
&lt;p data-end=&quot;3562&quot; data-start=&quot;3510&quot;&gt;IDML cleanup is powerful, but it is not a guarantee.&lt;/p&gt;
&lt;p data-end=&quot;3608&quot; data-start=&quot;3564&quot;&gt;Common limitations and side effects include:&lt;/p&gt;
&lt;ul data-end=&quot;3894&quot; data-start=&quot;3610&quot;&gt;
&lt;li data-end=&quot;3674&quot; data-start=&quot;3610&quot;&gt;
&lt;p data-end=&quot;3674&quot; data-start=&quot;3612&quot;&gt;&lt;strong data-end=&quot;3634&quot; data-start=&quot;3612&quot;&gt;subtle text reflow&lt;/strong&gt; (line breaks and spacing differences)&lt;/p&gt;&lt;/li&gt;
&lt;li data-end=&quot;3833&quot; data-start=&quot;3755&quot;&gt;
&lt;p data-end=&quot;3833&quot; data-start=&quot;3757&quot;&gt;loss of &lt;strong data-end=&quot;3790&quot; data-start=&quot;3765&quot;&gt;plugin-dependent data&lt;/strong&gt; (features stored by third-party plugins)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3894&quot; data-start=&quot;3834&quot;&gt;
&lt;p data-end=&quot;3894&quot; data-start=&quot;3836&quot;&gt;edge cases involving conditions or special document states&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3968&quot; data-start=&quot;3896&quot;&gt;Because of this, &lt;strong data-end=&quot;3942&quot; data-start=&quot;3913&quot;&gt;verification is mandatory&lt;/strong&gt; after an IDML round trip.&lt;/p&gt;
&lt;p data-end=&quot;4191&quot; data-start=&quot;3970&quot;&gt;For multilingual work, verifying every page manually does not scale.&lt;br data-end=&quot;4041&quot; data-start=&quot;4038&quot; /&gt;
This is a good place to rely on &lt;strong data-end=&quot;4094&quot; data-start=&quot;4073&quot;&gt;diff-based review&lt;/strong&gt; (PDF comparison tools, difference extraction, structured QA checks) to reduce the review burden.&lt;/p&gt;
&lt;p data-end=&quot;4217&quot; data-start=&quot;4193&quot;&gt;The key point is simple:&lt;/p&gt;
&lt;blockquote data-end=&quot;4331&quot; data-start=&quot;4219&quot;&gt;
&lt;p data-end=&quot;4331&quot; data-start=&quot;4221&quot;&gt;IDML cleanup can restore stability, but it can also introduce small differences.&lt;br data-end=&quot;4304&quot; data-start=&quot;4301&quot; /&gt;
Always verify the result.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr data-end=&quot;4336&quot; data-start=&quot;4333&quot; /&gt;
&lt;h2 data-end=&quot;4384&quot; data-start=&quot;4338&quot;&gt;5. A Minimal, Reproducible Cleanup Workflow&lt;/h2&gt;
&lt;p data-end=&quot;4529&quot; data-start=&quot;4386&quot;&gt;The biggest risk with “maintenance” operations is inconsistency.&lt;br data-end=&quot;4453&quot; data-start=&quot;4450&quot; /&gt;
Different people perform slightly different steps, or skip a critical check.&lt;/p&gt;
&lt;p data-end=&quot;4591&quot; data-start=&quot;4531&quot;&gt;That is why the workflow should be minimal and reproducible:&lt;/p&gt;
&lt;ol data-end=&quot;4747&quot; data-start=&quot;4593&quot;&gt;
&lt;li data-end=&quot;4630&quot; data-start=&quot;4593&quot;&gt;
&lt;p data-end=&quot;4630&quot; data-start=&quot;4596&quot;&gt;start from a &lt;strong data-end=&quot;4618&quot; data-start=&quot;4609&quot;&gt;saved&lt;/strong&gt; INDD file&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4650&quot; data-start=&quot;4631&quot;&gt;
&lt;p data-end=&quot;4650&quot; data-start=&quot;4634&quot;&gt;export to IDML&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4671&quot; data-start=&quot;4651&quot;&gt;
&lt;p data-end=&quot;4671&quot; data-start=&quot;4654&quot;&gt;reopen the IDML&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4701&quot; data-start=&quot;4672&quot;&gt;
&lt;p data-end=&quot;4701&quot; data-start=&quot;4675&quot;&gt;save a cleaned INDD file&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4747&quot; data-start=&quot;4702&quot;&gt;
&lt;p data-end=&quot;4747&quot; data-start=&quot;4705&quot;&gt;verify (diff/QA) before replacing anything&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;4872&quot; data-start=&quot;4749&quot;&gt;This is not about convenience.&lt;br data-end=&quot;4782&quot; data-start=&quot;4779&quot; /&gt;
It is about &lt;strong data-end=&quot;4811&quot; data-start=&quot;4794&quot;&gt;repeatability&lt;/strong&gt;, which is the core requirement for scaling maintenance work.&lt;/p&gt;
&lt;hr data-end=&quot;4877&quot; data-start=&quot;4874&quot; /&gt;
&lt;h2 data-end=&quot;4905&quot; data-start=&quot;4879&quot;&gt;6. The Minimal Script&lt;/h2&gt;
&lt;h3 data-end=&quot;4942&quot; data-start=&quot;4906&quot;&gt;Reproducibility Over Convenience&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/uIy5dfOp52M&quot; width=&quot;320&quot; youtube-src-id=&quot;uIy5dfOp52M&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;This script is not the main point of the article.&lt;/div&gt;&lt;p data-end=&quot;5073&quot; data-start=&quot;4944&quot;&gt;
Its role is to make the cleanup workflow &lt;strong data-end=&quot;5051&quot; data-start=&quot;5037&quot;&gt;repeatable&lt;/strong&gt; and less error-prone.&lt;/p&gt;
&lt;p data-end=&quot;5116&quot; data-start=&quot;5075&quot;&gt;Design choices (intentional constraints):&lt;/p&gt;
&lt;ul data-end=&quot;5475&quot; data-start=&quot;5118&quot;&gt;
&lt;li data-end=&quot;5174&quot; data-start=&quot;5118&quot;&gt;
&lt;p data-end=&quot;5174&quot; data-start=&quot;5120&quot;&gt;it processes &lt;strong data-end=&quot;5172&quot; data-start=&quot;5133&quot;&gt;all currently open, saved documents&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5232&quot; data-start=&quot;5175&quot;&gt;
&lt;p data-end=&quot;5232&quot; data-start=&quot;5177&quot;&gt;it exports IDML and saves a &lt;strong data-end=&quot;5230&quot; data-start=&quot;5205&quot;&gt;new cleaned INDD copy&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5272&quot; data-start=&quot;5233&quot;&gt;
&lt;p data-end=&quot;5272&quot; data-start=&quot;5235&quot;&gt;it does &lt;strong data-end=&quot;5270&quot; data-start=&quot;5243&quot;&gt;not overwrite originals&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5329&quot; data-start=&quot;5273&quot;&gt;
&lt;p data-end=&quot;5329&quot; data-start=&quot;5275&quot;&gt;it keeps the exported IDML files for troubleshooting&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5420&quot; data-start=&quot;5330&quot;&gt;
&lt;p data-end=&quot;5420&quot; data-start=&quot;5332&quot;&gt;it suppresses blocking dialogs during batch processing and restores settings afterward&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5475&quot; data-start=&quot;5421&quot;&gt;
&lt;p data-end=&quot;5475&quot; data-start=&quot;5423&quot;&gt;it avoids UI complexity (only a single confirmation)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;5614&quot; data-start=&quot;5477&quot;&gt;The script saves outputs in the same folder as the original document.&lt;br data-end=&quot;5549&quot; data-start=&quot;5546&quot; /&gt;
That increases the chance that link behavior remains predictable.&lt;/p&gt;
&lt;blockquote data-end=&quot;5772&quot; data-start=&quot;5616&quot;&gt;
&lt;p data-end=&quot;5772&quot; data-start=&quot;5618&quot;&gt;Note: dialog suppression improves batch stability, but it does not remove the need for verification. It simply prevents the process from stopping halfway.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 data-end=&quot;5823&quot; data-start=&quot;5774&quot;&gt;Script: IDML Cleanup Helper (non-destructive)&lt;/h3&gt;&lt;div&gt;&lt;div style=&quot;background: rgb(31, 41, 55); border-radius: 10px; border: 1px solid rgb(55, 65, 81); color: #f9fafb; margin: 20px 0px; padding: 18px;&quot;&gt;&lt;div style=&quot;color: #f9fafb; font-size: 18px; font-weight: 700; margin-bottom: 8px;&quot;&gt;Want the ready-to-use version?
  &lt;/div&gt;
  &lt;div style=&quot;color: #d1d5db; font-size: 15px; line-height: 1.6; margin-bottom: 14px;&quot;&gt;
    Skip the copy-paste and download the script directly from Gumroad.
  &lt;/div&gt;
  &lt;a href=&quot;https://linguistcoder.gumroad.com/l/IDML-Cleanup-Helper&quot; style=&quot;background: rgb(79, 70, 229); border-radius: 8px; color: white; display: inline-block; font-weight: 600; padding: 10px 16px; text-decoration: none;&quot;&gt;
    Download on Gumroad (Free) →
  &lt;/a&gt;
&lt;/div&gt;

&lt;pre style=&quot;background: rgb(17, 24, 39); border-radius: 8px; color: #e5e7eb; font-family: Consolas, Monaco, monospace; overflow: auto; padding: 16px; white-space: pre;&quot;&gt;&lt;code&gt;#target indesign

(function () {
    var docs = app.documents;

    if (docs.length === 0) {
        alert(&quot;No documents are currently open.&quot;);
        return;
    }

    var proceed = confirm(
        &quot;This will export each saved document to IDML, reopen it, and save a cleaned copy as a new INDD file.\n\n&quot; +
        &quot;Original files will NOT be overwritten.\n&quot; +
        &quot;IDML files will be kept for troubleshooting.\n\n&quot; +
        &quot;Continue?&quot;
    );
    if (!proceed) return;

    var results = [];
    var skipped = [];

    // Suppress blocking dialogs during batch processing
    var oldLevel = app.scriptPreferences.userInteractionLevel;
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

    try {
        // Close() happens inside the loop -&amp;gt; iterate backwards to avoid index shifts
        for (var i = docs.length - 1; i &amp;gt;= 0; i--) {
            try {
                var doc = docs[i];

                if (!doc.saved) {
                    skipped.push(doc.name + &quot; (not saved)&quot;);
                    continue;
                }

                var originalFile = doc.fullName;           // File
                var originalFolder = originalFile.parent;  // Folder
                var baseName = stripInddExtension(originalFile.name);

                // Output paths (same folder to preserve link behavior as much as possible)
                var idmlFile = new File(originalFolder.fsName + &quot;/&quot; + baseName + &quot;__idml_cleanup.idml&quot;);

                // If a cleaned file already exists, add timestamp to avoid collision
                var cleanedInddFile = new File(originalFolder.fsName + &quot;/&quot; + baseName + &quot;__idml_cleaned.indd&quot;);
                if (cleanedInddFile.exists) {
                    cleanedInddFile = new File(
                        originalFolder.fsName + &quot;/&quot; + baseName + &quot;__idml_cleaned_&quot; + timestamp() + &quot;.indd&quot;
                    );
                }

                // 1) Export IDML
                doc.exportFile(ExportFormat.INDESIGN_MARKUP, idmlFile, false);

                // 2) Close original without saving (non-destructive)
                doc.close(SaveOptions.NO);

                // 3) Open IDML (attempt hidden open if supported)
                var reopened;
                try {
                    reopened = app.open(idmlFile, false);
                } catch (_) {
                    reopened = app.open(idmlFile);
                }

                // 4) Save as new INDD (do not overwrite original)
                reopened.save(cleanedInddFile);

                // 5) Close cleaned doc
                reopened.close(SaveOptions.YES);

                results.push(baseName + &quot; -&amp;gt; &quot; + cleanedInddFile.fsName);

            } catch (e) {
                skipped.push(safeDocNameAtIndex(i, docs) + &quot; (error: &quot; + e.message + &quot;)&quot;);
                continue;
            }
        }
    } finally {
        // Always restore interaction level
        app.scriptPreferences.userInteractionLevel = oldLevel;
    }

    // Report
    var msg = [];
    msg.push(&quot;Completed.\n&quot;);

    if (results.length &amp;gt; 0) {
        msg.push(&quot;[Cleaned copies created]&quot;);
        for (var r = 0; r &amp;lt; results.length; r++) msg.push(&quot;- &quot; + results[r]);
        msg.push(&quot;&quot;);
    }

    if (skipped.length &amp;gt; 0) {
        msg.push(&quot;[Skipped]&quot;);
        for (var s = 0; s &amp;lt; skipped.length; s++) msg.push(&quot;- &quot; + skipped[s]);
        msg.push(&quot;&quot;);
    }

    msg.push(&quot;Note: Always verify (diff/QA) before replacing originals.&quot;);
    alert(msg.join(&quot;\n&quot;));

    // ---- helpers ----

    function stripInddExtension(name) {
        return name.replace(/\.indd$/i, &quot;&quot;);
    }

    function timestamp() {
        // YYYYMMDD_HHMMSS
        var d = new Date();
        return (
            d.getFullYear() +
            pad2(d.getMonth() + 1) +
            pad2(d.getDate()) + &quot;_&quot; +
            pad2(d.getHours()) +
            pad2(d.getMinutes()) +
            pad2(d.getSeconds())
        );
    }

    function pad2(n) {
        return (n &amp;lt; 10) ? (&quot;0&quot; + n) : (&quot;&quot; + n);
    }

    function safeDocNameAtIndex(idx, collection) {
        try { return collection[idx].name; } catch (_) { return &quot;(unknown document)&quot;; }
    }
})();&lt;/code&gt;
&lt;/pre&gt;
&lt;hr data-end=&quot;10036&quot; data-start=&quot;10033&quot; /&gt;
&lt;h2 data-end=&quot;10084&quot; data-start=&quot;10038&quot;&gt;7. How This Fits into a Scalable Workflow&lt;/h2&gt;
&lt;h3 data-end=&quot;10108&quot; data-start=&quot;10085&quot;&gt;Why Recovery Scales&lt;/h3&gt;
&lt;p data-end=&quot;10193&quot; data-start=&quot;10110&quot;&gt;Recovery sounds “non-scalable” at first—because it happens when something is wrong.&lt;/p&gt;
&lt;p data-end=&quot;10269&quot; data-start=&quot;10195&quot;&gt;But in multilingual publishing, recovery can be the highest-leverage step.&lt;/p&gt;
&lt;p data-end=&quot;10329&quot; data-start=&quot;10271&quot;&gt;If you produce 20 languages from a single master workflow:&lt;/p&gt;
&lt;ul data-end=&quot;10465&quot; data-start=&quot;10331&quot;&gt;
&lt;li data-end=&quot;10391&quot; data-start=&quot;10331&quot;&gt;
&lt;p data-end=&quot;10391&quot; data-start=&quot;10333&quot;&gt;one unstable master can generate &lt;strong data-end=&quot;10389&quot; data-start=&quot;10366&quot;&gt;20 unstable outputs&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;10465&quot; data-start=&quot;10392&quot;&gt;
&lt;p data-end=&quot;10465&quot; data-start=&quot;10394&quot;&gt;one recovery operation applied upstream can prevent that multiplication&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;10530&quot; data-start=&quot;10467&quot;&gt;That is the reason IDML cleanup belongs in a scalable workflow:&lt;/p&gt;
&lt;ul data-end=&quot;10674&quot; data-start=&quot;10532&quot;&gt;
&lt;li data-end=&quot;10557&quot; data-start=&quot;10532&quot;&gt;
&lt;p data-end=&quot;10557&quot; data-start=&quot;10534&quot;&gt;not as a routine step&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;10607&quot; data-start=&quot;10558&quot;&gt;
&lt;p data-end=&quot;10607&quot; data-start=&quot;10560&quot;&gt;but as a controlled, upstream recovery action&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;10674&quot; data-start=&quot;10608&quot;&gt;
&lt;p data-end=&quot;10674&quot; data-start=&quot;10610&quot;&gt;applied at the point where it prevents downstream multiplication&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;10834&quot; data-start=&quot;10676&quot;&gt;This is also why reproducibility matters.&lt;br data-end=&quot;10720&quot; data-start=&quot;10717&quot; /&gt;
When recovery steps are defined clearly, the work becomes transferable and less dependent on individual intuition.&lt;/p&gt;
&lt;hr data-end=&quot;10839&quot; data-start=&quot;10836&quot; /&gt;
&lt;h2 data-end=&quot;10881&quot; data-start=&quot;10841&quot;&gt;8. Closing: Scaling Includes Recovery&lt;/h2&gt;
&lt;p data-end=&quot;10921&quot; data-start=&quot;10883&quot;&gt;Scaling is not about “never breaking.”&lt;/p&gt;
&lt;p data-end=&quot;10980&quot; data-start=&quot;10923&quot;&gt;It is about having a reliable way back when things break.&lt;/p&gt;
&lt;p data-end=&quot;11020&quot; data-start=&quot;10982&quot;&gt;The first phase of scaling is usually:&lt;/p&gt;
&lt;ul data-end=&quot;11104&quot; data-start=&quot;11022&quot;&gt;
&lt;li data-end=&quot;11055&quot; data-start=&quot;11022&quot;&gt;
&lt;p data-end=&quot;11055&quot; data-start=&quot;11024&quot;&gt;creating repeatable processes&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;11083&quot; data-start=&quot;11056&quot;&gt;
&lt;p data-end=&quot;11083&quot; data-start=&quot;11058&quot;&gt;automating stable rules&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;11104&quot; data-start=&quot;11084&quot;&gt;
&lt;p data-end=&quot;11104&quot; data-start=&quot;11086&quot;&gt;reducing decisions&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;11138&quot; data-start=&quot;11106&quot;&gt;The second phase is more subtle:&lt;/p&gt;
&lt;ul data-end=&quot;11266&quot; data-start=&quot;11140&quot;&gt;
&lt;li data-end=&quot;11170&quot; data-start=&quot;11140&quot;&gt;
&lt;p data-end=&quot;11170&quot; data-start=&quot;11142&quot;&gt;protecting those processes&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;11231&quot; data-start=&quot;11171&quot;&gt;
&lt;p data-end=&quot;11231&quot; data-start=&quot;11173&quot;&gt;restoring stability when something becomes unpredictable&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;11266&quot; data-start=&quot;11232&quot;&gt;
&lt;p data-end=&quot;11266&quot; data-start=&quot;11234&quot;&gt;maintaining the system you built&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;11314&quot; data-start=&quot;11268&quot;&gt;That is what maintenance and recovery are for.&lt;/p&gt;
&lt;p data-end=&quot;11363&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;11316&quot;&gt;In multilingual DTP, scaling includes recovery.&lt;/p&gt;&lt;/div&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/07/when-indesign-fails-to-export-start-by.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;When InDesign Fails to Export: Start by Finding the Broken Page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP by Automating Trados-Ready IDML Export from InDesign Books&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/09/why-idml-formatting-can-produce.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Why IDML Formatting Can Produce Translation Tags, and What to Check in InDesign&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>

  <entry>
    <title>Scaling Multilingual DTP by Creating an Escape Hatch for Layout Adjustment (Shrinking All Placed Images at Once)</title>
    <id>https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-creating.html</id>
    <link href="https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-creating.html"/>
    <published>2026-01-26T00:45:00.000Z</published>
    <updated>2026-03-25T20:24:01.576Z</updated>
    <summary>0. Context: Why Layout Adjustment Stops Scaling After Translation In multilingual publishing, text expansion after translation is expected. The real problem is not that layouts need adjustment, but that the adjustment work does not scale . Line spacing and paragraph…</summary>
    <content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 data-end=&quot;281&quot; data-start=&quot;213&quot;&gt;0. Context: Why Layout Adjustment Stops Scaling After Translation&lt;/h2&gt;
&lt;p data-end=&quot;461&quot; data-start=&quot;283&quot;&gt;In multilingual publishing, text expansion after translation is expected.&lt;br data-end=&quot;359&quot; data-start=&quot;356&quot; /&gt;
The real problem is not that layouts need adjustment, but that &lt;strong data-end=&quot;460&quot; data-start=&quot;422&quot;&gt;the adjustment work does not scale&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;620&quot; data-start=&quot;463&quot;&gt;Line spacing and paragraph tweaks can absorb small increases in text volume.&lt;br data-end=&quot;542&quot; data-start=&quot;539&quot; /&gt;
However, there is always a point where those adjustments are no longer enough.&lt;/p&gt;
&lt;p data-end=&quot;735&quot; data-start=&quot;622&quot;&gt;What remains at the end is usually layout work that must be done by hand — and that is where scaling breaks down.&lt;/p&gt;
&lt;hr data-end=&quot;740&quot; data-start=&quot;737&quot; /&gt;
&lt;h2 data-end=&quot;795&quot; data-start=&quot;742&quot;&gt;1. Why Image Adjustment Is the Least Scalable Part&lt;/h2&gt;
&lt;p data-end=&quot;842&quot; data-start=&quot;797&quot;&gt;Image adjustment often becomes the last step.&lt;/p&gt;
&lt;ul data-end=&quot;966&quot; data-start=&quot;844&quot;&gt;
&lt;li data-end=&quot;877&quot; data-start=&quot;844&quot;&gt;
&lt;p data-end=&quot;877&quot; data-start=&quot;846&quot;&gt;Images are visually prominent&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;929&quot; data-start=&quot;878&quot;&gt;
&lt;p data-end=&quot;929&quot; data-start=&quot;880&quot;&gt;Each image seems to require individual judgment&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;966&quot; data-start=&quot;930&quot;&gt;
&lt;p data-end=&quot;966&quot; data-start=&quot;932&quot;&gt;Decisions feel content-dependent&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1037&quot; data-start=&quot;968&quot;&gt;This makes image-related layout work expensive in terms of attention.&lt;/p&gt;
&lt;p data-end=&quot;1208&quot; data-start=&quot;1039&quot;&gt;The more carefully each image is adjusted, the less scalable the process becomes.&lt;br data-end=&quot;1123&quot; data-start=&quot;1120&quot; /&gt;
Perfect layouts do not compound well when document count and language count increase.&lt;/p&gt;
&lt;hr data-end=&quot;1213&quot; data-start=&quot;1210&quot; /&gt;
&lt;h2 data-end=&quot;1258&quot; data-start=&quot;1215&quot;&gt;2. Escaping Instead of Fixing Everything&lt;/h2&gt;
&lt;p data-end=&quot;1350&quot; data-start=&quot;1260&quot;&gt;Instead of trying to fix everything perfectly, this article proposes a different approach:&lt;/p&gt;
&lt;p data-end=&quot;1391&quot; data-start=&quot;1352&quot;&gt;&lt;strong data-end=&quot;1391&quot; data-start=&quot;1352&quot;&gt;Create an intentional escape hatch.&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;1528&quot; data-start=&quot;1393&quot;&gt;An escape hatch is not about achieving a final layout.&lt;br data-end=&quot;1450&quot; data-start=&quot;1447&quot; /&gt;
It is about applying a simple, uniform rule to reduce overall layout pressure.&lt;/p&gt;
&lt;p data-end=&quot;1582&quot; data-start=&quot;1530&quot;&gt;The goal is not perfection, but &lt;strong data-end=&quot;1581&quot; data-start=&quot;1562&quot;&gt;room to breathe&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;1587&quot; data-start=&quot;1584&quot; /&gt;
&lt;h2 data-end=&quot;1648&quot; data-start=&quot;1589&quot;&gt;3. What This Script Does (And Intentionally Does Not Do)&lt;/h2&gt;
&lt;h3 data-end=&quot;1670&quot; data-start=&quot;1650&quot;&gt;3.1 What It Does&lt;/h3&gt;
&lt;p data-end=&quot;1721&quot; data-start=&quot;1672&quot;&gt;The script introduced here applies a single rule:&lt;/p&gt;
&lt;ul data-end=&quot;1914&quot; data-start=&quot;1723&quot;&gt;
&lt;li data-end=&quot;1769&quot; data-start=&quot;1723&quot;&gt;
&lt;p data-end=&quot;1769&quot; data-start=&quot;1725&quot;&gt;All currently open documents are processed&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1804&quot; data-start=&quot;1770&quot;&gt;
&lt;p data-end=&quot;1804&quot; data-start=&quot;1772&quot;&gt;All placed images are affected&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1860&quot; data-start=&quot;1805&quot;&gt;
&lt;p data-end=&quot;1860&quot; data-start=&quot;1807&quot;&gt;Image frames and their contents are scaled together&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1914&quot; data-start=&quot;1861&quot;&gt;
&lt;p data-end=&quot;1914&quot; data-start=&quot;1863&quot;&gt;A fixed relative reduction of &lt;strong data-end=&quot;1901&quot; data-start=&quot;1893&quot;&gt;−10%&lt;/strong&gt; is applied&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1983&quot; data-start=&quot;1916&quot;&gt;No decisions are made per image.&lt;br data-end=&quot;1951&quot; data-start=&quot;1948&quot; /&gt;
Everything is treated uniformly.&lt;/p&gt;
&lt;hr data-end=&quot;1988&quot; data-start=&quot;1985&quot; /&gt;
&lt;h3 data-end=&quot;2017&quot; data-start=&quot;1990&quot;&gt;3.2 What It Does Not Do&lt;/h3&gt;
&lt;p data-end=&quot;2052&quot; data-start=&quot;2019&quot;&gt;This script intentionally avoids:&lt;/p&gt;
&lt;ul data-end=&quot;2190&quot; data-start=&quot;2054&quot;&gt;
&lt;li data-end=&quot;2089&quot; data-start=&quot;2054&quot;&gt;
&lt;p data-end=&quot;2089&quot; data-start=&quot;2056&quot;&gt;Processing only selected images&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2130&quot; data-start=&quot;2090&quot;&gt;
&lt;p data-end=&quot;2130&quot; data-start=&quot;2092&quot;&gt;Letting the user choose a percentage&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2171&quot; data-start=&quot;2131&quot;&gt;
&lt;p data-end=&quot;2171&quot; data-start=&quot;2133&quot;&gt;Handling exceptions or special cases&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2190&quot; data-start=&quot;2172&quot;&gt;
&lt;p data-end=&quot;2190&quot; data-start=&quot;2174&quot;&gt;Providing a UI&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2305&quot; data-start=&quot;2192&quot;&gt;These features may be convenient, but they introduce additional decisions.&lt;br data-end=&quot;2269&quot; data-start=&quot;2266&quot; /&gt;
This example avoids them on purpose.&lt;/p&gt;
&lt;hr data-end=&quot;2310&quot; data-start=&quot;2307&quot; /&gt;
&lt;h2 data-end=&quot;2370&quot; data-start=&quot;2312&quot;&gt;4. Why the Frame Must Be Scaled Together with the Image&lt;/h2&gt;
&lt;p data-end=&quot;2426&quot; data-start=&quot;2372&quot;&gt;Shrinking only the image content is rarely sufficient.&lt;/p&gt;
&lt;p data-end=&quot;2564&quot; data-start=&quot;2428&quot;&gt;If the frame size remains unchanged, shrinking the image simply increases surrounding whitespace.&lt;br data-end=&quot;2528&quot; data-start=&quot;2525&quot; /&gt;
The layout pressure does not change.&lt;/p&gt;
&lt;p data-end=&quot;2654&quot; data-start=&quot;2566&quot;&gt;What affects layout flow is &lt;strong data-end=&quot;2628&quot; data-start=&quot;2594&quot;&gt;the area occupied by the frame&lt;/strong&gt;, not the image inside it.&lt;/p&gt;
&lt;p data-end=&quot;2755&quot; data-start=&quot;2656&quot;&gt;That is why the script treats the frame and its contents as a single unit and scales them together.&lt;/p&gt;
&lt;hr data-end=&quot;2760&quot; data-start=&quot;2757&quot; /&gt;
&lt;h2 data-end=&quot;2786&quot; data-start=&quot;2762&quot;&gt;5. The Minimal Script&lt;/h2&gt;
&lt;p data-end=&quot;2826&quot; data-start=&quot;2788&quot;&gt;This approach may feel risky at first.&lt;/p&gt;
&lt;p data-end=&quot;2939&quot; data-start=&quot;2828&quot;&gt;Shrinking all placed images at once will also affect anchored objects, logos, and icons.&lt;br data-end=&quot;2919&quot; data-start=&quot;2916&quot; /&gt;
That is intentional.&lt;/p&gt;
&lt;p data-end=&quot;3072&quot; data-start=&quot;2941&quot;&gt;This script is not meant to produce a final, polished layout.&lt;br data-end=&quot;3005&quot; data-start=&quot;3002&quot; /&gt;
It is a rough operation designed to reduce overall layout pressure.&lt;/p&gt;
&lt;p data-end=&quot;3200&quot; data-start=&quot;3074&quot;&gt;In practice, fixing a few broken spots afterward is often much faster&lt;br data-end=&quot;3146&quot; data-start=&quot;3143&quot; /&gt;
than adjusting every image by hand from the beginning.&lt;/p&gt;
&lt;p data-end=&quot;3325&quot; data-start=&quot;3202&quot;&gt;In real production workflows, certain images might be excluded —&lt;br data-end=&quot;3269&quot; data-start=&quot;3266&quot; /&gt;
for example, logos or icons identified by name or layer.&lt;/p&gt;
&lt;p data-end=&quot;3440&quot; data-start=&quot;3327&quot;&gt;That kind of filtering can make a script more convenient.&lt;br data-end=&quot;3387&quot; data-start=&quot;3384&quot; /&gt;
However, it also introduces more rules and decisions.&lt;/p&gt;
&lt;p data-end=&quot;3559&quot; data-start=&quot;3442&quot;&gt;This example intentionally avoids that.&lt;br data-end=&quot;3484&quot; data-start=&quot;3481&quot; /&gt;
Its purpose is to demonstrate a scalable fallback, not a complete solution.&lt;/p&gt;
&lt;pre style=&quot;background: rgb(17, 24, 39); border-radius: 8px; color: #e5e7eb; font-family: Consolas, Monaco, monospace; overflow: auto; padding: 16px; white-space: pre;&quot;&gt;&lt;code&gt;#target indesign

(function () {
    var docs = app.documents;

    if (docs.length === 0) {
        alert(&quot;No documents are currently open.&quot;);
        return;
    }

    for (var d = 0; d &amp;lt; docs.length; d++) {
        try {
            scaleAllPlacedGraphicsInDoc(docs[d]);
        } catch (e) {
            continue;
        }
    }

    alert(&quot;Completed&quot;);

    function scaleAllPlacedGraphicsInDoc(doc) {
        var pages = doc.pages;

        for (var i = 0; i &amp;lt; pages.length; i++) {
            var graphics = pages[i].allGraphics;

            for (var j = 0; j &amp;lt; graphics.length; j++) {
                try {
                    var frame = graphics[j].parent;

                    // Reset relative scaling to 100%
                    frame.redefineScaling();

                    // Apply relative -10% scaling
                    frame.horizontalScale = 90;
                    frame.verticalScale   = 90;

                    // Fix the result as the new 100%
                    frame.redefineScaling();

                } catch (e2) {
                    continue;
                }
            }
        }
    }
})();&lt;/code&gt;
&lt;/pre&gt;
&lt;p data-end=&quot;4741&quot; data-start=&quot;4707&quot;&gt;The choice of 10% is not critical.&lt;/p&gt;
&lt;p data-end=&quot;4860&quot; data-start=&quot;4743&quot;&gt;There is no special meaning in that number.&lt;br data-end=&quot;4789&quot; data-start=&quot;4786&quot; /&gt;
What matters is deciding on a single rule and applying it consistently.&lt;/p&gt;
&lt;p data-end=&quot;4935&quot; data-start=&quot;4862&quot;&gt;A UI would invite further decisions.&lt;br data-end=&quot;4901&quot; data-start=&quot;4898&quot; /&gt;
This script avoids that by design.&lt;/p&gt;
&lt;hr data-end=&quot;4940&quot; data-start=&quot;4937&quot; /&gt;
&lt;h2 data-end=&quot;5004&quot; data-start=&quot;4942&quot;&gt;6. Another Escape Hatch: Preparing Smaller Paragraph Styles&lt;/h2&gt;
&lt;p data-end=&quot;5073&quot; data-start=&quot;5006&quot;&gt;Images are not the only place where escape hatches can be prepared.&lt;/p&gt;
&lt;p data-end=&quot;5251&quot; data-start=&quot;5075&quot;&gt;Text-related pressure can often be reduced earlier by preparing paragraph styles with smaller font sizes.&lt;br data-end=&quot;5183&quot; data-start=&quot;5180&quot; /&gt;
Loading these styles in advance creates another controlled fallback.&lt;/p&gt;
&lt;p data-end=&quot;5298&quot; data-start=&quot;5253&quot;&gt;This approach is discussed in more detail in:&lt;/p&gt;
&lt;p data-end=&quot;5375&quot; data-start=&quot;5300&quot;&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_15.html&quot;&gt;Scaling Multilingual DTP by Automating Style Reloads Before Translation&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p data-end=&quot;5480&quot; data-start=&quot;5377&quot;&gt;The underlying idea is the same:&lt;br data-end=&quot;5412&quot; data-start=&quot;5409&quot; /&gt;
prepare scalable options before manual adjustment becomes necessary.&lt;/p&gt;
&lt;hr data-end=&quot;5485&quot; data-start=&quot;5482&quot; /&gt;
&lt;h2 data-end=&quot;5529&quot; data-start=&quot;5487&quot;&gt;7. Combining Escape Hatches in Practice&lt;/h2&gt;
&lt;p data-end=&quot;5584&quot; data-start=&quot;5531&quot;&gt;In practice, these escape hatches work best together.&lt;/p&gt;
&lt;ul data-end=&quot;5726&quot; data-start=&quot;5586&quot;&gt;
&lt;li data-end=&quot;5659&quot; data-start=&quot;5586&quot;&gt;
&lt;p data-end=&quot;5659&quot; data-start=&quot;5588&quot;&gt;Text volume can be absorbed by switching to prepared paragraph styles&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5726&quot; data-start=&quot;5660&quot;&gt;
&lt;p data-end=&quot;5726&quot; data-start=&quot;5662&quot;&gt;Image-heavy pages can gain space through uniform image scaling&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;5817&quot; data-start=&quot;5728&quot;&gt;Only after these global adjustments does it make sense to perform individual fine tuning.&lt;/p&gt;
&lt;p data-end=&quot;5888&quot; data-start=&quot;5819&quot;&gt;This ordering significantly reduces the number of decisions required.&lt;/p&gt;
&lt;hr data-end=&quot;5893&quot; data-start=&quot;5890&quot; /&gt;
&lt;h2 data-end=&quot;5945&quot; data-start=&quot;5895&quot;&gt;8. Closing: Scaling Is About Reducing Decisions&lt;/h2&gt;
&lt;p data-end=&quot;6018&quot; data-start=&quot;5947&quot;&gt;The main obstacle to scaling is not complexity, but &lt;strong data-end=&quot;6017&quot; data-start=&quot;5999&quot;&gt;decision count&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;6147&quot; data-start=&quot;6020&quot;&gt;Scripts like this are not about convenience.&lt;br data-end=&quot;6067&quot; data-start=&quot;6064&quot; /&gt;
They are about fixing rules in advance so that fewer decisions are needed later.&lt;/p&gt;
&lt;p data-end=&quot;6236&quot; data-start=&quot;6149&quot;&gt;Instead of perfecting each page, create room first —&lt;br data-end=&quot;6204&quot; data-start=&quot;6201&quot; /&gt;
and adjust only where necessary.&lt;/p&gt;
&lt;p data-end=&quot;6294&quot; data-start=&quot;6238&quot;&gt;That is what allows multilingual DTP workflows to scale.&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>How to Run JavaScript in Adobe InDesign (Without Learning JavaScript First)</title>
    <id>https://www.linguist-coder.com/2026/01/how-to-run-javascript-in-adobe-indesign.html</id>
    <link href="https://www.linguist-coder.com/2026/01/how-to-run-javascript-in-adobe-indesign.html"/>
    <published>2026-01-24T21:28:00.000Z</published>
    <updated>2026-09-18T23:09:55.248Z</updated>
    <summary>0. Who This Article Is For This article is for InDesign users who don’t want to “learn JavaScript” — they just want to make InDesign do the work. You may have seen scripts, automation examples, or .jsx files before, but…</summary>
    <content type="html">&lt;h2 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;0. Who This Article Is For&lt;/h2&gt;
&lt;p data-end=&quot;355&quot; data-start=&quot;237&quot;&gt;This article is for InDesign users who don’t want to “learn JavaScript” — they just want to make InDesign do the work.&lt;/p&gt;
&lt;p data-end=&quot;547&quot; data-start=&quot;357&quot;&gt;You may have seen scripts, automation examples, or &lt;code data-end=&quot;414&quot; data-start=&quot;408&quot;&gt;.jsx&lt;/code&gt; files before, but stopped there because many explanations immediately turn into a JavaScript course.&lt;br data-end=&quot;518&quot; data-start=&quot;515&quot; /&gt;
That is not the purpose here.&lt;/p&gt;
&lt;p data-end=&quot;719&quot; data-start=&quot;549&quot;&gt;This article is &lt;strong data-end=&quot;572&quot; data-start=&quot;565&quot;&gt;not&lt;/strong&gt; for people who want to become JavaScript developers.&lt;br data-end=&quot;628&quot; data-start=&quot;625&quot; /&gt;
It is for people who already work in InDesign and want to automate small, repetitive tasks.&lt;/p&gt;
&lt;hr data-end=&quot;724&quot; data-start=&quot;721&quot; /&gt;
&lt;h2 data-end=&quot;772&quot; data-start=&quot;726&quot;&gt;1. What This Article Does (And Does Not Do)&lt;/h2&gt;
&lt;p data-end=&quot;814&quot; data-start=&quot;774&quot;&gt;The goal of this article is very simple:&lt;/p&gt;
&lt;ul data-end=&quot;900&quot; data-start=&quot;816&quot;&gt;
&lt;li data-end=&quot;842&quot; data-start=&quot;816&quot;&gt;
&lt;p data-end=&quot;842&quot; data-start=&quot;818&quot;&gt;Write a minimal script&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;865&quot; data-start=&quot;843&quot;&gt;
&lt;p data-end=&quot;865&quot; data-start=&quot;845&quot;&gt;Run it in InDesign&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;900&quot; data-start=&quot;866&quot;&gt;
&lt;p data-end=&quot;900&quot; data-start=&quot;868&quot;&gt;Confirm that it actually works&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;912&quot; data-start=&quot;902&quot;&gt;That’s it.&lt;/p&gt;
&lt;p data-end=&quot;1029&quot; data-start=&quot;914&quot;&gt;This article does &lt;strong data-end=&quot;939&quot; data-start=&quot;932&quot;&gt;not&lt;/strong&gt; cover JavaScript syntax in detail.&lt;br data-end=&quot;977&quot; data-start=&quot;974&quot; /&gt;
General programming concepts are also not explained.&lt;/p&gt;
&lt;p data-end=&quot;1164&quot; data-start=&quot;1031&quot;&gt;Those topics are already well covered elsewhere.&lt;br data-end=&quot;1082&quot; data-start=&quot;1079&quot; /&gt;
Here, the focus is limited to what is necessary to make InDesign execute a script.&lt;/p&gt;
&lt;p data-end=&quot;1241&quot; data-start=&quot;1166&quot;&gt;If something runs and produces a visible result, that is already a success.&lt;/p&gt;
&lt;hr data-end=&quot;1246&quot; data-start=&quot;1243&quot; /&gt;
&lt;h2 data-end=&quot;1288&quot; data-start=&quot;1248&quot;&gt;2. Write the Smallest Possible Script&lt;/h2&gt;
&lt;h3 data-end=&quot;1329&quot; data-start=&quot;1290&quot;&gt;2.1 Open a Text Editor (or VS Code)&lt;/h3&gt;
&lt;p data-end=&quot;1365&quot; data-start=&quot;1331&quot;&gt;Any plain text editor can be used.&lt;/p&gt;
&lt;ul data-end=&quot;1459&quot; data-start=&quot;1367&quot;&gt;
&lt;li data-end=&quot;1386&quot; data-start=&quot;1367&quot;&gt;
&lt;p data-end=&quot;1386&quot; data-start=&quot;1369&quot;&gt;Notepad (Windows)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1422&quot; data-start=&quot;1387&quot;&gt;
&lt;p data-end=&quot;1422&quot; data-start=&quot;1389&quot;&gt;TextEdit (macOS, plain text mode)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1459&quot; data-start=&quot;1423&quot;&gt;
&lt;p data-end=&quot;1459&quot; data-start=&quot;1425&quot;&gt;VS Code, if it is already familiar&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1558&quot; data-start=&quot;1461&quot;&gt;The specific tool does not matter.&lt;br data-end=&quot;1498&quot; data-start=&quot;1495&quot; /&gt;
The only requirement is that a plain text file can be saved.&lt;/p&gt;
&lt;hr data-end=&quot;1563&quot; data-start=&quot;1560&quot; /&gt;
&lt;h3 data-end=&quot;1591&quot; data-start=&quot;1565&quot;&gt;2.2 Type This One Line&lt;/h3&gt;
&lt;p data-end=&quot;1634&quot; data-start=&quot;1593&quot;&gt;Type the following line exactly as it is:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;1668&quot; data-start=&quot;1636&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-js&quot;&gt;&lt;span class=&quot;hljs-title function_&quot;&gt;alert&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Hello, world&quot;&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1796&quot; data-start=&quot;1670&quot;&gt;At this stage, understanding the code is not required.&lt;br data-end=&quot;1727&quot; data-start=&quot;1724&quot; /&gt;
This line is only used to confirm that InDesign can execute a script.&lt;/p&gt;
&lt;hr data-end=&quot;1801&quot; data-start=&quot;1798&quot; /&gt;
&lt;h2 data-end=&quot;1834&quot; data-start=&quot;1803&quot;&gt;3. Save the File as a &lt;code data-end=&quot;1834&quot; data-start=&quot;1828&quot;&gt;.jsx&lt;/code&gt;&lt;/h2&gt;
&lt;p data-end=&quot;1889&quot; data-start=&quot;1836&quot;&gt;Save the file with the &lt;code data-end=&quot;1865&quot; data-start=&quot;1859&quot;&gt;.jsx&lt;/code&gt; extension, for example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;1908&quot; data-start=&quot;1891&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;hello.jsx
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2001&quot; data-start=&quot;1910&quot;&gt;InDesign recognizes scripts by this extension.&lt;br data-end=&quot;1959&quot; data-start=&quot;1956&quot; /&gt;
For now, no further explanation is needed.&lt;/p&gt;
&lt;hr data-end=&quot;2006&quot; data-start=&quot;2003&quot; /&gt;
&lt;h2 data-end=&quot;2059&quot; data-start=&quot;2008&quot;&gt;4. Put the Script into InDesign’s Scripts Folder&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/NP57c8p8hE0&quot; width=&quot;320&quot; youtube-src-id=&quot;NP57c8p8hE0&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;p data-end=&quot;2116&quot; data-start=&quot;2061&quot;&gt;InDesign only runs scripts placed in a specific folder.&lt;/p&gt;
&lt;p data-end=&quot;2150&quot; data-start=&quot;2118&quot;&gt;The easiest way to locate it is:&lt;/p&gt;&lt;ol data-end=&quot;330&quot; data-start=&quot;209&quot;&gt;&lt;li data-end=&quot;227&quot; data-start=&quot;209&quot;&gt;&lt;p data-end=&quot;227&quot; data-start=&quot;212&quot;&gt;Open InDesign&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;291&quot; data-start=&quot;228&quot;&gt;
&lt;p data-end=&quot;291&quot; data-start=&quot;231&quot;&gt;From the top menu, choose &lt;strong data-end=&quot;289&quot; data-start=&quot;257&quot;&gt;Window → Utilities → Scripts&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;330&quot; data-start=&quot;292&quot;&gt;
&lt;p data-end=&quot;330&quot; data-start=&quot;295&quot;&gt;The &lt;strong data-end=&quot;310&quot; data-start=&quot;299&quot;&gt;Scripts&lt;/strong&gt; panel will appear&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;p data-end=&quot;384&quot; data-start=&quot;332&quot;&gt;In the Scripts panel, three folders are usually shown:&lt;/p&gt;&lt;ul data-end=&quot;416&quot; data-start=&quot;386&quot;&gt;
&lt;li data-end=&quot;405&quot; data-start=&quot;386&quot;&gt;
&lt;p data-end=&quot;405&quot; data-start=&quot;388&quot;&gt;&lt;strong data-end=&quot;403&quot; data-start=&quot;388&quot;&gt;Application&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li data-end=&quot;405&quot; data-start=&quot;386&quot;&gt;&lt;p data-end=&quot;405&quot; data-start=&quot;388&quot;&gt;&lt;b&gt;Community&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li data-end=&quot;416&quot; data-start=&quot;406&quot;&gt;
&lt;p data-end=&quot;416&quot; data-start=&quot;408&quot;&gt;&lt;strong data-end=&quot;416&quot; data-start=&quot;408&quot;&gt;User&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;ol data-end=&quot;642&quot; data-start=&quot;418&quot; start=&quot;4&quot;&gt;
&lt;li data-end=&quot;438&quot; data-start=&quot;418&quot;&gt;
&lt;p data-end=&quot;438&quot; data-start=&quot;421&quot;&gt;Select &lt;strong data-end=&quot;436&quot; data-start=&quot;428&quot;&gt;User&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;503&quot; data-start=&quot;439&quot;&gt;
&lt;p data-end=&quot;503&quot; data-start=&quot;442&quot;&gt;From the panel menu, choose &lt;strong data-end=&quot;501&quot; data-start=&quot;470&quot;&gt;Reveal in Explorer / Finder&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;strong data-end=&quot;501&quot; data-start=&quot;470&quot;&gt;&lt;a href=&quot;/images/2026/01/how-to-run-javascript-in-adobe-indesign/01.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;InDesign Scripts panel with the context menu on the User folder showing Reveal in Explorer&quot; data-original-height=&quot;358&quot; data-original-width=&quot;471&quot; height=&quot;240&quot; src=&quot;/images/2026/01/how-to-run-javascript-in-adobe-indesign/01.png&quot; width=&quot;316&quot; /&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li data-end=&quot;545&quot; data-start=&quot;504&quot;&gt;
&lt;p data-end=&quot;545&quot; data-start=&quot;507&quot;&gt;A folder named &lt;strong data-end=&quot;533&quot; data-start=&quot;522&quot;&gt;Scripts&lt;/strong&gt; will open&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;594&quot; data-start=&quot;546&quot;&gt;
&lt;p data-end=&quot;594&quot; data-start=&quot;549&quot;&gt;Open the &lt;strong data-end=&quot;575&quot; data-start=&quot;558&quot;&gt;Scripts Panel&lt;/strong&gt; folder inside it&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;642&quot; data-start=&quot;595&quot;&gt;
&lt;p data-end=&quot;642&quot; data-start=&quot;598&quot;&gt;Save your &lt;code data-end=&quot;614&quot; data-start=&quot;608&quot;&gt;.jsx&lt;/code&gt; file into &lt;strong data-end=&quot;642&quot; data-start=&quot;625&quot;&gt;Scripts Panel&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;p data-end=&quot;2150&quot; data-start=&quot;2118&quot;&gt;



&lt;/p&gt;&lt;p data-end=&quot;705&quot; data-start=&quot;644&quot;&gt;This is the folder where the &lt;code data-end=&quot;2320&quot; data-start=&quot;2314&quot;&gt;.jsx&lt;/code&gt; file should be saved.&lt;/p&gt;
&lt;p data-end=&quot;2409&quot; data-start=&quot;2344&quot;&gt;Once placed there, the script should appear in the Scripts panel.&lt;/p&gt;
&lt;hr data-end=&quot;2414&quot; data-start=&quot;2411&quot; /&gt;
&lt;h2 data-end=&quot;2436&quot; data-start=&quot;2416&quot;&gt;5. Run the Script&lt;/h2&gt;
&lt;p data-end=&quot;2483&quot; data-start=&quot;2438&quot;&gt;Double-click the script in the Scripts panel.&lt;/p&gt;
&lt;p data-end=&quot;2568&quot; data-start=&quot;2485&quot;&gt;If a dialog displaying &lt;strong data-end=&quot;2526&quot; data-start=&quot;2508&quot;&gt;“Hello, world”&lt;/strong&gt; appears, the script has run successfully.&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/01/how-to-run-javascript-in-adobe-indesign/02.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Script Alert dialog in InDesign showing Hello, world&quot; data-original-height=&quot;271&quot; data-original-width=&quot;261&quot; height=&quot;240&quot; src=&quot;/images/2026/01/how-to-run-javascript-in-adobe-indesign/02.png&quot; width=&quot;231&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;p data-end=&quot;2624&quot; data-start=&quot;2570&quot;&gt;At this point, one important thing has been confirmed:&lt;/p&gt;
&lt;blockquote data-end=&quot;2666&quot; data-start=&quot;2626&quot;&gt;
&lt;p data-end=&quot;2666&quot; data-start=&quot;2628&quot;&gt;JavaScript is running inside InDesign.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p data-end=&quot;2710&quot; data-start=&quot;2668&quot;&gt;This step exists only to verify that fact.&lt;/p&gt;
&lt;hr data-end=&quot;2715&quot; data-start=&quot;2712&quot; /&gt;
&lt;h2 data-end=&quot;2758&quot; data-start=&quot;2717&quot;&gt;6. Change One Line to Control InDesign&lt;/h2&gt;
&lt;h3 data-end=&quot;2784&quot; data-start=&quot;2760&quot;&gt;6.1 Replace the Code&lt;/h3&gt;
&lt;p data-end=&quot;2867&quot; data-start=&quot;2786&quot;&gt;Open the same &lt;code data-end=&quot;2806&quot; data-start=&quot;2800&quot;&gt;.jsx&lt;/code&gt; file again and replace its contents with the following line:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;2899&quot; data-start=&quot;2869&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-js&quot;&gt;app.&lt;span class=&quot;hljs-property&quot;&gt;documents&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;add&lt;/span&gt;();
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2915&quot; data-start=&quot;2901&quot;&gt;Save the file.&lt;/p&gt;
&lt;hr data-end=&quot;2920&quot; data-start=&quot;2917&quot; /&gt;
&lt;h3 data-end=&quot;2942&quot; data-start=&quot;2922&quot;&gt;6.2 Run It Again&lt;/h3&gt;
&lt;p data-end=&quot;2992&quot; data-start=&quot;2944&quot;&gt;Run the script from the Scripts panel once more.&lt;/p&gt;
&lt;p data-end=&quot;3046&quot; data-start=&quot;2994&quot;&gt;If a new InDesign document opens, the script worked.&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/01/how-to-run-javascript-in-adobe-indesign/03.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;A new blank InDesign document, Untitled-1, opened by the script&quot; data-original-height=&quot;896&quot; data-original-width=&quot;1013&quot; height=&quot;240&quot; src=&quot;/images/2026/01/how-to-run-javascript-in-adobe-indesign/03.png&quot; width=&quot;271&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p data-end=&quot;3099&quot; data-start=&quot;3048&quot;&gt;This confirms something more important than before:&lt;/p&gt;
&lt;blockquote data-end=&quot;3163&quot; data-start=&quot;3101&quot;&gt;
&lt;p data-end=&quot;3163&quot; data-start=&quot;3103&quot;&gt;JavaScript is not just running — it is controlling InDesign.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr data-end=&quot;3168&quot; data-start=&quot;3165&quot; /&gt;
&lt;h2 data-end=&quot;3220&quot; data-start=&quot;3170&quot;&gt;7. What Is Actually Necessary (And What Is Not)&lt;/h2&gt;
&lt;p data-end=&quot;3304&quot; data-start=&quot;3222&quot;&gt;At this stage, enough has already been covered to start using scripts in practice.&lt;/p&gt;
&lt;p data-end=&quot;3322&quot; data-start=&quot;3306&quot;&gt;It is now clear:&lt;/p&gt;
&lt;ul data-end=&quot;3416&quot; data-start=&quot;3324&quot;&gt;
&lt;li data-end=&quot;3352&quot; data-start=&quot;3324&quot;&gt;
&lt;p data-end=&quot;3352&quot; data-start=&quot;3326&quot;&gt;Where scripts are stored&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3378&quot; data-start=&quot;3353&quot;&gt;
&lt;p data-end=&quot;3378&quot; data-start=&quot;3355&quot;&gt;How they are executed&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3416&quot; data-start=&quot;3379&quot;&gt;
&lt;p data-end=&quot;3416&quot; data-start=&quot;3381&quot;&gt;That scripts can control InDesign&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3525&quot; data-start=&quot;3418&quot;&gt;A deep understanding of JavaScript is not required.&lt;br data-end=&quot;3472&quot; data-start=&quot;3469&quot; /&gt;
Programming theory is also unnecessary at this point.&lt;/p&gt;
&lt;p data-end=&quot;3601&quot; data-start=&quot;3527&quot;&gt;For many real-world InDesign tasks, this level of knowledge is sufficient.&lt;/p&gt;
&lt;hr data-end=&quot;3606&quot; data-start=&quot;3603&quot; /&gt;
&lt;h2 data-end=&quot;3631&quot; data-start=&quot;3608&quot;&gt;8. That’s It for Now&lt;/h2&gt;
&lt;p data-end=&quot;3671&quot; data-start=&quot;3633&quot;&gt;This article intentionally stops here.&lt;/p&gt;
&lt;p data-end=&quot;3800&quot; data-start=&quot;3673&quot;&gt;The goal was not to teach JavaScript, but to remove the barrier between&lt;br data-end=&quot;3747&quot; data-start=&quot;3744&quot; /&gt;
“I’ve heard of scripts” and “I can actually run one”.&lt;/p&gt;
&lt;p data-end=&quot;3963&quot; data-start=&quot;3802&quot;&gt;Most articles on this blog are written for people working with InDesign in production environments.&lt;br data-end=&quot;3904&quot; data-start=&quot;3901&quot; /&gt;
Occasionally, articles like this are added as entry points.&lt;/p&gt;
&lt;p data-end=&quot;4040&quot; data-start=&quot;3965&quot;&gt;If a script can be executed successfully, the hardest part is already over.&lt;/p&gt;&lt;p data-end=&quot;4040&quot; data-start=&quot;3965&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p data-end=&quot;4040&quot; data-start=&quot;3965&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p data-end=&quot;4040&quot; data-start=&quot;3965&quot;&gt;If you want to try a real-world example, the following article includes a sample script.&lt;/p&gt;&lt;p data-end=&quot;531&quot; data-start=&quot;457&quot;&gt;The script can be run using exactly the same method shown in this article:&lt;/p&gt;&lt;p data-end=&quot;4040&quot; data-start=&quot;3965&quot;&gt;

&lt;/p&gt;&lt;ul data-end=&quot;621&quot; data-start=&quot;536&quot;&gt;
&lt;li data-end=&quot;621&quot; data-start=&quot;536&quot;&gt;
&lt;p data-end=&quot;621&quot; data-start=&quot;538&quot;&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating.html&quot;&gt;Scaling Multilingual DTP by Automating Trados-Ready IDML Export from InDesign Books&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/02/your-first-practical-indesign.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Your First Practical InDesign Automation: Opening and Closing Multiple Files&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2025/06/close-all-indesign-files-with-one-click.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Close All InDesign Files with One Click: A Script for Busy Designers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/07/your-first-indesign-script-which-pages.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Your First InDesign Script: Which Pages Have Overset Text?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>

  <entry>
    <title>Scaling Multilingual DTP by Automating Mandatory Text Checks in PDFs Before Delivery</title>
    <id>https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_21.html</id>
    <link href="https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_21.html"/>
    <published>2026-01-22T00:54:00.000Z</published>
    <updated>2026-03-26T20:32:51.141Z</updated>
    <summary>In multilingual documentation workflows, the final deliverable is often a PDF. Even when layout, links, and styles are correct, a document can still fail for a very simple reason: a required text string is missing. Typical examples include: Safety headings…</summary>
    <content type="html">&lt;p&gt;&amp;nbsp;In multilingual documentation workflows, the final deliverable is often a PDF.&lt;/p&gt;&lt;p data-end=&quot;380&quot; data-start=&quot;199&quot;&gt;
Even when layout, links, and styles are correct, a document can still fail for a very simple reason:&lt;/p&gt;
&lt;p data-end=&quot;421&quot; data-start=&quot;382&quot;&gt;&lt;strong data-end=&quot;421&quot; data-start=&quot;382&quot;&gt;a required text string is missing.&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;448&quot; data-start=&quot;423&quot;&gt;Typical examples include:&lt;/p&gt;
&lt;ul data-end=&quot;581&quot; data-start=&quot;449&quot;&gt;
&lt;li data-end=&quot;484&quot; data-start=&quot;449&quot;&gt;
&lt;p data-end=&quot;484&quot; data-start=&quot;451&quot;&gt;Safety headings such as &lt;em data-end=&quot;484&quot; data-start=&quot;475&quot;&gt;Warning&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;529&quot; data-start=&quot;485&quot;&gt;
&lt;p data-end=&quot;529&quot; data-start=&quot;487&quot;&gt;Regulatory sections such as &lt;em data-end=&quot;529&quot; data-start=&quot;515&quot;&gt;Intended Use&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;552&quot; data-start=&quot;530&quot;&gt;
&lt;p data-end=&quot;552&quot; data-start=&quot;532&quot;&gt;Copyright statements&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;581&quot; data-start=&quot;553&quot;&gt;
&lt;p data-end=&quot;581&quot; data-start=&quot;555&quot;&gt;Document or revision codes&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;674&quot; data-start=&quot;583&quot;&gt;These are easy to overlook—especially when you deliver many PDFs across multiple languages.&lt;/p&gt;
&lt;hr data-end=&quot;1598&quot; data-start=&quot;1595&quot; /&gt;
&lt;h2 data-end=&quot;1645&quot; data-start=&quot;1600&quot;&gt;Why I built this script in the first place&lt;/h2&gt;
&lt;p data-end=&quot;1794&quot; data-start=&quot;1647&quot;&gt;In my experience, many PDF proofreading or QA tools are good at finding &lt;strong data-end=&quot;1738&quot; data-start=&quot;1719&quot;&gt;forbidden words&amp;nbsp;&lt;/strong&gt;(for example, detecting if &lt;em data-end=&quot;1775&quot; data-start=&quot;1768&quot;&gt;Draft&lt;/em&gt; is still present).&lt;/p&gt;
&lt;p data-end=&quot;1896&quot; data-start=&quot;1796&quot;&gt;However, tools that can reliably detect when a &lt;strong data-end=&quot;1873&quot; data-start=&quot;1843&quot;&gt;required text is missing&lt;/strong&gt; are surprisingly rare.&lt;/p&gt;
&lt;p data-end=&quot;1923&quot; data-start=&quot;1898&quot;&gt;When such tools do exist:&lt;/p&gt;
&lt;ul data-end=&quot;2005&quot; data-start=&quot;1924&quot;&gt;
&lt;li data-end=&quot;1967&quot; data-start=&quot;1924&quot;&gt;
&lt;p data-end=&quot;1967&quot; data-start=&quot;1926&quot;&gt;they are often enterprise-level solutions&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2005&quot; data-start=&quot;1968&quot;&gt;
&lt;p data-end=&quot;2005&quot; data-start=&quot;1970&quot;&gt;and they are usually very expensive&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2108&quot; data-start=&quot;2007&quot;&gt;That gap is what motivated me to create a small, purpose-built script that answers a simple question:&lt;/p&gt;
&lt;blockquote data-end=&quot;2167&quot; data-start=&quot;2110&quot;&gt;
&lt;p data-end=&quot;2167&quot; data-start=&quot;2112&quot;&gt;“Is this required text actually present in every PDF?”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr data-end=&quot;2172&quot; data-start=&quot;2169&quot; /&gt;
&lt;h2 data-end=&quot;2200&quot; data-start=&quot;2174&quot;&gt;The automation approach&lt;/h2&gt;
&lt;p data-end=&quot;2236&quot; data-start=&quot;2202&quot;&gt;The basic idea is straightforward:&lt;/p&gt;
&lt;ol data-end=&quot;2411&quot; data-start=&quot;2238&quot;&gt;
&lt;li data-end=&quot;2269&quot; data-start=&quot;2238&quot;&gt;
&lt;p data-end=&quot;2269&quot; data-start=&quot;2241&quot;&gt;Extract text from each PDF&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2324&quot; data-start=&quot;2270&quot;&gt;
&lt;p data-end=&quot;2324&quot; data-start=&quot;2273&quot;&gt;Search for a predefined list of required texts&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2360&quot; data-start=&quot;2325&quot;&gt;
&lt;p data-end=&quot;2360&quot; data-start=&quot;2328&quot;&gt;Report which PDFs pass or fail&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2411&quot; data-start=&quot;2361&quot;&gt;
&lt;p data-end=&quot;2411&quot; data-start=&quot;2364&quot;&gt;Save the results as a log file for traceability&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;2504&quot; data-start=&quot;2413&quot;&gt;This does not replace full QA.&lt;br data-end=&quot;2446&quot; data-start=&quot;2443&quot; /&gt;
It provides a fast, repeatable safety net before delivery.&lt;/p&gt;
&lt;hr data-end=&quot;2509&quot; data-start=&quot;2506&quot; /&gt;
&lt;h2 data-end=&quot;2563&quot; data-start=&quot;2511&quot;&gt;Minimal script example (folder-based batch check)&lt;/h2&gt;
&lt;p data-end=&quot;2654&quot; data-start=&quot;2565&quot;&gt;⚠ &lt;strong data-end=&quot;2597&quot; data-start=&quot;2567&quot;&gt;Important note for readers&lt;/strong&gt;&lt;br data-end=&quot;2600&quot; data-start=&quot;2597&quot; /&gt;
This example is written in &lt;strong data-end=&quot;2637&quot; data-start=&quot;2627&quot;&gt;Python&lt;/strong&gt;, not JavaScript.&lt;/p&gt;
&lt;p data-end=&quot;2720&quot; data-start=&quot;2656&quot;&gt;If you mainly work with InDesign scripting, this is intentional:&lt;/p&gt;
&lt;ul data-end=&quot;2840&quot; data-start=&quot;2721&quot;&gt;
&lt;li data-end=&quot;2781&quot; data-start=&quot;2721&quot;&gt;
&lt;p data-end=&quot;2781&quot; data-start=&quot;2723&quot;&gt;InDesign scripts are ideal for layout and asset automation&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2840&quot; data-start=&quot;2782&quot;&gt;
&lt;p data-end=&quot;2840&quot; data-start=&quot;2784&quot;&gt;PDF-level QA is often easier and more reliable in Python&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2871&quot; data-start=&quot;2842&quot;&gt;To run this script, you need:&lt;/p&gt;
&lt;ul data-end=&quot;2987&quot; data-start=&quot;2872&quot;&gt;
&lt;li data-end=&quot;2894&quot; data-start=&quot;2872&quot;&gt;
&lt;p data-end=&quot;2894&quot; data-start=&quot;2874&quot;&gt;Python 3.10 or later&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2987&quot; data-start=&quot;2895&quot;&gt;
&lt;p data-end=&quot;2919&quot; data-start=&quot;2897&quot;&gt;The following modules:&lt;/p&gt;
&lt;ul data-end=&quot;2987&quot; data-start=&quot;2922&quot;&gt;
&lt;li data-end=&quot;2942&quot; data-start=&quot;2922&quot;&gt;
&lt;p data-end=&quot;2942&quot; data-start=&quot;2924&quot;&gt;&lt;code data-end=&quot;2933&quot; data-start=&quot;2924&quot;&gt;PyMuPDF&lt;/code&gt; (&lt;code data-end=&quot;2941&quot; data-start=&quot;2935&quot;&gt;fitz&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2987&quot; data-start=&quot;2945&quot;&gt;
&lt;p data-end=&quot;2987&quot; data-start=&quot;2947&quot;&gt;&lt;code data-end=&quot;2956&quot; data-start=&quot;2947&quot;&gt;tkinter&lt;/code&gt; (usually included with Python)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3017&quot; data-start=&quot;2989&quot;&gt;Module installation example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;3045&quot; data-start=&quot;3018&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;&lt;span class=&quot;hljs-attribute&quot;&gt;pip&lt;/span&gt; install pymupdf
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;3050&quot; data-start=&quot;3047&quot; /&gt;
&lt;h3 data-end=&quot;3095&quot; data-start=&quot;3052&quot;&gt;Example required texts (sample only)&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;3194&quot; data-start=&quot;3097&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-python&quot;&gt;NEEDLES = [
    &lt;span class=&quot;hljs-string&quot;&gt;&quot;Warning&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot;&gt;&quot;Intended Use&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot;&gt;&quot;Copyright&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot;&gt;&quot;1234-5678A&quot;&lt;/span&gt;,
]
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;3317&quot; data-start=&quot;3196&quot;&gt;These strings are intentionally generic and represent typical mandatory elements in technical or regulated documentation.&lt;/p&gt;
&lt;hr data-end=&quot;3322&quot; data-start=&quot;3319&quot; /&gt;
&lt;h3 data-end=&quot;3362&quot; data-start=&quot;3324&quot;&gt;Python sample script (MIT License)&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;5869&quot; data-start=&quot;3364&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;background: rgb(17, 24, 39); border-radius: 8px; color: #e5e7eb; font-family: Consolas, Monaco, monospace; overflow: auto; padding: 16px; white-space: pre;&quot;&gt;&lt;code&gt;from __future__ import annotations

from pathlib import Path
import re
import time
import fitz  # PyMuPDF
import tkinter as tk
from tkinter import filedialog

# Sample mandatory strings (English-only example)
NEEDLES = [
    &quot;Warning&quot;,
    &quot;Intended Use&quot;,
    &quot;Copyright&quot;,
    &quot;1234-5678A&quot;,
]

LOG_FILENAME = &quot;pdf_mandatory_text_check_results.txt&quot;


def normalize(s: str) -&amp;gt; str:
    &quot;&quot;&quot;
    Minimal normalization for robust matching:
    - lowercase comparison
    - collapsed whitespace
    &quot;&quot;&quot;
    s = s.lower()
    s = re.sub(r&quot;\s+&quot;, &quot; &quot;, s).strip()
    return s


def select_target_dir() -&amp;gt; Path | None:
    root = tk.Tk()
    root.withdraw()
    root.attributes(&quot;-topmost&quot;, True)

    folder = filedialog.askdirectory(
        title=&quot;Select a folder containing PDFs&quot;
    )
    root.destroy()

    return Path(folder) if folder else None


def pdf_contains_all_text(
    pdf_path: Path,
    needles: list[str],
) -&amp;gt; tuple[bool, list[str], str | None]:
    &quot;&quot;&quot;
    Returns:
      ok: bool
      missing: list[str]
      error: str | None
    &quot;&quot;&quot;
    try:
        doc = fitz.open(pdf_path)
        texts: list[str] = []
        for page in doc:
            texts.append(page.get_text(&quot;text&quot;))
        all_text = normalize(&quot;\n&quot;.join(texts))
    except Exception as e:
        return False, needles, f&quot;{type(e).__name__}: {e}&quot;

    missing: list[str] = []
    for needle in needles:
        if normalize(needle) not in all_text:
            missing.append(needle)

    return len(missing) == 0, missing, None


def main() -&amp;gt; int:
    target_dir = select_target_dir()
    if target_dir is None:
        print(&quot;Cancelled (no folder selected).&quot;)
        time.sleep(5)
        return 0

    pdfs = sorted(target_dir.glob(&quot;*.pdf&quot;))
    if not pdfs:
        print(&quot;No PDFs found in the selected folder.&quot;)
        time.sleep(5)
        return 0

    log_path = target_dir / LOG_FILENAME
    lines: list[str] = []

    lines.append(&quot;PDF Mandatory Text Check Results&quot;)
    lines.append(f&quot;Folder: {target_dir}&quot;)
    lines.append(f&quot;Mandatory strings: {NEEDLES}&quot;)
    lines.append(&quot;&quot;)

    has_ng = False

    print(&quot;Results:&quot;)
    for pdf in pdfs:
        ok, missing, error = pdf_contains_all_text(pdf, NEEDLES)

        if error:
            has_ng = True
            msg = f&quot;{pdf.name}: ERROR  {error}&quot;
        elif ok:
            msg = f&quot;{pdf.name}: OK&quot;
        else:
            has_ng = True
            msg = f&quot;{pdf.name}: NG  Missing: {missing}&quot;

        print(msg)
        lines.append(msg)

    log_path.write_text(
        &quot;\n&quot;.join(lines) + &quot;\n&quot;,
        encoding=&quot;utf-8&quot;
    )

    print(f&quot;\nLog written to: {log_path}&quot;)
    print(&quot;\nProcess completed.&quot;)
    print(&quot;This window will close automatically in 5 seconds...&quot;)
    time.sleep(5)

    return 1 if has_ng else 0


if __name__ == &quot;__main__&quot;:
    raise SystemExit(main())&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-python&quot;&gt;&lt;hr data-end=&quot;679&quot; data-start=&quot;676&quot; style=&quot;font-family: &amp;quot;Noto Sans JP&amp;quot;; white-space: normal;&quot; /&gt;&lt;blockquote&gt;&lt;strong style=&quot;font-family: &amp;quot;Noto Sans JP&amp;quot;; white-space: normal;&quot;&gt;Note:&lt;/strong&gt;&lt;span style=&quot;font-family: Noto Sans JP;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family: Noto Sans JP;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;This script is intentionally simplified and provided as a sample.&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family: Noto Sans JP;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;Because the required texts are defined in English, it cannot be used as-is for full multilingual validation.&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family: Noto Sans JP;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;In production, the validation logic itself is typically shared, while the rule sets are switched automatically by detecting the target language from the file name or from the PDF content.&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;5874&quot; data-start=&quot;5871&quot; /&gt;
&lt;h2 data-end=&quot;5918&quot; data-start=&quot;5876&quot;&gt;What I add in real production workflows&lt;/h2&gt;
&lt;p data-end=&quot;5984&quot; data-start=&quot;5920&quot;&gt;In real projects, this kind of checker is usually extended with:&lt;/p&gt;
&lt;ul data-end=&quot;6166&quot; data-start=&quot;5985&quot;&gt;
&lt;li data-end=&quot;6026&quot; data-start=&quot;5985&quot;&gt;
&lt;p data-end=&quot;6026&quot; data-start=&quot;5987&quot;&gt;Language-specific required text sets&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;6061&quot; data-start=&quot;6027&quot;&gt;
&lt;p data-end=&quot;6061&quot; data-start=&quot;6029&quot;&gt;CSV reports for PMs and QA teams&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;6094&quot; data-start=&quot;6062&quot;&gt;
&lt;p data-end=&quot;6094&quot; data-start=&quot;6064&quot;&gt;Additional PDF checks (file naming, etc)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;6247&quot; data-start=&quot;6168&quot;&gt;This article intentionally focuses on the &lt;strong data-end=&quot;6246&quot; data-start=&quot;6210&quot;&gt;simplest reliable starting point&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;6252&quot; data-start=&quot;6249&quot; /&gt;
&lt;h2 data-end=&quot;6273&quot; data-start=&quot;6254&quot;&gt;Related articles&lt;/h2&gt;
&lt;p data-end=&quot;6367&quot; data-start=&quot;6275&quot;&gt;If you are interested in scaling multilingual DTP workflows, you may also find these useful:&lt;/p&gt;
&lt;ul data-end=&quot;6622&quot; data-start=&quot;6369&quot;&gt;
&lt;li data-end=&quot;6458&quot; data-start=&quot;6369&quot;&gt;
&lt;p data-end=&quot;6458&quot; data-start=&quot;6371&quot;&gt;&lt;em data-end=&quot;6456&quot; data-start=&quot;6371&quot;&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating.html&quot;&gt;Scaling Multilingual DTP by Automating Trados-Ready IDML Export from InDesign Books&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;6536&quot; data-start=&quot;6459&quot;&gt;
&lt;p data-end=&quot;6536&quot; data-start=&quot;6461&quot;&gt;&lt;em data-end=&quot;6534&quot; data-start=&quot;6461&quot;&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_15.html&quot;&gt;Scaling Multilingual DTP by Automating Style Reloads Before Translation&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;6622&quot; data-start=&quot;6537&quot;&gt;
&lt;p data-end=&quot;6622&quot; data-start=&quot;6539&quot;&gt;&lt;em data-end=&quot;6622&quot; data-start=&quot;6539&quot;&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_18.html&quot;&gt;Scaling Multilingual DTP by Automating Language-Based Image Relinking in InDesign&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li data-end=&quot;6622&quot; data-start=&quot;6537&quot;&gt;&lt;p data-end=&quot;6622&quot; data-start=&quot;6539&quot;&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-eliminating.html&quot;&gt;Scaling Multilingual DTP by Eliminating Manual InDesign Text Overset Fixes&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content>
  </entry>

  <entry>
    <title>Scaling Multilingual DTP by Automating Language-Based Image Relinking in InDesign</title>
    <id>https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_18.html</id>
    <link href="https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_18.html"/>
    <published>2026-01-19T01:43:00.000Z</published>
    <updated>2026-03-26T20:43:39.975Z</updated>
    <summary>When working on multilingual documents, it’s common for placed images to exist in language-specific variants. A typical pattern looks like this: diagram_EN.ai diagram_DE.ai Before or after translation, these images must be relinked to the correct language version. Doing this manually…</summary>
    <content type="html">&lt;div style=&quot;text-align: left;&quot;&gt;When working on multilingual documents, it’s common for placed images to exist in language-specific variants.&lt;/div&gt;&lt;p data-end=&quot;319&quot; data-start=&quot;173&quot;&gt;
A typical pattern looks like this:&lt;/p&gt;&lt;ul data-end=&quot;356&quot; data-start=&quot;321&quot;&gt;
&lt;li data-end=&quot;338&quot; data-start=&quot;321&quot;&gt;
&lt;p data-end=&quot;338&quot; data-start=&quot;323&quot;&gt;&lt;code data-end=&quot;338&quot; data-start=&quot;323&quot;&gt;diagram_EN.ai&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;356&quot; data-start=&quot;339&quot;&gt;
&lt;p data-end=&quot;356&quot; data-start=&quot;341&quot;&gt;&lt;code data-end=&quot;356&quot; data-start=&quot;341&quot;&gt;diagram_DE.ai&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;534&quot; data-start=&quot;358&quot;&gt;Before or after translation, these images must be relinked to the correct language version.&lt;br data-end=&quot;452&quot; data-start=&quot;449&quot; /&gt;
Doing this manually works for a single file — but it quickly breaks down at scale.&lt;/p&gt;&lt;hr data-end=&quot;539&quot; data-start=&quot;536&quot; /&gt;&lt;h2 data-end=&quot;585&quot; data-start=&quot;541&quot;&gt;Why manual image relinking doesn’t scale&lt;/h2&gt;&lt;p data-end=&quot;660&quot; data-start=&quot;587&quot;&gt;In InDesign, relinking a single image is trivial.&lt;br data-end=&quot;639&quot; data-start=&quot;636&quot; /&gt;
But in real projects:&lt;/p&gt;&lt;ul data-end=&quot;807&quot; data-start=&quot;662&quot;&gt;
&lt;li data-end=&quot;714&quot; data-start=&quot;662&quot;&gt;
&lt;p data-end=&quot;714&quot; data-start=&quot;664&quot;&gt;One document can contain dozens of placed images&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;752&quot; data-start=&quot;715&quot;&gt;
&lt;p data-end=&quot;752&quot; data-start=&quot;717&quot;&gt;A Book can contain many documents&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;807&quot; data-start=&quot;753&quot;&gt;
&lt;p data-end=&quot;807&quot; data-start=&quot;755&quot;&gt;Missing just one image can cause serious QA issues&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;894&quot; data-start=&quot;809&quot;&gt;As the number of files grows, &lt;strong data-end=&quot;893&quot; data-start=&quot;839&quot;&gt;manual relinking becomes both slow and error-prone&lt;/strong&gt;.&lt;/p&gt;&lt;hr data-end=&quot;899&quot; data-start=&quot;896&quot; /&gt;&lt;h2 data-end=&quot;957&quot; data-start=&quot;901&quot;&gt;Why not just replace images with the same filenames?&lt;/h2&gt;&lt;p data-end=&quot;995&quot; data-start=&quot;959&quot;&gt;At this point, some readers may ask:&lt;/p&gt;&lt;blockquote data-end=&quot;1096&quot; data-start=&quot;997&quot;&gt;
&lt;p data-end=&quot;1096&quot; data-start=&quot;999&quot;&gt;“Why not keep all image filenames identical and simply replace the contents of the Links folder?”&lt;/p&gt;
&lt;/blockquote&gt;&lt;p data-end=&quot;1244&quot; data-start=&quot;1098&quot;&gt;This approach does exist in real production environments. I have encountered multiple cases where companies have organised their data in this way.&lt;/p&gt;&lt;p data-end=&quot;1244&quot; data-start=&quot;1098&quot;&gt;However, in practice, it introduces serious risks.&lt;/p&gt;&lt;p data-end=&quot;1349&quot; data-start=&quot;1298&quot;&gt;When all language variants share the same filename:&lt;/p&gt;&lt;ul data-end=&quot;1670&quot; data-start=&quot;1351&quot;&gt;
&lt;li data-end=&quot;1455&quot; data-start=&quot;1351&quot;&gt;
&lt;p data-end=&quot;1455&quot; data-start=&quot;1353&quot;&gt;Once an image is replaced, there is no longer any visible indication of which language it belongs to&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1528&quot; data-start=&quot;1456&quot;&gt;
&lt;p data-end=&quot;1528&quot; data-start=&quot;1458&quot;&gt;If a replacement mistake occurs, tracing the error becomes difficult&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1670&quot; data-start=&quot;1529&quot;&gt;
&lt;p data-end=&quot;1670&quot; data-start=&quot;1531&quot;&gt;When a designer or operator needs to make even a small visual correction, it is no longer obvious which language version they are editing&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;1728&quot; data-start=&quot;1672&quot;&gt;In multilingual production, these situations are common:&lt;/p&gt;&lt;ul data-end=&quot;1869&quot; data-start=&quot;1730&quot;&gt;
&lt;li data-end=&quot;1778&quot; data-start=&quot;1730&quot;&gt;
&lt;p data-end=&quot;1778&quot; data-start=&quot;1732&quot;&gt;A regulatory label needs a minor wording fix&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1822&quot; data-start=&quot;1779&quot;&gt;
&lt;p data-end=&quot;1822&quot; data-start=&quot;1781&quot;&gt;A UI screenshot requires a small update&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1869&quot; data-start=&quot;1823&quot;&gt;
&lt;p data-end=&quot;1869&quot; data-start=&quot;1825&quot;&gt;A diagram needs a slight annotation change&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;1974&quot; data-start=&quot;1871&quot;&gt;Without explicit language identifiers in filenames, such fixes can easily be applied to the wrong file.&lt;/p&gt;&lt;p data-end=&quot;2172&quot; data-start=&quot;1976&quot;&gt;By contrast, language-suffixed filenames such as &lt;code data-end=&quot;2030&quot; data-start=&quot;2025&quot;&gt;_EN&lt;/code&gt;, &lt;code data-end=&quot;2037&quot; data-start=&quot;2032&quot;&gt;_DE&lt;/code&gt;, or &lt;code data-end=&quot;2048&quot; data-start=&quot;2042&quot;&gt;_JPN&lt;/code&gt; make the language immediately visible.&lt;br data-end=&quot;2090&quot; data-start=&quot;2087&quot; /&gt;
This improves traceability, reduces mistakes, and makes version control far safer.&lt;/p&gt;&lt;p data-end=&quot;2324&quot; data-start=&quot;2174&quot;&gt;For this reason, I deliberately prefer &lt;strong data-end=&quot;2275&quot; data-start=&quot;2213&quot;&gt;language-coded filenames combined with automated relinking&lt;/strong&gt;, rather than relying on silent file replacement.&lt;/p&gt;&lt;p data-end=&quot;2447&quot; data-start=&quot;2326&quot;&gt;Automation works best when the rules are explicit — and filename conventions are among the most reliable rules available.&lt;/p&gt;&lt;hr data-end=&quot;2452&quot; data-start=&quot;2449&quot; /&gt;&lt;h2 data-end=&quot;2481&quot; data-start=&quot;2454&quot;&gt;The automation approach&lt;/h2&gt;&lt;p data-end=&quot;2576&quot; data-start=&quot;2483&quot;&gt;In many production environments, image naming rules are fixed and predictable.&lt;br data-end=&quot;2564&quot; data-start=&quot;2561&quot; /&gt;
For example:&lt;/p&gt;&lt;ul data-end=&quot;2641&quot; data-start=&quot;2578&quot;&gt;
&lt;li data-end=&quot;2595&quot; data-start=&quot;2578&quot;&gt;
&lt;p data-end=&quot;2595&quot; data-start=&quot;2580&quot;&gt;&lt;code data-end=&quot;2585&quot; data-start=&quot;2580&quot;&gt;_EN&lt;/code&gt; → &lt;code data-end=&quot;2593&quot; data-start=&quot;2588&quot;&gt;_DE&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2619&quot; data-start=&quot;2596&quot;&gt;
&lt;p data-end=&quot;2619&quot; data-start=&quot;2598&quot;&gt;Same file extension&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2641&quot; data-start=&quot;2620&quot;&gt;
&lt;p data-end=&quot;2641&quot; data-start=&quot;2622&quot;&gt;Same Links folder&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;2726&quot; data-start=&quot;2643&quot;&gt;When these assumptions hold, relinking can be automated safely with a small script.&lt;/p&gt;&lt;p data-end=&quot;2747&quot; data-start=&quot;2728&quot;&gt;The idea is simple:&lt;/p&gt;&lt;ul data-end=&quot;2927&quot; data-start=&quot;2749&quot;&gt;
&lt;li data-end=&quot;2807&quot; data-start=&quot;2749&quot;&gt;
&lt;p data-end=&quot;2807&quot; data-start=&quot;2751&quot;&gt;Detect linked images ending with &lt;code data-end=&quot;2792&quot; data-start=&quot;2784&quot;&gt;_EN.ai&lt;/code&gt; or &lt;code data-end=&quot;2805&quot; data-start=&quot;2796&quot;&gt;_EN.psd&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2841&quot; data-start=&quot;2808&quot;&gt;
&lt;p data-end=&quot;2841&quot; data-start=&quot;2810&quot;&gt;Replace the suffix with &lt;code data-end=&quot;2839&quot; data-start=&quot;2834&quot;&gt;_DE&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2879&quot; data-start=&quot;2842&quot;&gt;
&lt;p data-end=&quot;2879&quot; data-start=&quot;2844&quot;&gt;Relink the file only if it exists&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2927&quot; data-start=&quot;2880&quot;&gt;
&lt;p data-end=&quot;2927&quot; data-start=&quot;2882&quot;&gt;Repeat for all open documents when required&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;hr data-end=&quot;2932&quot; data-start=&quot;2929&quot; /&gt;&lt;h2 data-end=&quot;2971&quot; data-start=&quot;2934&quot;&gt;Minimal script example (AI + PSD)&lt;/h2&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;319&quot; src=&quot;https://www.youtube.com/embed/KFsSbjMHvAQ&quot; width=&quot;483&quot; youtube-src-id=&quot;KFsSbjMHvAQ&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p data-end=&quot;3085&quot; data-start=&quot;2973&quot;&gt;The following script demonstrates the core idea.&lt;/p&gt;&lt;p data-end=&quot;3085&quot; data-start=&quot;2973&quot;&gt;
It is intentionally minimal and designed for educational use.&lt;/p&gt;&lt;ul data-end=&quot;3263&quot; data-start=&quot;3087&quot;&gt;
&lt;li data-end=&quot;3119&quot; data-start=&quot;3087&quot;&gt;
&lt;p data-end=&quot;3119&quot; data-start=&quot;3089&quot;&gt;Targets &lt;strong data-end=&quot;3117&quot; data-start=&quot;3097&quot;&gt;AI and PSD files&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3168&quot; data-start=&quot;3120&quot;&gt;
&lt;p data-end=&quot;3168&quot; data-start=&quot;3122&quot;&gt;Uses a &lt;strong data-end=&quot;3150&quot; data-start=&quot;3129&quot;&gt;fixed naming rule&lt;/strong&gt; (&lt;code data-end=&quot;3157&quot; data-start=&quot;3152&quot;&gt;_EN&lt;/code&gt; → &lt;code data-end=&quot;3165&quot; data-start=&quot;3160&quot;&gt;_DE&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3216&quot; data-start=&quot;3169&quot;&gt;
&lt;p data-end=&quot;3216&quot; data-start=&quot;3171&quot;&gt;Assumes the same extension and Links folder&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3263&quot; data-start=&quot;3217&quot;&gt;
&lt;p data-end=&quot;3263&quot; data-start=&quot;3219&quot;&gt;Includes only a simple confirmation dialog&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;3309&quot; data-start=&quot;3265&quot;&gt;&lt;strong data-end=&quot;3277&quot; data-start=&quot;3265&quot;&gt;License:&lt;/strong&gt; MIT&lt;br data-end=&quot;3284&quot; data-start=&quot;3281&quot; /&gt;
&lt;strong data-end=&quot;3309&quot; data-start=&quot;3284&quot;&gt;Use at your own risk.&lt;/strong&gt;&lt;/p&gt;
&lt;pre style=&quot;background: rgb(17, 24, 39); border-radius: 8px; color: #e5e7eb; font-family: Consolas, Monaco, monospace; overflow: auto; padding: 16px; white-space: pre;&quot;&gt;&lt;code&gt;#target indesign

(function () {

    if (app.documents.length === 0) {
        alert(&quot;No documents are open.&quot;);
        return;
    }

    var processAll = true;

    if (app.documents.length &amp;gt; 1) {
        processAll = confirm(
            &quot;Multiple documents are open.\n\nProcess all open documents?&quot;
        );
    }

    var docs = processAll ? app.documents : [app.activeDocument];

    for (var d = 0; d &amp;lt; docs.length; d++) {
        relinkImages(docs[d]);
    }

    alert(&quot;Relinking completed.&quot;);

    function relinkImages(doc) {

        var pages = doc.pages;

        for (var i = 0; i &amp;lt; pages.length; i++) {
            var graphics = pages[i].allGraphics;

            for (var j = 0; j &amp;lt; graphics.length; j++) {
                try {
                    var link = graphics[j].itemLink;
                    if (!link) continue;

                    var name = link.name;

                    // Target: _EN.ai / _EN.psd
                    if (!name.match(/_EN\.(ai|psd)$/i)) continue;

                    var newName = name.replace(
                        /_EN\.(ai|psd)$/i,
                        &quot;_DE.$1&quot;
                    );

                    var newFile = new File(
                        doc.filePath + &quot;/Links/&quot; + newName
                    );

                    if (!newFile.exists) continue;

                    link.relink(newFile);

                } catch (e) {
                    // Skip problematic links safely
                    continue;
                }
            }
        }
    }

})();&lt;/code&gt;
&lt;/pre&gt;


&lt;hr data-end=&quot;4874&quot; data-start=&quot;4871&quot; /&gt;&lt;h2 data-end=&quot;4929&quot; data-start=&quot;4876&quot;&gt;What this looks like in real production workflows&lt;/h2&gt;&lt;p data-end=&quot;5027&quot; data-start=&quot;4931&quot;&gt;In actual production environments, this logic is typically part of a larger automation pipeline.&lt;/p&gt;&lt;p data-end=&quot;5055&quot; data-start=&quot;5029&quot;&gt;Common extensions include:&lt;/p&gt;&lt;ul data-end=&quot;5179&quot; data-start=&quot;5057&quot;&gt;
&lt;li data-end=&quot;5086&quot; data-start=&quot;5057&quot;&gt;
&lt;p data-end=&quot;5086&quot; data-start=&quot;5059&quot;&gt;Language selection via UI&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5113&quot; data-start=&quot;5087&quot;&gt;
&lt;p data-end=&quot;5113&quot; data-start=&quot;5089&quot;&gt;Validation and logging&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5139&quot; data-start=&quot;5114&quot;&gt;
&lt;p data-end=&quot;5139&quot; data-start=&quot;5116&quot;&gt;Support for additional naming rules&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;5237&quot; data-start=&quot;5181&quot;&gt;Those topics are intentionally left out of this article.&lt;/p&gt;&lt;hr data-end=&quot;5242&quot; data-start=&quot;5239&quot; /&gt;&lt;h2 data-end=&quot;5264&quot; data-start=&quot;5244&quot;&gt;Related articles&lt;/h2&gt;&lt;p data-end=&quot;5358&quot; data-start=&quot;5266&quot;&gt;If you are interested in scaling multilingual DTP workflows, you may also find these useful:&lt;/p&gt;&lt;p&gt;












































&lt;/p&gt;&lt;ul data-end=&quot;5528&quot; data-start=&quot;5360&quot;&gt;
&lt;li data-end=&quot;5440&quot; data-start=&quot;5360&quot;&gt;
&lt;p data-end=&quot;5440&quot; data-start=&quot;5362&quot;&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_15.html&quot;&gt;Scaling Multilingual DTP by Eliminating Manual InDesign Text Overset Fixes&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5528&quot; data-start=&quot;5441&quot;&gt;
&lt;p data-end=&quot;5528&quot; data-start=&quot;5443&quot;&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating.html&quot;&gt;Scaling Multilingual DTP by Automating Trados-Ready IDML Export from InDesign Books&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content>
  </entry>

  <entry>
    <title>Scaling Multilingual DTP by Automating Style Reloads Before Translation</title>
    <id>https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_15.html</id>
    <link href="https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating_15.html"/>
    <published>2026-01-16T00:35:00.000Z</published>
    <updated>2026-02-16T23:53:43.848Z</updated>
    <summary>Why styles must be reloaded before or after translation In multilingual publishing, layout problems are not caused by text expansion alone. When translating from English into Asian languages, fonts and typographic rules are completely different. Even when translating into languages…</summary>
    <content type="html">&lt;h2 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;Why styles must be reloaded before or after translation&lt;/h2&gt;
&lt;p data-end=&quot;288&quot; data-start=&quot;205&quot;&gt;In multilingual publishing, layout problems are not caused by text expansion alone.&lt;/p&gt;
&lt;p data-end=&quot;543&quot; data-start=&quot;290&quot;&gt;When translating from English into Asian languages, fonts and typographic rules are completely different. Even when translating into languages like German, longer words and different kerning requirements can quickly push text out of its original layout.&lt;/p&gt;
&lt;p data-end=&quot;736&quot; data-start=&quot;545&quot;&gt;For this reason, in real production work, paragraph and character styles are usually reloaded either before or after translation. &lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/01/scaling-multilingual-dtp-by-automating_15/01.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;InDesign Styles menu listing Cell, Character, Object, Paragraph, and Table Styles and Style Packs&quot; data-original-height=&quot;214&quot; data-original-width=&quot;335&quot; height=&quot;150&quot; src=&quot;/images/2026/01/scaling-multilingual-dtp-by-automating_15/01.png&quot; width=&quot;235&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Language-specific styles allow you to pre-define things like:&lt;p&gt;&lt;/p&gt;
&lt;ul data-end=&quot;819&quot; data-start=&quot;738&quot;&gt;
&lt;li data-end=&quot;755&quot; data-start=&quot;738&quot;&gt;
&lt;p data-end=&quot;755&quot; data-start=&quot;740&quot;&gt;Font families&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;780&quot; data-start=&quot;756&quot;&gt;
&lt;p data-end=&quot;780&quot; data-start=&quot;758&quot;&gt;Tracking and kerning&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;797&quot; data-start=&quot;781&quot;&gt;
&lt;p data-end=&quot;797&quot; data-start=&quot;783&quot;&gt;Line spacing&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;819&quot; data-start=&quot;798&quot;&gt;
&lt;p data-end=&quot;819&quot; data-start=&quot;800&quot;&gt;Paragraph spacing&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;891&quot; data-start=&quot;821&quot;&gt;This reduces the amount of layout correction needed after translation.&lt;/p&gt;
&lt;p data-end=&quot;1012&quot; data-start=&quot;893&quot;&gt;What does not work is changing fonts, kerning, or spacing manually for every file. That approach simply does not scale.&lt;/p&gt;
&lt;hr data-end=&quot;1017&quot; data-start=&quot;1014&quot; /&gt;
&lt;h2 data-end=&quot;1068&quot; data-start=&quot;1019&quot;&gt;Why this breaks down in multilingual projects&lt;/h2&gt;
&lt;p data-end=&quot;1149&quot; data-start=&quot;1070&quot;&gt;Even with language-specific styles, serious problems appear when projects grow.&lt;/p&gt;
&lt;p data-end=&quot;1288&quot; data-start=&quot;1151&quot;&gt;In an InDesign Book, every &lt;code data-end=&quot;1185&quot; data-start=&quot;1178&quot;&gt;.indd&lt;/code&gt; file must have the correct style set loaded. If a book contains 20 files, that is 20 separate imports.&lt;/p&gt;
&lt;p data-end=&quot;1342&quot; data-start=&quot;1290&quot;&gt;Worse, mistakes are easy to make and hard to detect.&lt;/p&gt;
&lt;p data-end=&quot;1557&quot; data-start=&quot;1344&quot;&gt;If you accidentally load Dutch styles instead of German styles, the document may still look “mostly okay” at a glance. The error might only be discovered much later—sometimes after translation or even at delivery.&lt;/p&gt;
&lt;p data-end=&quot;1621&quot; data-start=&quot;1559&quot;&gt;This is what makes manual style management dangerous at scale:&lt;/p&gt;
&lt;ul data-end=&quot;1712&quot; data-start=&quot;1622&quot;&gt;
&lt;li data-end=&quot;1648&quot; data-start=&quot;1622&quot;&gt;
&lt;p data-end=&quot;1648&quot; data-start=&quot;1624&quot;&gt;The work is repetitive&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1679&quot; data-start=&quot;1649&quot;&gt;
&lt;p data-end=&quot;1679&quot; data-start=&quot;1651&quot;&gt;The differences are subtle&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1712&quot; data-start=&quot;1680&quot;&gt;
&lt;p data-end=&quot;1712&quot; data-start=&quot;1682&quot;&gt;The cost of mistakes is high&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1717&quot; data-start=&quot;1714&quot; /&gt;
&lt;h2 data-end=&quot;1746&quot; data-start=&quot;1719&quot;&gt;The automation approach&lt;/h2&gt;
&lt;p data-end=&quot;1809&quot; data-start=&quot;1748&quot;&gt;The solution is to remove choice and memory from the process.&lt;/p&gt;
&lt;p data-end=&quot;2026&quot; data-start=&quot;1811&quot;&gt;Instead of letting operators manually pick style files, you place language-specific template files in fixed locations. A script then loads the correct styles into every open document, automatically and consistently.&lt;/p&gt;
&lt;p data-end=&quot;2125&quot; data-start=&quot;2028&quot;&gt;The goal is simple:&lt;br /&gt;
&lt;strong data-end=&quot;2125&quot; data-start=&quot;2048&quot;&gt;every document enters translation with the correct, normalized style set.&lt;/strong&gt;&lt;/p&gt;
&lt;hr data-end=&quot;2130&quot; data-start=&quot;2127&quot; /&gt;
&lt;h2 data-end=&quot;2160&quot; data-start=&quot;2132&quot;&gt;A minimal script example&lt;/h2&gt;
&lt;p data-end=&quot;2292&quot; data-start=&quot;2162&quot;&gt;Below is a simplified version of the script I use in production.&lt;br data-end=&quot;2229&quot; data-start=&quot;2226&quot; /&gt;
You only need to adjust the file path for your own environment.&lt;/p&gt;
&lt;p data-end=&quot;2307&quot; data-start=&quot;2294&quot;&gt;License: MIT.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;4107&quot; data-start=&quot;2309&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-javascript&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;applyStyles&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;styleFile&lt;/span&gt;)
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; templateFile = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;File&lt;/span&gt;(styleFile);
    &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (!templateFile.&lt;span class=&quot;hljs-property&quot;&gt;exists&lt;/span&gt;) {
        &lt;span class=&quot;hljs-title function_&quot;&gt;alert&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Template file not found: &quot;&lt;/span&gt; + styleFile);
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt;;
    }

    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; tempFilePath = &lt;span class=&quot;hljs-title class_&quot;&gt;File&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;decode&lt;/span&gt;(styleFile);
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; docs = app.&lt;span class=&quot;hljs-property&quot;&gt;documents&lt;/span&gt;;

    &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (docs.&lt;span class=&quot;hljs-property&quot;&gt;length&lt;/span&gt; === &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;) {
        &lt;span class=&quot;hljs-title function_&quot;&gt;alert&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;No documents are currently open.&quot;&lt;/span&gt;);
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt;;
    }

    &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; i = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; i &amp;lt; docs.&lt;span class=&quot;hljs-property&quot;&gt;length&lt;/span&gt;; i++) {
        &lt;span class=&quot;hljs-keyword&quot;&gt;try&lt;/span&gt; {
            &lt;span class=&quot;hljs-comment&quot;&gt;// Paragraph + Character styles&lt;/span&gt;
            docs[i].&lt;span class=&quot;hljs-title function_&quot;&gt;importStyles&lt;/span&gt;(
                &lt;span class=&quot;hljs-title class_&quot;&gt;ImportFormat&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;PARAGRAPH_STYLES_FORMAT&lt;/span&gt;,
                tempFilePath,
                &lt;span class=&quot;hljs-title class_&quot;&gt;GlobalClashResolutionStrategy&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;LOAD_ALL_WITH_OVERWRITE&lt;/span&gt;
            );

            &lt;span class=&quot;hljs-comment&quot;&gt;// Table + Cell styles&lt;/span&gt;
            docs[i].&lt;span class=&quot;hljs-title function_&quot;&gt;importStyles&lt;/span&gt;(
                &lt;span class=&quot;hljs-title class_&quot;&gt;ImportFormat&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;TABLE_STYLES_FORMAT&lt;/span&gt;,
                tempFilePath,
                &lt;span class=&quot;hljs-title class_&quot;&gt;GlobalClashResolutionStrategy&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;LOAD_ALL_WITH_OVERWRITE&lt;/span&gt;
            );

            &lt;span class=&quot;hljs-comment&quot;&gt;// Object styles&lt;/span&gt;
            docs[i].&lt;span class=&quot;hljs-title function_&quot;&gt;importStyles&lt;/span&gt;(
                &lt;span class=&quot;hljs-title class_&quot;&gt;ImportFormat&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;OBJECT_STYLES_FORMAT&lt;/span&gt;,
                tempFilePath,
                &lt;span class=&quot;hljs-title class_&quot;&gt;GlobalClashResolutionStrategy&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;LOAD_ALL_WITH_OVERWRITE&lt;/span&gt;
            );

            &lt;span class=&quot;hljs-comment&quot;&gt;// Stroke styles&lt;/span&gt;
            docs[i].&lt;span class=&quot;hljs-title function_&quot;&gt;importStyles&lt;/span&gt;(
                &lt;span class=&quot;hljs-title class_&quot;&gt;ImportFormat&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;STROKE_STYLES_FORMAT&lt;/span&gt;,
                tempFilePath,
                &lt;span class=&quot;hljs-title class_&quot;&gt;GlobalClashResolutionStrategy&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;LOAD_ALL_WITH_OVERWRITE&lt;/span&gt;
            );

            &lt;span class=&quot;hljs-comment&quot;&gt;// TOC styles&lt;/span&gt;
            docs[i].&lt;span class=&quot;hljs-title function_&quot;&gt;importStyles&lt;/span&gt;(
                &lt;span class=&quot;hljs-title class_&quot;&gt;ImportFormat&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;TOC_STYLES_FORMAT&lt;/span&gt;,
                tempFilePath,
                &lt;span class=&quot;hljs-title class_&quot;&gt;GlobalClashResolutionStrategy&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;LOAD_ALL_WITH_OVERWRITE&lt;/span&gt;
            );

        } &lt;span class=&quot;hljs-keyword&quot;&gt;catch&lt;/span&gt; (e) {
            &lt;span class=&quot;hljs-title function_&quot;&gt;alert&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Error importing styles to document &quot;&lt;/span&gt; + docs[i].&lt;span class=&quot;hljs-property&quot;&gt;name&lt;/span&gt; + &lt;span class=&quot;hljs-string&quot;&gt;&quot;: &quot;&lt;/span&gt; + e.&lt;span class=&quot;hljs-property&quot;&gt;message&lt;/span&gt;);
        }
    }
}

&lt;span class=&quot;hljs-comment&quot;&gt;// Usage&lt;/span&gt;
&lt;span class=&quot;hljs-title function_&quot;&gt;applyStyles&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;/path/to/your/template.indt&quot;&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;4245&quot; data-start=&quot;4109&quot;&gt;This script reloads all major style categories—paragraph, character, table, object, stroke, and TOC styles—using a single template file.&lt;/p&gt;
&lt;p data-end=&quot;4355&quot; data-start=&quot;4247&quot;&gt;The key point is not the code itself, but the idea:&lt;br /&gt;
&lt;strong data-end=&quot;4355&quot; data-start=&quot;4299&quot;&gt;style normalization should be automatic, not manual.&lt;/strong&gt;&lt;/p&gt;
&lt;hr data-end=&quot;4360&quot; data-start=&quot;4357&quot; /&gt;
&lt;h2 data-end=&quot;4405&quot; data-start=&quot;4362&quot;&gt;What this looks like in real production&lt;/h2&gt;
&lt;p data-end=&quot;4497&quot; data-start=&quot;4407&quot;&gt;In practice, I run this as part of a larger automation package that also handles things like:&lt;/p&gt;

&lt;p data-end=&quot;4559&quot; data-start=&quot;4530&quot; style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Exporting IDMLs&lt;/li&gt;&lt;li&gt;Updating linked artwork&lt;/li&gt;&lt;li&gt;Reloading master pages&lt;/li&gt;&lt;li&gt;Normalizing document settings before translation&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;Those pieces belong in separate posts, but the principle is the same:&lt;/div&gt;&lt;div&gt;If a task must be done for every file and every language, it should not be done by hand.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you haven’t seen it yet, you may also want to read my previous post on automating one of the biggest layout bottlenecks in multilingual workflows:&lt;br data-end=&quot;280&quot; data-start=&quot;277&quot; /&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating.html&quot;&gt;Scaling Multilingual DTP by Eliminating Manual InDesign Text Overset Fixes&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content>
  </entry>

  <entry>
    <title>Scaling Multilingual DTP by Automating Trados-Ready IDML Export from InDesign Books</title>
    <id>https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating.html</id>
    <link href="https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-automating.html"/>
    <published>2026-01-11T22:54:00.000Z</published>
    <updated>2026-09-18T23:13:04.721Z</updated>
    <summary>Why IDML is required before translation If you work with Trados, you already know this: InDesign .indd files cannot be processed directly. They must be converted to .idml first. For a single document, that’s trivial. Press Ctrl+E , choose IDML…</summary>
    <content type="html">&lt;h2 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;Why IDML is required before translation&lt;/h2&gt;
&lt;p data-end=&quot;400&quot; data-start=&quot;257&quot;&gt;If you work with Trados, you already know this:&lt;br data-end=&quot;307&quot; data-start=&quot;304&quot; /&gt;
InDesign &lt;code data-end=&quot;323&quot; data-start=&quot;316&quot;&gt;.indd&lt;/code&gt; files cannot be processed directly. They must be converted to &lt;code data-end=&quot;393&quot; data-start=&quot;386&quot;&gt;.idml&lt;/code&gt; first.&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/01/scaling-multilingual-dtp-by-automating/01.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;An INDD file icon with an arrow pointing to an IDML file icon&quot; data-original-height=&quot;136&quot; data-original-width=&quot;326&quot; height=&quot;78&quot; src=&quot;/images/2026/01/scaling-multilingual-dtp-by-automating/01.png&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;For a single document, that’s trivial.&lt;p&gt;&lt;/p&gt;&lt;p data-end=&quot;494&quot; data-start=&quot;402&quot;&gt;
Press &lt;strong data-end=&quot;459&quot; data-start=&quot;449&quot;&gt;Ctrl+E&lt;/strong&gt;, choose &lt;strong data-end=&quot;476&quot; data-start=&quot;468&quot;&gt;IDML&lt;/strong&gt;, and you’re done.&lt;/p&gt;
&lt;p data-end=&quot;586&quot; data-start=&quot;496&quot;&gt;The problem starts when you receive an &lt;strong data-end=&quot;560&quot; data-start=&quot;535&quot;&gt;InDesign Book (.indb)&lt;/strong&gt; instead of a single file.&lt;/p&gt;
&lt;hr data-end=&quot;591&quot; data-start=&quot;588&quot; /&gt;
&lt;h3 data-end=&quot;643&quot; data-start=&quot;593&quot;&gt;Why InDesign Books turn this into a bottleneck&lt;/h3&gt;
&lt;p data-end=&quot;704&quot; data-start=&quot;645&quot;&gt;A Book file is just a container for multiple &lt;code data-end=&quot;697&quot; data-start=&quot;690&quot;&gt;.indd&lt;/code&gt; files.&lt;/p&gt;
&lt;p data-end=&quot;910&quot; data-start=&quot;706&quot;&gt;If a book contains 20 documents, you now have to repeat the same export process 20 times.&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;/images/2026/01/scaling-multilingual-dtp-by-automating/03.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;A book folder with a Links folder, demoBook.indb, and eight INDD files&quot; data-original-height=&quot;467&quot; data-original-width=&quot;223&quot; height=&quot;240&quot; src=&quot;/images/2026/01/scaling-multilingual-dtp-by-automating/03.png&quot; width=&quot;115&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br data-end=&quot;798&quot; data-start=&quot;795&quot; /&gt;
What used to take seconds becomes minutes — and in large multilingual projects, that happens for every language.&lt;p&gt;&lt;/p&gt;
&lt;p data-end=&quot;1002&quot; data-start=&quot;912&quot;&gt;This is where a simple file format requirement quietly turns into a production bottleneck.&lt;/p&gt;
&lt;hr data-end=&quot;1007&quot; data-start=&quot;1004&quot; /&gt;
&lt;h3 data-end=&quot;1045&quot; data-start=&quot;1009&quot;&gt;Why manual export does not scale&lt;/h3&gt;
&lt;p data-end=&quot;1133&quot; data-start=&quot;1047&quot;&gt;Once the number of files increases, a more dangerous problem appears: &lt;strong data-end=&quot;1132&quot; data-start=&quot;1117&quot;&gt;human error&lt;/strong&gt;.&lt;/p&gt;
&lt;ul data-end=&quot;1222&quot; data-start=&quot;1135&quot;&gt;
&lt;li data-end=&quot;1157&quot; data-start=&quot;1135&quot;&gt;
&lt;p data-end=&quot;1157&quot; data-start=&quot;1137&quot;&gt;One file forgotten&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1180&quot; data-start=&quot;1158&quot;&gt;
&lt;p data-end=&quot;1180&quot; data-start=&quot;1160&quot;&gt;One export skipped&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1222&quot; data-start=&quot;1181&quot;&gt;
&lt;p data-end=&quot;1222&quot; data-start=&quot;1183&quot;&gt;One outdated IDML sent to translation&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1318&quot; data-start=&quot;1224&quot;&gt;If you catch it early, you lose time.&lt;br data-end=&quot;1264&quot; data-start=&quot;1261&quot; /&gt;
If you notice it at delivery, you have a real problem.&lt;/p&gt;
&lt;p data-end=&quot;1428&quot; data-start=&quot;1320&quot;&gt;This isn’t a matter of being careful.&lt;br data-end=&quot;1360&quot; data-start=&quot;1357&quot; /&gt;
It’s a structural issue: &lt;strong data-end=&quot;1427&quot; data-start=&quot;1385&quot;&gt;repetitive manual work breaks at scale&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;1433&quot; data-start=&quot;1430&quot; /&gt;
&lt;h3 data-end=&quot;1462&quot; data-start=&quot;1435&quot;&gt;The automation approach&lt;/h3&gt;
&lt;p data-end=&quot;1538&quot; data-start=&quot;1464&quot;&gt;The fix is straightforward:&lt;br data-end=&quot;1494&quot; data-start=&quot;1491&quot; /&gt;
Let InDesign do the repetitive work for you.&lt;/p&gt;
&lt;p data-end=&quot;1682&quot; data-start=&quot;1540&quot;&gt;By using a script, you can export all open &lt;code data-end=&quot;1590&quot; data-start=&quot;1583&quot;&gt;.indd&lt;/code&gt; files to &lt;code data-end=&quot;1607&quot; data-start=&quot;1600&quot;&gt;.idml&lt;/code&gt; in one operation — consistently, repeatably, and without missing anything.&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/E_1dHUcLeIQ&quot; width=&quot;320&quot; youtube-src-id=&quot;E_1dHUcLeIQ&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;
&lt;hr data-end=&quot;1687&quot; data-start=&quot;1684&quot; /&gt;
&lt;h3 data-end=&quot;1716&quot; data-start=&quot;1689&quot;&gt;A simple example script&lt;/h3&gt;
&lt;p data-end=&quot;1873&quot; data-start=&quot;1718&quot;&gt;Here is a minimal version of the script I use in production.&lt;br data-end=&quot;1781&quot; data-start=&quot;1778&quot; /&gt;
It exports all open InDesign documents as IDML files into the same folders as the originals.&lt;/p&gt;
&lt;p data-end=&quot;1959&quot; data-start=&quot;1875&quot;&gt;The full script file is attached to this post.&lt;br data-end=&quot;1924&quot; data-start=&quot;1921&quot; /&gt;
License: MIT. Use at your own risk.&lt;/p&gt;
&lt;div&gt;&lt;div style=&quot;background: rgb(31, 41, 55); border-radius: 10px; border: 1px solid rgb(55, 65, 81); color: #f9fafb; margin: 20px 0px; padding: 18px;&quot;&gt;
  &lt;div style=&quot;color: #f9fafb; font-size: 18px; font-weight: 700; margin-bottom: 8px;&quot;&gt;
    Want the ready-to-use version?
  &lt;/div&gt;
  &lt;div style=&quot;color: #d1d5db; font-size: 15px; line-height: 1.6; margin-bottom: 14px;&quot;&gt;
    Skip the copy-paste and download the script directly from Gumroad.
  &lt;/div&gt;
  &lt;a href=&quot;https://linguistcoder.gumroad.com/l/export-IDML&quot; style=&quot;background: rgb(79, 70, 229); border-radius: 8px; color: white; display: inline-block; font-weight: 600; padding: 10px 16px; text-decoration: none;&quot;&gt;
    Download on Gumroad (Free) →
  &lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;3944&quot; data-start=&quot;1961&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-javascript&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;exportIDML&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;)
{
    &lt;span class=&quot;hljs-comment&quot;&gt;// Check if any documents are open&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (app.&lt;span class=&quot;hljs-property&quot;&gt;documents&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;length&lt;/span&gt; == &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;){
        &lt;span class=&quot;hljs-title function_&quot;&gt;alert&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;No documents to process&quot;&lt;/span&gt;);
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt;;
    }
    
    &lt;span class=&quot;hljs-comment&quot;&gt;// Confirmation dialog&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; result = &lt;span class=&quot;hljs-title function_&quot;&gt;confirm&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Export all open documents as IDML files?\n\nIDML files will be saved in the same location as the original documents.&quot;&lt;/span&gt;);
    
    &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (result == &lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;) {
        &lt;span class=&quot;hljs-title function_&quot;&gt;alert&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Process cancelled.&quot;&lt;/span&gt;);
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt;;
    }
    
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; docObj = app.&lt;span class=&quot;hljs-property&quot;&gt;documents&lt;/span&gt;;
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; successCount = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;;
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; failCount = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;;
    
    &lt;span class=&quot;hljs-comment&quot;&gt;// Process each document&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt;(&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; z=&lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; z&amp;lt;docObj.&lt;span class=&quot;hljs-property&quot;&gt;length&lt;/span&gt;; z++) {
        
        &lt;span class=&quot;hljs-comment&quot;&gt;// Skip unsaved documents&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (docObj[z].&lt;span class=&quot;hljs-property&quot;&gt;saved&lt;/span&gt; == &lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;) {
            &lt;span class=&quot;hljs-title function_&quot;&gt;alert&lt;/span&gt;(docObj[z].&lt;span class=&quot;hljs-property&quot;&gt;name&lt;/span&gt; + &lt;span class=&quot;hljs-string&quot;&gt;&quot;\n\nThis document has not been saved.\nPlease save the file before processing.&quot;&lt;/span&gt;);
            failCount++;
            &lt;span class=&quot;hljs-keyword&quot;&gt;continue&lt;/span&gt;;
        }
        
        &lt;span class=&quot;hljs-keyword&quot;&gt;try&lt;/span&gt; {
            &lt;span class=&quot;hljs-comment&quot;&gt;// Set object style default to &quot;None&quot;&lt;/span&gt;
            docObj[z].&lt;span class=&quot;hljs-property&quot;&gt;pageItemDefaults&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;appliedTextObjectStyle&lt;/span&gt; = docObj[z].&lt;span class=&quot;hljs-property&quot;&gt;objectStyles&lt;/span&gt;[&lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;];
            
            &lt;span class=&quot;hljs-comment&quot;&gt;// Get file path (save as .idml in the same location as original file)&lt;/span&gt;
            &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; originalPath = docObj[z].&lt;span class=&quot;hljs-property&quot;&gt;fullName&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;toString&lt;/span&gt;();
            &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; idmlPath = originalPath.&lt;span class=&quot;hljs-title function_&quot;&gt;replace&lt;/span&gt;(&lt;span class=&quot;hljs-regexp&quot;&gt;/\.indd$/i&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;.idml&quot;&lt;/span&gt;);
            
            &lt;span class=&quot;hljs-comment&quot;&gt;// Export as IDML file&lt;/span&gt;
            &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; exportFile = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;File&lt;/span&gt;(idmlPath);
            docObj[z].&lt;span class=&quot;hljs-title function_&quot;&gt;exportFile&lt;/span&gt;(&lt;span class=&quot;hljs-title class_&quot;&gt;ExportFormat&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;indesignMarkup&lt;/span&gt;, exportFile, &lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;);
            
            successCount++;
            
        } &lt;span class=&quot;hljs-keyword&quot;&gt;catch&lt;/span&gt;(e) {
            &lt;span class=&quot;hljs-comment&quot;&gt;// Display error details&lt;/span&gt;
            &lt;span class=&quot;hljs-title function_&quot;&gt;alert&lt;/span&gt;(docObj[z].&lt;span class=&quot;hljs-property&quot;&gt;name&lt;/span&gt; + &lt;span class=&quot;hljs-string&quot;&gt;&quot;\n\nExport failed.\n\nError details:\n&quot;&lt;/span&gt; + e.&lt;span class=&quot;hljs-property&quot;&gt;message&lt;/span&gt; + &lt;span class=&quot;hljs-string&quot;&gt;&quot;\nLine: &quot;&lt;/span&gt; + e.&lt;span class=&quot;hljs-property&quot;&gt;line&lt;/span&gt;);
            failCount++;
        }
    }
    
    &lt;span class=&quot;hljs-comment&quot;&gt;// Display process summary&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; summary = &lt;span class=&quot;hljs-string&quot;&gt;&quot;Process completed.\n\n&quot;&lt;/span&gt;;
    summary += &lt;span class=&quot;hljs-string&quot;&gt;&quot;Successful: &quot;&lt;/span&gt; + successCount + &lt;span class=&quot;hljs-string&quot;&gt;&quot; file(s)\n&quot;&lt;/span&gt;;
    &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (failCount &amp;gt; &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;) {
        summary += &lt;span class=&quot;hljs-string&quot;&gt;&quot;Failed: &quot;&lt;/span&gt; + failCount + &lt;span class=&quot;hljs-string&quot;&gt;&quot; file(s)&quot;&lt;/span&gt;;
    }
    &lt;span class=&quot;hljs-title function_&quot;&gt;alert&lt;/span&gt;(summary);
}

&lt;span class=&quot;hljs-comment&quot;&gt;// Run script&lt;/span&gt;
&lt;span class=&quot;hljs-title function_&quot;&gt;exportIDML&lt;/span&gt;();
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;4060&quot; data-start=&quot;3946&quot;&gt;This is intentionally simple.&lt;br data-end=&quot;3978&quot; data-start=&quot;3975&quot; /&gt;
It shows the core idea: &lt;strong data-end=&quot;4059&quot; data-start=&quot;4002&quot;&gt;remove humans from repetitive format-conversion tasks&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;4065&quot; data-start=&quot;4062&quot; /&gt;
&lt;h3 data-end=&quot;4110&quot; data-start=&quot;4067&quot;&gt;What this looks like in real production&lt;/h3&gt;
&lt;p data-end=&quot;4175&quot; data-start=&quot;4112&quot;&gt;In actual multilingual workflows, IDML export is only one step.&lt;/p&gt;
&lt;p data-end=&quot;4270&quot; data-start=&quot;4177&quot;&gt;In practice, I run this as part of a larger automation package that also handles things like:&lt;/p&gt;
&lt;ul data-end=&quot;4415&quot; data-start=&quot;4271&quot;&gt;
&lt;li data-end=&quot;4296&quot; data-start=&quot;4271&quot;&gt;
&lt;p data-end=&quot;4296&quot; data-start=&quot;4273&quot;&gt;Updating linked artwork&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4339&quot; data-start=&quot;4297&quot;&gt;
&lt;p data-end=&quot;4339&quot; data-start=&quot;4299&quot;&gt;Reloading paragraph and character styles&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4364&quot; data-start=&quot;4340&quot;&gt;
&lt;p data-end=&quot;4364&quot; data-start=&quot;4342&quot;&gt;Reloading master pages&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4415&quot; data-start=&quot;4365&quot;&gt;
&lt;p data-end=&quot;4415&quot; data-start=&quot;4367&quot;&gt;Normalizing document settings before translation&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;4581&quot; data-start=&quot;4417&quot;&gt;Those pieces belong in separate posts, but the principle is the same:&lt;br data-end=&quot;4489&quot; data-start=&quot;4486&quot; /&gt;
&lt;strong data-end=&quot;4581&quot; data-start=&quot;4489&quot;&gt;If a task must be done for every file and every language, it should not be done by hand.&lt;/strong&gt;&lt;/p&gt;&lt;p data-end=&quot;4581&quot; data-start=&quot;4417&quot;&gt;&lt;b&gt;If you haven’t seen it yet, check out our previous post on automating InDesign text overset:&lt;br /&gt;&lt;/b&gt;&lt;b&gt;→&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-eliminating.html&quot;&gt;Scaling Multilingual DTP by Eliminating Manual InDesign Text Overset Fixes&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2&gt;Related&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/09/why-idml-formatting-can-produce.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Why IDML Formatting Can Produce Translation Tags, and What to Check in InDesign&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/09/comparing-indesign-files-after.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Comparing InDesign Files After Translation: What to Check&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-maintenance.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Scaling Multilingual DTP – Maintenance / Recovery: When and How to Clean Up InDesign Files with IDML&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>

  <entry>
    <title>Scaling Multilingual DTP by Eliminating Manual InDesign Text Overset Fixes</title>
    <id>https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-eliminating.html</id>
    <link href="https://www.linguist-coder.com/2026/01/scaling-multilingual-dtp-by-eliminating.html"/>
    <published>2026-01-03T23:35:00.000Z</published>
    <updated>2026-04-10T22:19:43.333Z</updated>
    <summary>Update: Overset Fixer Pro is now available on aescripts. Now supports installation via aescripts Manager. Are you struggling with text overset after translation? If you work in multilingual publishing, you’ve probably run into this problem more times than you can…</summary>
    <content type="html">&lt;div&gt;&lt;blockquote&gt;Update:&amp;nbsp;&lt;span style=&quot;font-weight: normal;&quot;&gt;Overset Fixer Pro is now available on aescripts.&amp;nbsp;Now supports installation via aescripts Manager.&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Are you struggling with text overset after translation?&lt;/h2&gt;&lt;p data-end=&quot;284&quot; data-start=&quot;176&quot;&gt;If you work in multilingual publishing, you’ve probably run into this problem more times than you can count.&lt;/p&gt;&lt;p data-end=&quot;528&quot; data-start=&quot;286&quot;&gt;I’ve spent over a decade working across translation agencies and in-house manufacturing environments, using tools like Trados on a daily basis. One recurring bottleneck has always been post-translation DTP—especially text overset in InDesign.&lt;/p&gt;&lt;p data-end=&quot;773&quot; data-start=&quot;530&quot;&gt;When you translate from Japanese into English, or from English into languages like German or Russian, text expansion is almost inevitable. Layouts that worked perfectly in the source language suddenly break, and text starts overflowing frames.&lt;/p&gt;&lt;hr data-end=&quot;778&quot; data-start=&quot;775&quot; /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Why text overset becomes a real problem in multilingual layouts&lt;/h2&gt;&lt;p data-end=&quot;997&quot; data-start=&quot;849&quot;&gt;For main body text, overset can sometimes be mitigated by threading text frames and letting content flow into the next frame. That works to a point.&lt;/p&gt;&lt;p data-end=&quot;1030&quot; data-start=&quot;999&quot;&gt;Captions are a different story.&lt;/p&gt;&lt;p data-end=&quot;1320&quot; data-start=&quot;1032&quot;&gt;Captions usually live in fixed-size frames. They’re often positioned tightly near figures or diagrams, and they don’t have anywhere to flow. Even for main text, many projects require the translated layout to match the original layout exactly, which means manual adjustment is unavoidable.&lt;/p&gt;&lt;p data-end=&quot;1400&quot; data-start=&quot;1322&quot;&gt;Individually, these fixes feel trivial. Five minutes here, five minutes there.&lt;/p&gt;&lt;p data-end=&quot;1458&quot; data-start=&quot;1402&quot;&gt;But multilingual production changes the math completely.&lt;/p&gt;&lt;p data-end=&quot;1637&quot; data-start=&quot;1460&quot;&gt;A task that takes five minutes in one language turns into nearly two hours when you’re dealing with 20 languages. And that’s before reviews, corrections, or last-minute changes.&lt;/p&gt;&lt;p data-end=&quot;1701&quot; data-start=&quot;1639&quot;&gt;This is how small, “simple” tasks quietly consume entire days.&lt;/p&gt;&lt;hr data-end=&quot;1706&quot; data-start=&quot;1703&quot; /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Common workarounds — and their limitations&lt;/h2&gt;&lt;p data-end=&quot;1961&quot; data-start=&quot;1756&quot;&gt;One approach I’ve seen is to avoid translating captions altogether by converting them into numbered references. Instead of translating each caption, you translate a list of numbered descriptions elsewhere.&lt;/p&gt;&lt;p data-end=&quot;2001&quot; data-start=&quot;1963&quot;&gt;In theory, this reduces layout issues.&lt;/p&gt;&lt;p data-end=&quot;2043&quot; data-start=&quot;2003&quot;&gt;In practice, it introduces new problems:&lt;/p&gt;&lt;ul data-end=&quot;2190&quot; data-start=&quot;2044&quot;&gt;&lt;li data-end=&quot;2086&quot; data-start=&quot;2044&quot;&gt;&lt;p data-end=&quot;2086&quot; data-start=&quot;2046&quot;&gt;The document structure has to be changed&lt;/p&gt;&lt;/li&gt;&lt;li data-end=&quot;2126&quot; data-start=&quot;2087&quot;&gt;&lt;p data-end=&quot;2126&quot; data-start=&quot;2089&quot;&gt;Numbering mistakes become a real risk&lt;/p&gt;&lt;/li&gt;&lt;li data-end=&quot;2190&quot; data-start=&quot;2127&quot;&gt;&lt;p data-end=&quot;2190&quot; data-start=&quot;2129&quot;&gt;Many clients reject this approach due to readability concerns&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p data-end=&quot;2266&quot; data-start=&quot;2192&quot;&gt;For many projects, altering the document structure simply isn’t an option.&lt;/p&gt;&lt;hr data-end=&quot;2271&quot; data-start=&quot;2268&quot; /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Automating the problem instead of redesigning the document&lt;/h2&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe loading=&quot;lazy&quot; allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/bQKQJbl7tBE&quot; width=&quot;320&quot; youtube-src-id=&quot;bQKQJbl7tBE&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;p data-end=&quot;2464&quot; data-start=&quot;2337&quot;&gt;Rather than changing how documents are written, I chose a different approach: keep the document as-is and automate the cleanup.&lt;/p&gt;&lt;p data-end=&quot;2727&quot; data-start=&quot;2466&quot;&gt;I built a script that detects and resolves text overset directly in existing layouts, without requiring manual frame-by-frame adjustments. The goal wasn’t to create a “clever” solution, but a practical one—something that actually fits real production workflows.&lt;/p&gt;&lt;p data-end=&quot;2851&quot; data-start=&quot;2729&quot;&gt;If you’re dealing with overset text repeatedly across multiple languages, this kind of automation quickly pays for itself.&lt;/p&gt;&lt;p data-end=&quot;2851&quot; data-start=&quot;2729&quot;&gt;I refined &lt;b data-index-in-node=&quot;11&quot; data-path-to-node=&quot;5,0,1,0&quot;&gt;Overset Fixer Pro&lt;/b&gt; through real-world production challenges to ensure it’s reliable and efficient. If you’re looking to reclaim your time from repetitive manual fixes, this tool is built for you.&lt;/p&gt;&lt;p data-end=&quot;2851&quot; data-start=&quot;2729&quot;&gt;To make this approach actually usable in real workflows:&lt;/p&gt;

&lt;div style=&quot;background: rgb(31, 41, 55); border-radius: 10px; border: 1px solid rgb(55, 65, 81); color: #f9fafb; margin: 20px 0px; padding: 18px;&quot;&gt;
  &lt;div style=&quot;color: #f9fafb; font-size: 18px; font-weight: 700; margin-bottom: 8px;&quot;&gt;
    Automate overset fixes instead of handling them manually.
  &lt;/div&gt;
  &lt;div style=&quot;color: #d1d5db; font-size: 15px; line-height: 1.6; margin-bottom: 14px;&quot;&gt;
    Use the full version of Overset Fixer Pro with a streamlined installation process.&lt;br /&gt;
    Choose your preferred platform below.
  &lt;/div&gt;

  &lt;a href=&quot;https://aescripts.com/overset-fixer-pro/&quot; style=&quot;background: rgb(16, 185, 129); border-radius: 8px; color: white; display: inline-block; font-weight: 600; margin-right: 10px; padding: 10px 16px; text-decoration: none;&quot;&gt;
    Download on aescripts →
  &lt;/a&gt;

  &lt;a href=&quot;https://linguistcoder.gumroad.com/l/overset-fixer-pro&quot; style=&quot;background: rgb(79, 70, 229); border-radius: 8px; color: white; display: inline-block; font-weight: 600; padding: 10px 16px; text-decoration: none;&quot;&gt;
    Download on Gumroad →
  &lt;/a&gt;
&lt;/div&gt;  
  


&lt;hr data-end=&quot;2941&quot; data-start=&quot;2938&quot; /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Final note&lt;/h2&gt;&lt;p data-end=&quot;3080&quot; data-start=&quot;2959&quot;&gt;Text overset isn’t a skill issue. It’s a structural problem that appears whenever language expansion meets fixed layouts.&lt;/p&gt;&lt;p data-end=&quot;3191&quot; data-start=&quot;3082&quot;&gt;Once you look at it that way, automation stops being optional and starts becoming the only scalable solution.&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>When Times New Roman Suddenly Vanished from InDesign</title>
    <id>https://www.linguist-coder.com/2025/11/when-times-new-roman-suddenly-vanished.html</id>
    <link href="https://www.linguist-coder.com/2025/11/when-times-new-roman-suddenly-vanished.html"/>
    <published>2025-11-22T23:05:00.000Z</published>
    <updated>2025-11-22T23:05:53.096Z</updated>
    <summary>Recently at work, I ran into a strange and frustrating issue in Adobe InDesign : Times New Roman suddenly started appearing as an unsupported font. This happened completely out of the blue — the same documents had been fine just…</summary>
    <content type="html">&lt;p&gt;&amp;nbsp;Recently at work, I ran into a &lt;strong data-end=&quot;235&quot; data-start=&quot;184&quot;&gt;strange and frustrating issue in Adobe InDesign&lt;/strong&gt;:&lt;/p&gt;&lt;p data-end=&quot;412&quot; data-start=&quot;153&quot;&gt;
&lt;strong data-end=&quot;309&quot; data-start=&quot;239&quot;&gt;Times New Roman suddenly started appearing as an unsupported font.&lt;/strong&gt;&lt;br data-end=&quot;312&quot; data-start=&quot;309&quot; /&gt;
This happened completely out of the blue — the same documents had been fine just a few days earlier.&lt;/p&gt;
&lt;p data-end=&quot;653&quot; data-start=&quot;414&quot;&gt;After some trial and error, I came to suspect that this wasn’t an InDesign issue at all, but a &lt;strong data-end=&quot;218&quot; data-start=&quot;194&quot;&gt;Windows-side problem&lt;/strong&gt;. It seems that a recent Windows Update may have &lt;strong data-end=&quot;304&quot; data-start=&quot;267&quot;&gt;updated the Times New Roman files&lt;/strong&gt;, and as a result, &lt;strong data-end=&quot;396&quot; data-start=&quot;323&quot;&gt;InDesign was no longer able to recognize the updated version properly&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;916&quot; data-start=&quot;655&quot;&gt;&lt;b&gt;I even tried writing a script to automate the font replacement, but it didn’t help.&lt;/b&gt; Because the font name technically matched, InDesign didn’t treat it as something that could be substituted cleanly.&lt;/p&gt;&lt;p data-end=&quot;916&quot; data-start=&quot;655&quot;&gt;&lt;span data-end=&quot;916&quot; data-start=&quot;857&quot;&gt;At this point, the only reliable method is to fix the fonts manually — either &lt;b&gt;by using “Find/Replace Font” in InDesign or by updating the font settings in each paragraph or character style one by one&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;hr data-end=&quot;921&quot; data-start=&quot;918&quot; /&gt;
&lt;h2 data-end=&quot;965&quot; data-start=&quot;923&quot;&gt;&lt;strong data-end=&quot;965&quot; data-start=&quot;927&quot;&gt;A workaround for urgent situations&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;1017&quot; data-start=&quot;967&quot;&gt;One workaround did help when I needed a quick fix:&lt;/p&gt;
&lt;p data-end=&quot;1339&quot; data-start=&quot;1019&quot;&gt;If I had another InDesign project that had been &lt;strong data-end=&quot;1105&quot; data-start=&quot;1067&quot;&gt;packaged before the issue occurred&lt;/strong&gt;, the “Document fonts” folder often included &lt;strong data-end=&quot;1186&quot; data-start=&quot;1150&quot;&gt;older Times New Roman font files&lt;/strong&gt;.&lt;br data-end=&quot;1190&quot; data-start=&quot;1187&quot; /&gt;
By copying that folder and placing it in the same directory as the problematic INDD file, &lt;strong data-end=&quot;1339&quot; data-start=&quot;1280&quot;&gt;InDesign was able to display the fonts correctly again.&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;1546&quot; data-start=&quot;1341&quot;&gt;It’s not a fundamental solution, and it doesn’t address whatever is happening at the system level, but it’s a surprisingly effective emergency measure when the document needs to open correctly &lt;em data-end=&quot;1545&quot; data-start=&quot;1534&quot;&gt;right now&lt;/em&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;1551&quot; data-start=&quot;1548&quot; /&gt;
&lt;p data-end=&quot;1632&quot; data-start=&quot;1553&quot;&gt;&lt;span data-end=&quot;1632&quot; data-start=&quot;1553&quot;&gt;I hope this note helps anyone facing the same sudden Times New Roman issue.&lt;/span&gt;&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>Close All InDesign Files with One Click: A Script for Busy Designers</title>
    <id>https://www.linguist-coder.com/2025/06/close-all-indesign-files-with-one-click.html</id>
    <link href="https://www.linguist-coder.com/2025/06/close-all-indesign-files-with-one-click.html"/>
    <published>2025-06-29T01:00:00.000Z</published>
    <updated>2025-07-04T21:52:01.704Z</updated>
    <summary>As a technical writer and InDesign user, I often find myself working with a large number of open InDesign files at the same time. You might know the feeling—at the end of a busy day, you just want to close…</summary>
    <content type="html">&lt;p data-end=&quot;775&quot; data-start=&quot;530&quot;&gt;As a technical writer and InDesign user, I often find myself working with a large number of open InDesign files at the same time.&lt;br data-end=&quot;662&quot; data-start=&quot;659&quot; /&gt;
You might know the feeling—at the end of a busy day, you just want to close everything quickly and call it a day.&lt;/p&gt;&lt;p data-end=&quot;1020&quot; data-start=&quot;777&quot;&gt;Of course, you can always use &lt;strong data-end=&quot;817&quot; data-start=&quot;807&quot;&gt;Ctrl+Q&lt;/strong&gt; to quit InDesign entirely. But then, when you want to get back to work, you have to launch InDesign all over again, which can be a bit of a hassle, especially if you need to continue working right away.&lt;/p&gt;&lt;p data-end=&quot;1210&quot; data-start=&quot;1022&quot;&gt;That’s why I created this simple script. It allows you to &lt;strong data-end=&quot;1137&quot; data-start=&quot;1080&quot;&gt;close all open InDesign documents with a single click&lt;/strong&gt;—but it leaves InDesign itself running, so you can stay in your workflow.&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;When I shared this script with my colleagues, it got some surprisingly positive feedback!&lt;br data-end=&quot;1304&quot; data-start=&quot;1301&quot; /&gt;
It’s a small, handy tool, so I’ve decided to make it available to everyone for free.&lt;/p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;hr data-end=&quot;1867&quot; data-start=&quot;1864&quot; /&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;﻿&lt;span style=&quot;font-family: courier;&quot;&gt;#target indesign&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;try {&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; var docs = app.documents;&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; for (var i = docs.length - 1; i &amp;gt;= 0; i--) {&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var doc = docs[i];&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (doc.saved) {&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.close(SaveOptions.yes);&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Skip (do not close unsaved documents)&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;} catch (e) {&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; alert(e);&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;var flag = confirm(&quot;Do you want to close all open Books as well?&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;if (flag == true) {&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; while (app.books.length &amp;gt; 0) {&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; app.activeBook.close(SaveOptions.yes);&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;1388&quot; data-start=&quot;1212&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;hr data-end=&quot;1867&quot; data-start=&quot;1864&quot; /&gt;&lt;div&gt;&lt;strong data-end=&quot;1407&quot; data-start=&quot;1390&quot;&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong data-end=&quot;1407&quot; data-start=&quot;1390&quot;&gt;How it works:&lt;/strong&gt;&lt;/div&gt;&lt;ul data-end=&quot;1715&quot; data-start=&quot;1410&quot;&gt;
&lt;li data-end=&quot;1487&quot; data-start=&quot;1410&quot;&gt;
&lt;p data-end=&quot;1487&quot; data-start=&quot;1412&quot;&gt;The script closes all open InDesign documents that have already been saved.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1715&quot; data-start=&quot;1488&quot;&gt;
&lt;p data-end=&quot;1715&quot; data-start=&quot;1490&quot;&gt;If there are any unsaved documents—such as newly created files or files right after format conversion—they will be skipped (left open) to prevent accidental data loss.&lt;br data-end=&quot;1660&quot; data-start=&quot;1657&quot; /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em data-end=&quot;1715&quot; data-start=&quot;1678&quot;&gt;Please be aware of this limitation!&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;1862&quot; data-start=&quot;1717&quot;&gt;After closing the documents, the script will also ask if you want to close any open Books. If you confirm, all open Books will be closed as well.&lt;/p&gt;&lt;hr data-end=&quot;1867&quot; data-start=&quot;1864&quot; /&gt;&lt;h2 data-end=&quot;1891&quot; data-start=&quot;1869&quot;&gt;Tested Environment&lt;/h2&gt;&lt;p data-end=&quot;2151&quot; data-start=&quot;1893&quot;&gt;This script was tested with the &lt;strong data-end=&quot;1974&quot; data-start=&quot;1925&quot;&gt;Windows versions of InDesign CC 2023 and 2024&lt;/strong&gt;.&lt;br data-end=&quot;1978&quot; data-start=&quot;1975&quot; /&gt;
It should also work with other recent versions of InDesign, although I have not verified every version.&lt;br data-end=&quot;2084&quot; data-start=&quot;2081&quot; /&gt;
&lt;em data-end=&quot;2151&quot; data-start=&quot;2084&quot;&gt;I have not tested it on Mac OS, but it should work there as well.&lt;/em&gt;&lt;/p&gt;&lt;hr data-end=&quot;2156&quot; data-start=&quot;2153&quot; /&gt;&lt;h2 data-end=&quot;2172&quot; data-start=&quot;2158&quot;&gt;How to Use&lt;/h2&gt;&lt;ol data-end=&quot;2331&quot; data-start=&quot;2174&quot;&gt;
&lt;li data-end=&quot;2209&quot; data-start=&quot;2174&quot;&gt;
&lt;p data-end=&quot;2209&quot; data-start=&quot;2177&quot;&gt;Download the script (see below).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2260&quot; data-start=&quot;2210&quot;&gt;
&lt;p data-end=&quot;2260&quot; data-start=&quot;2213&quot;&gt;Place the file in your InDesign Scripts folder.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2331&quot; data-start=&quot;2261&quot;&gt;
&lt;p data-end=&quot;2331&quot; data-start=&quot;2264&quot;&gt;Double-click the script in the Scripts Panel in InDesign to run it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;hr data-end=&quot;2336&quot; data-start=&quot;2333&quot; /&gt;&lt;h2 data-end=&quot;2350&quot; data-start=&quot;2338&quot;&gt;Download&lt;/h2&gt;
&lt;p&gt;
  &lt;a href=&quot;https://drive.google.com/file/d/1EaA2nmHIzCU9CnPZyJoD7hvmmVHoL3I8/view?usp=sharing&quot; target=&quot;_blank&quot;&gt;
    Download the script here (closeAllDocsAndBooks_saved.jsx)
  &lt;/a&gt;
&lt;/p&gt;&lt;hr data-end=&quot;2429&quot; data-start=&quot;2426&quot; /&gt;&lt;h2 data-end=&quot;2445&quot; data-start=&quot;2431&quot;&gt;Final Note&lt;/h2&gt;&lt;p&gt;

















&lt;/p&gt;&lt;p data-end=&quot;2638&quot; data-start=&quot;2447&quot;&gt;I hope this little tool saves you some time!&amp;nbsp;&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>Rename Linked Files Easily in InDesign</title>
    <id>https://www.linguist-coder.com/2025/06/rename-linked-files-easily-in-indesign.html</id>
    <link href="https://www.linguist-coder.com/2025/06/rename-linked-files-easily-in-indesign.html"/>
    <published>2025-06-26T23:32:00.000Z</published>
    <updated>2025-06-26T23:36:44.513Z</updated>
    <summary>This post is about a paid script for Adobe InDesign. 1. Introduction Renaming linked images in Adobe InDesign can be tedious — especially when they appear in multiple documents. To solve that, I’ve created a small script that renames and…</summary>
    <content type="html">&lt;p style=&quot;text-align: left;&quot;&gt;This post is about a paid script for Adobe InDesign.&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;1. Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Renaming linked images in Adobe InDesign can be tedious — especially when they appear in multiple documents.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;To solve that, I’ve created a small script that renames and relinks files with just one prompt.&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;2. What the Script Does&lt;/h2&gt;&lt;p&gt;This script automatically:&lt;/p&gt;&lt;p&gt;- Renames the selected linked image file&lt;/p&gt;&lt;p&gt;- Updates all instances of the image across open documents&lt;/p&gt;&lt;p&gt;- Keeps folder structure and file formats intact&lt;/p&gt;&lt;p&gt;It’s designed to save time and reduce mistakes during layout editing.&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;3. When It’s Useful&lt;/h2&gt;&lt;p&gt;This tool is ideal for:&lt;/p&gt;&lt;p&gt;- Designers cleaning up image names before final delivery&lt;/p&gt;&lt;p&gt;- Working with reused layouts or multi-language versions&lt;/p&gt;&lt;p&gt;- Anyone who edits InDesign documents with linked assets regularly&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;4. How to Use It&lt;/h2&gt;&lt;p style=&quot;text-align: left;&quot;&gt;1. Open your InDesign file(s)&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;2. Select a linked image&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;3. Run the script&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;4. Enter a new name → Done!&lt;/p&gt;&lt;p&gt;The script will rename the file and update all links to it.&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;5. Try it now&lt;/h2&gt;&lt;p&gt;🔗 Get it here: &lt;a href=&quot;https://linguistcoder.gumroad.com/l/fmvyiq&quot;&gt;https://linguistcoder.gumroad.com/l/fmvyiq&lt;/a&gt;&lt;/p&gt;&lt;p&gt;💸 Price: $7&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;📂 File includes the script and README&lt;/p&gt;</content>
  </entry>

  <entry>
    <title>Automatically Replacing Helvetica Fonts in Adobe InDesign with a JavaScript Script</title>
    <id>https://www.linguist-coder.com/2024/03/automatically-replacing-helvetica-fonts.html</id>
    <link href="https://www.linguist-coder.com/2024/03/automatically-replacing-helvetica-fonts.html"/>
    <published>2024-03-30T21:44:00.000Z</published>
    <updated>2026-07-26T21:40:20.419Z</updated>
    <summary>Update — July 2026 Since this article was published, Adobe has added Helvetica and Helvetica Neue to Adobe Fonts. For paid Creative Cloud subscribers, activating the appropriate Helvetica family should now be the first option when opening documents with missing…</summary>
    <content type="html">&lt;aside aria-label=&quot;Article update&quot; role=&quot;note&quot; style=&quot;background: rgb(238, 248, 252); border-left: 6px solid rgb(22, 131, 182); border-radius: 4px; color: #17242b; font-family: Arial, Helvetica, sans-serif; line-height: 1.7; margin: 0px 0px 2rem; padding: 1.2rem 1.4rem;&quot;&gt;

  &lt;p style=&quot;color: #075f89; font-weight: 700; margin: 0px 0px 0.7rem;&quot;&gt;
    Update — July 2026
  &lt;/p&gt;

  &lt;p style=&quot;margin: 0px 0px 0.7rem;&quot;&gt;
    Since this article was published, Adobe has added Helvetica and Helvetica
    Neue to Adobe Fonts. For paid Creative Cloud subscribers, activating the
    appropriate Helvetica family should now be the first option when opening
    documents with missing Helvetica fonts.
  &lt;/p&gt;

  &lt;p style=&quot;margin: 0px;&quot;&gt;
    This does not restore support for legacy PostScript Type 1 font files, and
    older family or style names may not exactly match the current OpenType
    versions. The script below remains useful when intentionally migrating
    documents from Helvetica to Arial. Always check text reflow and overset text
    after replacement.
  &lt;/p&gt;

&lt;/aside&gt;
&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;As of January 2023, Type1 Helvetica fonts are no longer usable in Adobe InDesign...&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;This has been a headache for the company I work for.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;To mitigate this problem, I created a JavaScript script that automates the process of replacing Helvetica fonts with Arial fonts in Adobe InDesign documents.&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;#target indesign&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;(function () {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; // Helvetica → Arial mapping&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; var FONT_MAP = {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Helvetica\tMedium&quot;: &quot;Arial\tRegular&quot;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Helvetica\tBold&quot;: &quot;Arial\tBold&quot;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Helvetica\tBold Oblique&quot;: &quot;Arial\tBold Italic&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; if (app.documents.length === 0) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(&quot;No InDesign document is open.&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; /*&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* If multiple documents are open:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*&amp;nbsp; &amp;nbsp;OK&amp;nbsp; &amp;nbsp; &amp;nbsp;= process all open documents&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*&amp;nbsp; &amp;nbsp;Cancel = process only the active document&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; var documentsToProcess = [];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; if (app.documents.length &amp;gt; 1) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var processAll = confirm(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;More than one document is open.\r\r&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Click OK to process all open documents.\r&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Click Cancel to process only the active document.&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (processAll) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var i = 0; i &amp;lt; app.documents.length; i++) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; documentsToProcess.push(app.documents[i]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; documentsToProcess.push(app.activeDocument);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; } else {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; documentsToProcess.push(app.activeDocument);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; // Make sure that all replacement fonts are available before editing.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; var missingReplacementFonts = getMissingReplacementFonts();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; if (missingReplacementFonts.length &amp;gt; 0) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;The script cannot continue because the following replacement &quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;fonts are not available:\r\r&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; missingReplacementFonts.join(&quot;\r&quot;) +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;\r\rInstall or activate these fonts and run the script again.&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; var proceed = confirm(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;This script will replace selected Helvetica fonts with Arial in:\r\r&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getDocumentNames(documentsToProcess).join(&quot;\r&quot;) +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;\r\rThe documents will not be saved automatically.\r&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;It is recommended that you work on backup copies.\r\r&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Continue?&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; if (!proceed) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; app.doScript(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function () {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var result = {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; paragraphStylesChanged: 0,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; characterStylesChanged: 0,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; unsupportedHelveticaStyles: [],&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; errors: []&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var d = 0; d &amp;lt; documentsToProcess.length; d++) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; processDocument(documentsToProcess[d], result);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; showReport(result);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ScriptLanguage.JAVASCRIPT,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; undefined,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UndoModes.ENTIRE_SCRIPT,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Replace Helvetica styles with Arial&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; function processDocument(doc, result) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /*&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* These collections include styles inside style groups.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var paragraphStyles = doc.allParagraphStyles;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var characterStyles = doc.allCharacterStyles;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; processStyles(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; paragraphStyles,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Paragraph style&quot;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;paragraphStylesChanged&quot;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; processStyles(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; characterStyles,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Character style&quot;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;characterStylesChanged&quot;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; function processStyles(doc, styles, styleType, counterName, result) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var i = 0; i &amp;lt; styles.length; i++) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var style = styles[i];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!style.isValid) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var sourceFontName = getAppliedFontName(style);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // A blank value normally means that the style inherits its font.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (sourceFontName === &quot;&quot;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (FONT_MAP[sourceFontName]) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var replacementFont =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; app.fonts.itemByName(FONT_MAP[sourceFontName]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; style.appliedFont = replacementFont;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result[counterName]++;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else if (isHelveticaFont(sourceFontName)) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; addUnique(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.unsupportedHelveticaStyles,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.name + &quot; | &quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; styleType + &quot;: &quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getStylePath(style) + &quot; | &quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sourceFontName.replace(&quot;\t&quot;, &quot; — &quot;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (error) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.errors.push(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.name + &quot; | &quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; styleType + &quot;: &quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getStylePath(style) + &quot; | &quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; error.message&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; function getAppliedFontName(style) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var appliedFont = style.appliedFont;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; appliedFont === null ||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; appliedFont === undefined ||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; appliedFont === NothingEnum.NOTHING&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /*&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* appliedFont can return either a Font object or a string.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var fontName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (typeof appliedFont === &quot;string&quot;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fontName = appliedFont;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else if (appliedFont.isValid) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fontName = appliedFont.name;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /*&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* A Font object&apos;s name normally contains:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* family name + tab + style name.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* If only the family name is returned, append fontStyle.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (fontName.indexOf(&quot;\t&quot;) === -1) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var fontStyle = getFontStyleName(style);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (fontStyle !== &quot;&quot;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fontName += &quot;\t&quot; + fontStyle;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return fontName;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (error) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; function getFontStyleName(style) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var fontStyle = style.fontStyle;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fontStyle === null ||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fontStyle === undefined ||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fontStyle === NothingEnum.NOTHING&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return String(fontStyle);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (error) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; function isHelveticaFont(fontName) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fontName === &quot;Helvetica&quot; ||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fontName.indexOf(&quot;Helvetica\t&quot;) === 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; function getMissingReplacementFonts() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var missing = [];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var sourceFont in FONT_MAP) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!FONT_MAP.hasOwnProperty(sourceFont)) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var replacementName = FONT_MAP[sourceFont];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var replacementFont = app.fonts.itemByName(replacementName);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!replacementFont.isValid) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; addUnique(missing, replacementName.replace(&quot;\t&quot;, &quot; — &quot;));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return missing;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; function getStylePath(style) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var names = [style.name];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var parent = style.parent;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parent &amp;amp;&amp;amp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parent.isValid &amp;amp;&amp;amp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parent.constructor &amp;amp;&amp;amp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parent.constructor.name === &quot;ParagraphStyleGroup&quot; ||&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parent.constructor.name === &quot;CharacterStyleGroup&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; names.unshift(parent.name);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parent = parent.parent;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return names.join(&quot; &amp;gt; &quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; function getDocumentNames(documents) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var names = [];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var i = 0; i &amp;lt; documents.length; i++) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; names.push(documents[i].name);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return names;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; function addUnique(array, value) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var i = 0; i &amp;lt; array.length; i++) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (array[i] === value) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; array.push(value);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; function showReport(result) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var message =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Font replacement completed.\r\r&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Paragraph styles changed: &quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.paragraphStylesChanged + &quot;\r&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Character styles changed: &quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.characterStylesChanged;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (result.unsupportedHelveticaStyles.length &amp;gt; 0) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; message +=&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;\r\rHelvetica styles found but not replaced:\r&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.unsupportedHelveticaStyles.join(&quot;\r&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (result.errors.length &amp;gt; 0) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; message +=&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;\r\rErrors:\r&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.errors.join(&quot;\r&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; message +=&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;\r\rThe documents have not been saved automatically.&quot; +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;\rCheck text reflow and overset text before saving.&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(message);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;})();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;The script operates by checking if more than one document is open in Adobe InDesign and asking the user if they want to apply font changes to all open documents. Depending on the user’s choice, it then iterates through each document, replacing instances of Helvetica Medium, Helvetica Bold, and Helvetica Bold Oblique with their Arial counterparts.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</content>
  </entry>

</feed>
