• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Save as AI and PDF at once (Layers)

Explorer ,
Jul 16, 2020 Jul 16, 2020

Copy link to clipboard

Copied

Hello

 

I want to save Layer 1 (link image) as AI format

and Layer 2 (outline) as PDF format

 

Is there a script for this to save at once?

 

See sample:

elinochinjr_0-1594967345303.png

 

Layer 1: PDF format (link image only)

elinochinjr_5-1594967423922.png

 

 

Layer 2: AI format (outline only)

elinochinjr_3-1594967388898.png

 

 

Thank you

 

 

TOPICS
Feature request , Scripting , Type

Views

913

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

correct answers 1 Correct answer

Guide , Jul 17, 2020 Jul 17, 2020

This should

(1) delete layer 2, save the doc with layer 1 as AI, undo delete,

(2) delete layer 1, save the doc with layer 2 as PDF and undo delete again. 

 

If you want it the other way around, swap the layers' names. 

 

(Replace "..." in the path in line 3 below with your destination.)

 

var layer1 = app.activeDocument.layers["Layer 1"];
var layer2 = app.activeDocument.layers["Layer 2"];
var file1 = new File("/C/Users/.../Desktop/yourFileName");
var PDF = new PDFSaveOptions;
layer2.remove();
app.active
...

Votes

Translate

Translate
Adobe
Guide ,
Jul 17, 2020 Jul 17, 2020

Copy link to clipboard

Copied

This should

(1) delete layer 2, save the doc with layer 1 as AI, undo delete,

(2) delete layer 1, save the doc with layer 2 as PDF and undo delete again. 

 

If you want it the other way around, swap the layers' names. 

 

(Replace "..." in the path in line 3 below with your destination.)

 

var layer1 = app.activeDocument.layers["Layer 1"];
var layer2 = app.activeDocument.layers["Layer 2"];
var file1 = new File("/C/Users/.../Desktop/yourFileName");
var PDF = new PDFSaveOptions;
layer2.remove();
app.activeDocument.saveAs(file1);
app.undo();
layer1.remove();
app.activeDocument.saveAs(file1, PDF);
app.undo();

 

 

 

Votes

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
Explorer ,
Jul 23, 2020 Jul 23, 2020

Copy link to clipboard

Copied

sorry for the late reply..

 

Thank you! It's working.

Votes

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
Explorer ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

Hello, 

 

sorry to bother you, but I need your help again,

I just don't know how to code,

 

how to make this possible? option when saving AI document,

I need to choose version for my lower version AI

 

Thank you very much!

 

elinochinjr_0-1602036656309.png

 

Votes

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
Guide ,
Oct 07, 2020 Oct 07, 2020

Copy link to clipboard

Copied

Which lower version of AI do you need?

Votes

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
Explorer ,
Oct 07, 2020 Oct 07, 2020

Copy link to clipboard

Copied

This is what I need, "Illustratoc CC (Legacy)"

 

Thank you!!

Votes

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
Guide ,
Oct 08, 2020 Oct 08, 2020

Copy link to clipboard

Copied

I use CS6 and cannot test it, but try this:  (Again, replace "..." in the path in line 3 below with your destination.)

 

var layer1 = app.activeDocument.layers["Layer 1"];
var layer2 = app.activeDocument.layers["Layer 2"];
var file1 = new File("/C/Users/.../Desktop/yourFileName");
var AI = new IllustratorSaveOptions();
AI.compatibility = Compatibility.ILLUSTRATOR17;
var PDF = new PDFSaveOptions();
layer2.remove();
app.activeDocument.saveAs(file1, AI);
app.undo();
layer1.remove();
app.activeDocument.saveAs(file1, PDF);
app.undo();

 

And see:

Votes

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
Explorer ,
Oct 08, 2020 Oct 08, 2020

Copy link to clipboard

Copied

Hello,

 

sorry, in my PC with Illustrator 2017, it says

elinochinjr_0-1602213411309.png

 

code:

elinochinjr_1-1602213452032.png

 

Votes

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
Guide ,
Oct 09, 2020 Oct 09, 2020

Copy link to clipboard

Copied

The only suggestion I can think of is to save as an even earlier version.  Change the 17 in the script to 16.  If the message still shows, there must be something in your document which is incompatible with earlier versions. 

Votes

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
Community Expert ,
Oct 09, 2020 Oct 09, 2020

Copy link to clipboard

Copied

LATEST

16 means CS6 and not "Legacy"

 

And IMHO "Legacy" means something like previous CC versions. But maybe I'm wrong.

Votes

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
Community Expert ,
Oct 08, 2020 Oct 08, 2020

Copy link to clipboard

Copied

@elinochinjr wrote: »This is what I need, "Illustratoc CC (Legacy)"«

 

It seems this is:

Compatibility.ILLUSTRATOR17;  // Illustrator CC Legacy

 

If that works for you

have fun

😉

Votes

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