Skip to main content
Known Participant
March 14, 2022
Answered

Saving two versions of pdf in a new folder script

  • March 14, 2022
  • 1 reply
  • 810 views

Hey all, 

I've searched around and found a few things but nothing that caters completely, apologies if I missed it though. Not familiar with writing scripts at all so would be very grateful for help with this.

 

I'm looking to save a pdf with two versions, one as a standard pdf and the second with 'preserve illustrator capabilities turned off'. I foundpDFSaveOptions.preserveEditability false whilst looking through for solutions.

 

The files would need to be saved in a new folder 'project title - client name' created within a specific folder and the files named 'project title_mockup.pdf' and 'project title_send_mockup.pdf'

 

Is there a way to achieve this with prompts to input the file/folder name? or would this be difficult due to only needing the first part 'project title' of the folder name in the file name?

Many thanks,

This topic has been closed for replies.
Correct answer Disposition_Dev

var projectTitle = prompt("Please enter the 'project title - client name':","default text") ; //no extension

 

var pdfSaveSettingsA = newPDFSaveOptions();

//input your settings here

var pdfSaveSettingsB = newPDFSaveOptions();

//input your secondary pdf save settings here

 

var outputFilePath = "/Path/To/Folder/"

var pdfAFileName = projectTitle + "_mockup.pdf";

var pdfBFileName = projectTitle + "_send_mockup.pdf";

 

//output pdf A

app.activeDocument.saveAs(File(outputFilePath + pdfAFileName),pdfSaveSettingsA);

//output pdf B

app.activeDocument.saveAs(File(outputFilePath + pdfBFileName),pdfSaveSettingsB);

1 reply

Disposition_Dev
Disposition_DevCorrect answer
Legend
March 14, 2022

var projectTitle = prompt("Please enter the 'project title - client name':","default text") ; //no extension

 

var pdfSaveSettingsA = newPDFSaveOptions();

//input your settings here

var pdfSaveSettingsB = newPDFSaveOptions();

//input your secondary pdf save settings here

 

var outputFilePath = "/Path/To/Folder/"

var pdfAFileName = projectTitle + "_mockup.pdf";

var pdfBFileName = projectTitle + "_send_mockup.pdf";

 

//output pdf A

app.activeDocument.saveAs(File(outputFilePath + pdfAFileName),pdfSaveSettingsA);

//output pdf B

app.activeDocument.saveAs(File(outputFilePath + pdfBFileName),pdfSaveSettingsB);

Known Participant
March 16, 2022

Thank you very much! It's really appriciated!

Definitely my bad but the files are exporting as an .ai with none of the pdf settings applied, I'll do some more attempts to see where I'm going wrong.

Disposition_Dev
Legend
March 16, 2022

woops. i'm a dingus. i forgot to actually USE the the pdf save options we setup. I'll edit the comment.