This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ***************************************************************** */ | |
/* Compiled: 09.16.2020 by Ben Owen for 1torial.com | |
/* Tested in InDesign 2020 (15.1.1) | |
/* [email protected] | |
/* Most of the code came from the InDesign script FindChangeByList.jsx | |
/* and the function setCustomTextVariable() by Jon S. Winters. | |
/* | |
/* DESCRIPTION | |
/* This script allows you to import a simple text file containing a | |
/* text variable list and registers them as "Custom Text Variables," |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set location of docx text content file | |
$xmlFile = $targetDir."/word/document.xml"; | |
$reader = new XMLReader; | |
$reader->open($xmlFile); | |
// set up variables for formatting | |
$text = ''; $formatting['bold'] = 'closed'; $formatting['italic'] = 'closed'; $formatting['underline'] = 'closed'; $formatting['header'] = 0; | |
// loop through docx xml dom | |
while ($reader->read()){ |