Highlighted

Save as AI and PDF at once (Layers)

Explorer ,
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

 

 

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();

 

 

 

TOPICS
Feature request, How to, Scripting, Type

Views

193

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

Save as AI and PDF at once (Layers)

Explorer ,
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

 

 

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();

 

 

 

TOPICS
Feature request, How to, Scripting, Type

Views

194

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
Jul 16, 2020 0
Engaged ,
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();

 

 

 

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

Copy link to clipboard

Copied

sorry for the late reply..

 

Thank you! It's 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...
Jul 23, 2020 0
Explorer ,
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

 

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

Copy link to clipboard

Copied

Which lower version of AI do you need?

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

Copy link to clipboard

Copied

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

 

Thank you!!

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 0
Engaged ,
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:

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

 

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 08, 2020 0
Engaged ,
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. 

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
Most Valuable Participant ,
Oct 09, 2020

Copy link to clipboard

Copied

16 means CS6 and not "Legacy"

 

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

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
Most Valuable Participant ,
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

😉

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 08, 2020 1