Copy link to clipboard
Copied
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?
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.
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 = '';
Copy link to clipboard
Copied
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 = '';
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now