Skip to content

cwhit-io/jsx-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adobe CC ExtendScript Automation Scripts

A professional collection of Adobe Creative Cloud automation scripts written in ExtendScript (.jsx) — the ES3-based scripting language built into Adobe InDesign, Illustrator, Photoshop, and other CC applications.


Repository Structure

jsx-scripts/
├── .vscode/
│   └── settings.json        # Workspace settings for ExtendScript in VS Code
├── src/
│   ├── indesign/            # InDesign-specific scripts
│   │   ├── Boilerplate.jsx  # Starter template for new InDesign scripts
│   │   └── ExportPDFs.jsx   # Batch-export open documents as PDFs
│   ├── illustrator/         # Illustrator-specific scripts (add yours here)
│   └── shared/              # Cross-app utilities
│       └── utils.jsx        # Logging (writeLog) and helper (getScriptFolder)
├── .eslintrc.json           # ESLint config — enforces ES3 / ExtendScript rules
├── jsconfig.json            # VS Code IntelliSense for Adobe types
├── package.json             # Dev dependencies (eslint, types-for-adobe)
├── .gitignore
└── README.md

For End-Users: Installing Scripts into Adobe InDesign

These .jsx files can be run directly from InDesign's Scripts Panel. Follow these steps to install them permanently:

  1. Open the Scripts Panel in InDesign: Window → Utilities → Scripts

  2. Reveal the User Scripts folder on disk:

    • In the Scripts Panel, right-click (Windows) or Control-click (macOS) the User folder.
    • Select Reveal in Explorer (Windows) or Reveal in Finder (macOS).
    • This opens the folder: .../Adobe InDesign/Scripts/Scripts Panel/
  3. Copy the script files from this repository into that folder:

    • You can copy individual .jsx files, or create a sub-folder (e.g. My Scripts/) and drop them inside.
    • Example: copy src/indesign/ExportPDFs.jsx into the Scripts Panel folder.
  4. Run a script — it now appears in the Scripts Panel. Double-click it to execute.

Tip: You can also run any .jsx file on-the-fly via File → Scripts → Browse… in InDesign without permanently installing it.


For Developers: Setting Up the Dev Environment

The dev tooling provides ES3 linting and Adobe API autocomplete inside VS Code.

Prerequisites

Setup

# 1. Clone the repository
git clone https://github.com/cwhit-io/jsx-scripts.git
cd jsx-scripts

# 2. Install dev dependencies (types-for-adobe + eslint)
npm install

After running npm install, VS Code will automatically use the types-for-adobe type definitions specified in jsconfig.json. You will get IntelliSense for objects like app.documents, app.activeDocument, TextFrame, etc.

Linting

# Lint all .jsx source files
npm run lint

The .eslintrc.json is configured to enforce ES3-compatible code — it will warn or error if you accidentally use let, const, arrow functions, template literals, or other modern JS features that are not supported by ExtendScript.


ExtendScript Coding Conventions

All .jsx files in this repository follow these rules to stay ES3-compliant and safe:

Rule Correct Avoid
Variable declarations var x = 1; let x = 1; / const x = 1;
Functions function foo() {} or var foo = function() {} Arrow functions () => {}
Strings "hello " + name Template literals `hello ${name}`
Scope protection Wrap scripts in an IIFE (function(){ ... })(); Top-level code
Shared code Namespace objects var MyUtils = { ... } ES6 modules / import / export

Available Scripts

src/shared/utils.jsx

Shared utilities included by other scripts via #include:

  • MyUtils.writeLog(message) — Appends a timestamped entry to ~/Desktop/adobe-scripts.log.
  • MyUtils.getScriptFolder() — Returns the Folder of the currently running script.

src/indesign/Boilerplate.jsx

A minimal starter script. Checks whether a document is open and logs the document name. Use this as a template when writing new InDesign scripts.

src/indesign/ExportPDFs.jsx

Batch-exports all currently open InDesign documents as press-quality PDFs to a user-selected folder.


Contributing

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/my-new-script
  3. Write your script in the appropriate src/<app>/ folder, following the ES3 conventions above.
  4. Run npm run lint to validate your code.
  5. Open a Pull Request.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors