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

Save as AI and PDF at once (Layers)

Explorer ,
Jul 16, 2020 Jul 16, 2020

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.pngexpand image

 

Layer 1: PDF format (link image only)

elinochinjr_5-1594967423922.pngexpand image

 

 

Layer 2: AI format (outline only)

elinochinjr_3-1594967388898.pngexpand image

 

 

Thank you

 

 

TOPICS
Feature request , Scripting , Type
1.0K
Translate
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
...
Translate
Adobe
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.activeDocument.saveAs(file1);
app.undo();
layer1.remove();
app.activeDocument.saveAs(file1, PDF);
app.undo();

 

 

 

Translate
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

sorry for the late reply..

 

Thank you! It's working.

Translate
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

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.pngexpand image

 

Translate
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

Which lower version of AI do you need?

Translate
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

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

 

Thank you!!

Translate
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

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:
Translate
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

Hello,

 

sorry, in my PC with Illustrator 2017, it says

elinochinjr_0-1602213411309.pngexpand image

 

code:

elinochinjr_1-1602213452032.pngexpand image

 

Translate
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

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. 

Translate
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
LATEST

16 means CS6 and not "Legacy"

 

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

Translate
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

@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

😉

Translate
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