Highlighted

Batch Save and Change RGB to CMYK?

Advocate ,
Sep 30, 2020

Copy link to clipboard

Copied

Is there a script somewhere that will allow me to batch save (PDF) every open tab? And change any file that is RGB color space to CMYK? If i have to I'll combine scripts together for this. I did see a few scripts that were supposed to batch save the AI files into PDF however they were not working on CC2020

Adobe Community Professional
Correct answer by Silly-V | Adobe Community Professional

That's right, I forgot to put in the save options in my code.

I am not sure which preset it uses, whether it does the default one or whether it's the last-used one.

According to the scripting guide, the PDFSaveOptions property .pDFPreset (is it really capitalized like that?) is assignable to the preset you'd like to use in your PDFSaveOptions.

if you do:

saveOpts.pDFPreset = "MY Preset";

or something that already exists there, maybe you can test this out and see what preset your files are ending up with. You'd have to analyze your file, so if there's some simple visual changes you can test this with, that'd work: if there's color bars and registration marks then you can quickly tell if this is working.

TOPICS
Scripting

Views

117

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

Batch Save and Change RGB to CMYK?

Advocate ,
Sep 30, 2020

Copy link to clipboard

Copied

Is there a script somewhere that will allow me to batch save (PDF) every open tab? And change any file that is RGB color space to CMYK? If i have to I'll combine scripts together for this. I did see a few scripts that were supposed to batch save the AI files into PDF however they were not working on CC2020

Adobe Community Professional
Correct answer by Silly-V | Adobe Community Professional

That's right, I forgot to put in the save options in my code.

I am not sure which preset it uses, whether it does the default one or whether it's the last-used one.

According to the scripting guide, the PDFSaveOptions property .pDFPreset (is it really capitalized like that?) is assignable to the preset you'd like to use in your PDFSaveOptions.

if you do:

saveOpts.pDFPreset = "MY Preset";

or something that already exists there, maybe you can test this out and see what preset your files are ending up with. You'd have to analyze your file, so if there's some simple visual changes you can test this with, that'd work: if there's color bars and registration marks then you can quickly tell if this is working.

TOPICS
Scripting

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
Sep 30, 2020 0
Adobe Community Professional ,
Oct 06, 2020

Copy link to clipboard

Copied

Hi

Did you try using the action panel? 

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
Reply
Loading...
Oct 06, 2020 0
Adobe Community Professional ,
Oct 07, 2020

Copy link to clipboard

Copied

Try this:

#target illustrator

function test(){

  var docs = app.documents;

  var saveOpts = new PDFSaveOptions;

  var thisDocnewFile;

  for (var i = docs.length - 1i > -1i--){

    thisDoc = docs[i];
    thisDoc.activate();

    app.executeMenuCommand("doc-color-rgb");

    newFile = File("~/Desktop/" + thisDoc.name.replace(/\.[^\.]$/".pdf"));

    thisDoc.saveAs(newFile);

    thisDoc.close();
  }

}

test();

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
Reply
Loading...
Oct 07, 2020 1
Advocate ,
Oct 09, 2020

Copy link to clipboard

Copied

Thanks for your reply this saves everything as *.ai 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
Reply
Loading...
Oct 09, 2020 0
Advocate ,
Oct 09, 2020

Copy link to clipboard

Copied

I changed rgb to (cmyk) and this at least works. it nowconverts RGB to CMYK. the save is still saving as .ai though.

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
Reply
Loading...
Oct 09, 2020 0
Engaged ,
Oct 09, 2020

Copy link to clipboard

Copied

To save as PDF, change this

thisDoc.saveAs(newFile);

to this

thisDoc.saveAs(newFile, saveOpts);

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
Reply
Loading...
Oct 09, 2020 1
Advocate ,
Oct 09, 2020

Copy link to clipboard

Copied

Awesome this works perfect. My 1 question is what PDF preset does this use? i have a custom PDF preset i use.

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
Reply
Loading...
Oct 09, 2020 0
Adobe Community Professional ,
Oct 09, 2020

Copy link to clipboard

Copied

That's right, I forgot to put in the save options in my code.

I am not sure which preset it uses, whether it does the default one or whether it's the last-used one.

According to the scripting guide, the PDFSaveOptions property .pDFPreset (is it really capitalized like that?) is assignable to the preset you'd like to use in your PDFSaveOptions.

if you do:

saveOpts.pDFPreset = "MY Preset";

or something that already exists there, maybe you can test this out and see what preset your files are ending up with. You'd have to analyze your file, so if there's some simple visual changes you can test this with, that'd work: if there's color bars and registration marks then you can quickly tell if this is working.

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
Reply
Loading...
Oct 09, 2020 1
Advocate ,
Oct 13, 2020

Copy link to clipboard

Copied

WORKS PERFECT!!! thanks a ton. 1 question what pdf preset was it using when this Preset part was left out just curious

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
Reply
Loading...
Oct 13, 2020 1
Silly-V LATEST
Adobe Community Professional ,
Oct 13, 2020

Copy link to clipboard

Copied

I don't have a clue, who knows. If you find out, please fill us in!

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
Reply
Loading...
Oct 13, 2020 0