Notice: The
/testssubdirectory is not part of IdExtenso's core distribution. It provides basic examples and case studies for newcomers to get started with the framework.
From this location, any .jsx script can include the core framework using:
#include '../$$.jsxinc'Extra modules (which always belong to /etc) are selectively added using:
#include '../etc/<ModuleName>.jsxlib'
⚠️ Important: Core framework must be included before any extra modules.
| Script | Description | Key Features |
|---|---|---|
| AppToJson | Stringify app.properties | JSON handling, file operations |
| BasicScriptDemo | PathNodes script demo | UI, localization, settings |
| BasicScriptMenuDemo | Menu-enabled PathNodes | Menu extension, persistence |
| ByteStreamDemo | ByteStream class usage | Binary data handling |
| CheckIEEE754 | IEEE754 number validation | Number conversion, benchmarks |
| CollatorTester | Collator module testing | Text collation, multilingual |
| DomTextParcelsTest | TextParcels class demo | DOM manipulation, progress bars |
| EnvSummary | Environment reporting | System info, context detection |
| GetWebImage | Web image download | HTTP requests, ScriptUI |
| GetWebText | Web text download | HTTP/HTTPS, text processing |
| InstantDialog | DOM dialog creation | XML dialogs, localization |
| LevenFilterList | Dynamic list filtering | String algorithms, UI events |
| MarkovShuffle | Text scrambling | Markov chains, randomization |
| MenuAccess | Menu component access | DOM navigation, menu paths |
| MenuCamelCase | Custom menu action | Menu installation, event handling |
| PageRangeTester | Page range parsing | Range validation, formatting |
| ParseIntFix | parseInt bug fixes | ExtendScript patches |
| PlaceWebImage | Web image placement | HTTP, file handling, DOM |
| PlayWithBigInt | Arbitrary precision math | BigInt operations, algorithms |
| PlayWithUnit | Unit conversion | Measurement units, i18n |
| RectPackTest | Rectangle packing | Layout algorithms, geometry |
| RegexFromCodeRanges | Unicode regex building | Character ranges, regex patterns |
| ScriptUIBuilder | UI construction | Component factories, widgets |
| ScriptUIColorTester | UI color testing | Color management, themes |
| ShowEnvironment | Environment display | System diagnostics |
| ShowHelp | API documentation | Module introspection |
| SuiFactories | ScriptUI components | Custom widgets, factories |
| UnicodeToAscii | Text transliteration | Unicode conversion |
| UseJsxBlindLib | Script obfuscation | Binary scrambling |
| YaltIsGreat | Localization demo | Multi-language support |
| ZDeflate_ZInflate_Test | Zip/unzip checker | Data compression, validation |
Stringify the entire contents of
app.properties.
Demonstrates:
$$.JSON.lave()routine (just calling$$.JSON(), as this is theautomethod)- Some nice options behind it (verbose vs. compact format…)
$$.File.temp()to output the result in a temp file (and open it)
Manage a complete InDesign script (PathNodes) that creates custom circles at each path point of target item(s).
Demonstrates:
- Usage of BasicScript module (settings, localization, UI)
- Providing a Yalt package in four languages (
EN+FRDEES) - Settings keys with various lifespans (
RESET,SESSION,APP)
With just a few additional lines, the previous script "PathNodes" is extended into a BasicScriptMenu, that is, a
BasicScriptcomponent with aMenuExtension.
Demonstrates:
- Usage of BasicScriptMenu module (settings, localization, UI + MenuExtension)
- Providing a Yalt package in four languages (
EN+FRDEES) - Settings keys with various lifespans (
RESET,SESSION,APP)
Getting started with the
$$.ByteStreamclass.
Demonstrates:
- ByteStream constructor (both modes)
- I/O methods and various tests with number and string tags
Perform tests on
Number.fromIEEE754()andNumber.prototype.toIEEE754()functions. This script generates 10,000 random numbers in IEEE754 64bit format and check whether the dedicated routines properly handle them. We used it to benchmark and validate the implementation offromIEEE754()andtoIEEE754(). Cool thing is, the script double-checks each conversion throughout theTransformationMatrixobject, which provides a hidden way to encode a Number instance into IEEE754 form. See the code for details.
Demonstrates:
- Using
Number.fromIEEE754(hex)andNumber.prototype.toIEEE754() - Getting IEEE754 representation from
TransformationMatrix's name property (personal hack) - Using the
Randomclass to generate random numbers
Experiment IdExtenso's Collator module in various languages.
Demonstrates:
- Using the
Collatormodule - Adding a custom YALT package (
EN+FRDEESITRU) - Simple modal dialog interface generated by
ScriptUI.builder
Lifts the veil on the intimidating $$.Dom.TextParcels class.
Demonstrates:
- Calling the
error()function - Using a simple progress bar (via
$$.Progress) - Creating a
TextParcels(in short TP) instance with default options - Running
TP.consolidate(), thenTP.getSamples()handled by a custom function - Using the Log to collect data (
Log.push)
EnvSummary.jsx vs. EnvSummary.bin.jsx
Report scripting context from the Env module.
Demonstrates:
- Usage of
$$.Env.domVersion(), alias:$$.domVersion() - Usage of
$$.Env.summary(), alias:$$.Env() - Main script and Running code status (JSX vs. JSXBIN), see
EnvSummary.bin.jsxfor additional information - Log in TRACE mode
Download a PNG through
httpand load it in a ScriptUI dialog.
The user can now click the image to open the URL in the navigator!
Demonstrates:
$$.Web(url), shortcut of$$.Web.get(url)- Using
toSource()with binary strings is more compact w/ IdExtenso - Tracing steps thru
$$.trace(), and more details on Log levels - [190322] Use ScriptUI.builder(); call
$$.Web.browse()on click
Download a text through
http(s). Result is shown either in the active selection (if any) or in trace console.
Demonstrates:
$$.Web(url, 1)withwantTextoption turned on
InDesign DOM dialog fast, easy, and with automatic localization.
Demonstrates:
- Usage of
$$.Dom.Dialog.fromXML() - Displaying the dialog and having strings localized through Yalt
- Access to UI values using
Dialog.setValueKey()andDialog.getValueKey()(augmented prototype) - Using
$$.isBooting()to prepend persistent data (makes sense when a#targetenginedirective is in use)
Dynamic listbox filter based on Levenshteim distance.
Demonstrates:
- Using
String.levenFilter() - Using
ScriptUI.builder()with event handlers
Text scrambler based on Markov chains.
Demonstrates:
- Using the Markov module for the purpose of scrambling texts in InDesign
- Including the Random module (to improve random functions)
📖 Cf. Full article and demo
Accessing existing menu components (menus, submenus, or menuitems).
Demonstrates:
- Testing the Dom.Menu.get() routine on various paths like
[ 0, '', '$ID/EditMenu_FindChange' ],[ '$ID/Main', 0, '$ID/Open...' ], etc.
Full example of installing a custom "Change Case > CamelCase" menu action.
Demonstrates:
- Using advanced Dom.Menu features
- Dealing with engine-persistent script and processing DOM events accordingly via
$$.globalEvent() - Declaring a custom module using the
eval(__(MODULE, $$, ...))macro-syntax
Parse, format and normalize page ranges.
Demonstrates:
- Inclusion and usage of
$$.PageRange - Simple modal dialog interface generated by
ScriptUI.builder
Run some tests on
$.global.parseIntonce patched by IdExtenso. (More detail here.)
Demonstrates:
- Fixing a native ExtendScript bug in the
[[global]]scope - Using
$$.trace
Download an image through
httpand place it in the active spread. (This script is a variant of GetWebImage.)
Demonstrates:
$$.Web(url), shortcut of$$.Web.get(url)- Using
$$.Web.parseURIto identify the parts of an URL - Using
$$.File.tempto create a temporary file
Compute (arbitrary-precision) big integers using the BigInt module.
Demonstrates:
- Including an optional module (from
/etc) - Various ways of declaring
BigIntinstances - Using operators:
==,<,<=,+,-,*,/,%,<<,>>,~,&,|,^ - Divide-and-Remainder method, primality
- Finding a huge prime number
Use a consistent facade for handling metrical units.
Demonstrates:
- Optional module inclusion
- Usage of
$$.Dom.Dialog() - Basic internationalization (decimal point, etc.)
- Experimenting the Unit API:
info(),parse(),convertNumber(),format()
Simple rectangle packing (without rotation) on the active spread. (Undoable.)
Demonstrates:
- Using the
RectPackmodule (etcbranch) - Invoking the
error()function
A useful static routine available in the
RegExpobject.
Demonstrates:
- Converting a set of code ranges into a RegExp pattern
- Limitations (surrogate pairs must be consistent, i.e share the same base)
- Producing a regex that captures misc. symbols and pictographs (from U+1F300 to U+1F5FF)
Build a powerful ScriptUI interface with no effort.
Demonstrates:
- Using the static
ScriptUI.builder()function - Example of a 'resource object' with various widgets
- Implementing a custom component thru a 'factory'
Test the ScriptUI/colors snippet.
Demonstrates:
- Creation of random background colors
- Color assignment via
0xRRGGBB(hex) orX|Ydescriptors (normal and disabled state) - Retrieving a color descriptor from
ScriptUI.colorGetter - Usage of
ScriptUI.builder()with color keys
Simply displays the
$$.Env.summary()string in a box. This (minimal) test script can be executed in various locales, versions, systems and contexts to illustrate the many informations the$$.Envmodule can handle.
Platform Examples:
Example 1: The script is in JSXBIN form and executed in macOS 10.13 / InDesign CC 15.1 (dark UI) for the 4th time (run #4) in the 'main' engine (non-persistent). DOM version in-sync with InDesign version (15.1), user is admin, locale is FRENCH/fr_FR:
Example 2: The script is in regular JSX form and executed in Windows 10/64 from InDesign CC 16.1 (dark UI) for the 1st time (run #1) in a persistent ('myScript') engine. Furthermore, it is executed as a startup script now (feature available from IdExtenso 2.10403). DOM version in-sync with InDesign version (15.1), user is Moi, locale is ENGLISH/en_US:
Demonstrates:
$$.Env()— alias of$$.Env.summary()
Get help on core and included modules.
Demonstrates:
$$.help(); this method scans all present modules and displays the resulting API in a modal dialog
ScriptUI Component Factory Demos
This subfolder provides basic demo scripts showing the behaviors and features of custom ScriptUI components available in etc/ScriptUI/factories:
-
TestCheck.jsx— VariousCheck(Factory)components (custom checkboxes) -
TestCheckGroup.jsx—CheckGroup(Factory)(consistent set of checkboxes) -
TestCheckList.jsx—CheckList(Factory)(hierarchical checklist) +Popup -
TestDrawnCheck.jsx— VariousDrawnCheck(Factory)icons
-
TestColorPalette.jsx—ColorPalette(Factory)(hidden palette in stack container) -
TestEditAndStepper.jsx—Edit(Factory),EditInteger(Factory)andStepper(Factory)components
-
TestPopup.jsx—Popup(Factory)component with mouse-over messages -
TestSideMenu.jsx—SideMenu(Factory)component +Popup
Basic Unicode-to-ASCII transliteration.
Demonstrates:
- Including and using the
$$.UniAscmodule - Live-testing the
translit()method from a ScriptUI dialog made up fromScriptUI.builder()
Scramble a jsxbin file choosen by the user.
Demonstrates:
- Including and invoking the new JsxBlindLib library from any script project
Basic features of the localization module (Yalt).
Demonstrates:
- Including an optional module (from
/etc) - Adding a localization package of your own
- Using the
__()function with a Yalt string - Activating another locale
- Inserting a placeholder in a translation string
Quick test of the compression and decompression modules (ZDeflate and ZInflate).
Demonstrates:
- Including compression modules from
/etc(ZDeflate and ZInflate) - Testing
zip()andunZip()on either a long byte string or a File - Data validation: check that the final uncompressed stream is strictly equal to the input
- Timing measurements for each test case (internal methods vs. external InDesign packager/unpackager.)
- Pushing messages in the Log system, error handling, etc.
- Choose a script from the table above based on your needs
- Navigate directly using the anchor links
- Read the description and examine the demonstrations
- Run the script in Adobe InDesign to see it in action
- Study the code to understand the implementation
Tip: Start with simpler scripts like
AppToJsonorShowEnvironmentbefore moving to complex ones likeMenuCamelCaseorZDeflate_ZInflate_Test.
Happy scripting with IdExtenso!
























