Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Indesign export JPEG script with control of suffix

Community Beginner ,
Jan 08, 2025 Jan 08, 2025

How can I write a JavaScript script for InDesign to export JPEGs while ensuring that any leftover text in the "Suffix" field from previous exports (e.g., "_^P" left after exporting pages) is cleared or replaced?

Screenshot 2025-01-08 at 09.49.46.png

 

Currently, when I use an export script, it adds "_01" to every image due to this leftover input.

 

Is there a way to access and modify the value in the "Suffix" field through the script?

 

Any help will be appreciated.

 

TOPICS
How to , Import and export , Scripting
364
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 08, 2025 Jan 08, 2025

Use an object-model viewer, e.g. https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html

 

There you'll find the jpegExportPreferences property, which in turn has the jpegSuffix property. To nuke an existing string, do this:

 

app.jpegExportPreferences.jpegSuffix = '';
Translate
Community Expert ,
Jan 08, 2025 Jan 08, 2025

Use an object-model viewer, e.g. https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html

 

There you'll find the jpegExportPreferences property, which in turn has the jpegSuffix property. To nuke an existing string, do this:

 

app.jpegExportPreferences.jpegSuffix = '';
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 08, 2025 Jan 08, 2025

Brilliant, this worked. Thanks for the link also, my searching lead me to here https://developer.adobe.com/indesign/dom/api/j/JPEGExportPreference/  where it did'nt have this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 08, 2025 Jan 08, 2025
LATEST

The page you saw is for UXP, the one I sent you is for ExtendScript. Strange though that jpegSuffix is missing on that page. It seems unlikely that UXP doesn't have that property.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines