Save & Export at same time

Adobe Community Professional ,
Apr 23, 2021 Apr 23, 2021

Copy link to clipboard

Copied

Looking for a way to have the document save and export to PDF at the same time. 

 

Basically, the modification date of both InDesign and PDF have to be identical for this set of projects. 

 

Looking to have a 1 step solution - maybe it's best to ask in the InDesign User Voice - a new command like Save & Export would be nice.

 

But if anyone knows a quick shortcut to have these 2 commands combined it would be welcomed. 

TOPICS
Feature request, Import and export, Print, Sync and storage

Views

118

Likes

Translate

Translate

Report

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
Enthusiast ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

Hello Eugene,

 

Below is a script with the 2 commands combined together.......it may need to be modified for any additional requirements you may have.

 

FYI, if you uncomment the last line it will close the document after it's done exporting the pdf.

var doc = app.documents[0];

var myFolder = doc.filePath;

var fileName = app.activeDocument.name.replace(/.indd$/i, "");

doc.save();

export_preset = app.pdfExportPresets.itemByName("[High Quality Print]");

app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES

doc.exportFile(ExportFormat.PDF_TYPE, File(myFolder +"/"+ fileName + ".pdf"), false, export_preset);

doc.save();

// app.activeDocument.close(SaveOptions.NO);

 

Regards,

Mike

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

If you use File>Package it gives you the option to set up how you want your pdf to be saved along with your InDesign file.

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

Thank you - but I need to keep a certain file structure. Packaging might work, worth looking at again.

 

Thanks

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

Just a note... Depending on the complexity of the InDesign file, it may not be possible to have identical times. It may take longer to process the PDF, giving it a different created/modified date (by minutes).

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

Hi Eugene, Could the save happen after the export is complete? That should give you matching modification dates. This worked with a file containing a 300mb image (Edit, basically the same as Mike’s script but with a PDF Preset list dialog):

 

 

 

var eFolder = Folder.selectDialog("Choose a folder for the PDF"); 
var pdfDropdown;
makeDialog();

function makeDialog(){
    var theDialog = app.dialogs.add({name:"Choose a Preset", canCancel:true});
    with(theDialog.dialogColumns.add()){
        pdfDropdown = dropdowns.add({stringList:getPresets(app.pdfExportPresets), selectedIndex:3, minWidth:80});
    }
    if(theDialog.show() == true){
        pdfDropdown = app.pdfExportPresets.item(pdfDropdown.selectedIndex);
        main();
        theDialog.destroy();
	}
}


/**
* Export to the chosen PDF preset and save 
*  void 
* 
*/
function main(){
    var doc = app.activeDocument;
    var fn = doc.name.replace(/\.[^\.]+$/, '')
    doc.exportFile(ExportFormat.pdfType, File(eFolder + "/" + fn + ".pdf"));
    doc.save();
}


/**
* Returns a list of item names from the provided collection 
*  the collection 
*  array of names 
* 
*/
function getPresets(p){
    var a = new Array;
    for(var i = 0; i < p.length; i++){
        a.push(p.item(i).name);
    }
    return a
}

 

 

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

Ok, great points everyone - and thank you for the scripts - I will definitely try them.

 

The queries have got me thinking - so thank you for taking the time and considerations.

 

Ideally the Modification dates for the InDesign file and the PDF:

InDesign file

07.10 am

 

PDF

07.11 am

 

But not the other way around - that is the PDF can be a little bit later than the InDesign file.

But the InDesign file cannot be 07.11 and the PDF 07.10 - as it doesn't offer proof of any changes after the PDF creation.

 

For what it's worth - the largest gap is ideally 2 minutes between InDesign and PDF (+2 minutes).

 

It's a very good point about large files and the time it would take the PDF to export. That also needs to be considered. But it takes as long as it takes and if it's 3 minutes I'll need to note that it is unavoidable. 

 

 

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

LATEST

Out of curiosity - how hard is it to have the PDF file name amend to say something like:

Filename_V1.pdf

 

Here's my issue:

The problem with this I'm finding is that once you have the file created and saved.

Export to PDF and amend the filename on export to Filename_V1.pdf

 

InDesign counts that as a change to the document

The steps are

- File>Save

- File>Export to PDF

--amend filename to _v1.pdf

 

Once InDesign has counted _v1.pdf change to the Export the InDesign document needs to be saved again.

 

I could save the file at 07.59 am, export it to PDF and that will be 07.59 am.

 

InDesign then requires me to resave the InDesign file after the export filename change. 

The InDesign file could now be 08.00 am and the PDF is 07.59 am.

And that's not allowed as the InDesign file is now saved after the PDF time (it would be ok if it was the other way around).

 

I save the InDesign file again - then re-export and overwrite the filename. 

 

This is why I'm asking really - I end up doing

File>Save - File>Export (alter file name)

- then InDesign needs to be saved again and export again.

 

It doubles the work. 

 

Usually this isn't a problem, but I have to deliver time-stamped files in a certain way. And just looking to shorten the process. 

 

Doubling the work and doing it manually can lead to errors.

 

Thanks 

 

 

 

 

Likes

Translate

Translate

Report

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