Skip to main content
Inspiring
December 2, 2024
Answered

How to Export INDD File to New INDD File in UXP

  • December 2, 2024
  • 3 replies
  • 781 views

I am writing a UXP script that grabs INDD files in bulk and makes some changes in the file and saves off the file to a different file location. I do not want to impact the original file. Instead, I want to save it as a new file in a new location. Does anyone know if this is possible in UXP scripting? I know you can export to PDF, which I have done before. But is it possible to export from one indd to another indd in a different location? 

const update = async(inDesignFiles, destinationFolder) => {
    for (const file of inDesignFiles) {
        await app.open(file.nativePath);
        const activeDocument = app.activeDocument;
        // add more changes here to the file
        activeDocument.exportFile( ??? );

      }
}
This topic has been closed for replies.
Correct answer Robert at ID-Tasker

@MahmoodTheDoom

 

As others pointed out - you SAVE in native format of the application - you EXPORT to other formats.

 

3 replies

Robert at ID-Tasker
Robert at ID-TaskerCorrect answer
Legend
December 2, 2024

@MahmoodTheDoom

 

As others pointed out - you SAVE in native format of the application - you EXPORT to other formats.

 

Inspiring
December 3, 2024

Thanks, that makes sense 🙂 

John D Herzog
Inspiring
December 2, 2024

You will want activeDocument.save(File to, Boolean stationery, String versionComments, Boolean forceSave).

Inspiring
December 3, 2024

Awesome, thanks for the guidance. 

Robert at ID-Tasker
Legend
December 3, 2024
quote

Awesome, thanks for the guidance. One follow up, should I add the name of the new file as part of the file path in the to parameter? 


By @MahmoodTheDoom

 

You should supply path and full name. 

 

Peter Kahrel
Community Expert
Community Expert
December 2, 2024

You can save a document using a different name. Use activeDocument.save (newfilename)