Skip to content

v2.7.1 - Fix illegal return error

Latest

Choose a tag to compare

@101sam 101sam released this 04 Feb 22:27

Bug Fixes

  • Fixed "Illegal 'return' outside of a function body" error that occurred in InDesign 2024+
  • Wrapped entire script in self-executing function (IIFE) to allow proper early returns
  • Removed all exit() calls which cause engine deletion errors

Technical Details

This is a structural fix only - no functionality was changed. The entire script is now wrapped in a self-executing function (function() { ... })(); which allows return statements to work correctly.

Installation

Download MultiPageImporter.jsx and place it in your InDesign Scripts folder:

  • macOS: ~/Library/Preferences/Adobe InDesign/Version XX.0/en_US/Scripts/Scripts Panel/
  • Windows: C:\Users\[username]\AppData\Roaming\Adobe\InDesign\Version XX.0\en_US\Scripts\Scripts Panel\