Skip to content

Instantly share code, notes, and snippets.

@circleb
circleb / ImportVariables.jsx
Created September 16, 2020 20:28
Bulk Import Text Variables into InDesign
/* ***************************************************************** */
/* Compiled: 09.16.2020 by Ben Owen for 1torial.com
/* Tested in InDesign 2020 (15.1.1)
/* ben@benowen.net
/* 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,"
@circleb
circleb / docx2html
Last active August 29, 2015 14:21 — forked from jackreichert/document.xml
// 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()){