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:
Layer 1: PDF format (link image only)
Layer 2: AI format (outline only)
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.active
...
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();
Copy link to clipboard
Copied
sorry for the late reply..
Thank you! It's working.
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!
Copy link to clipboard
Copied
Which lower version of AI do you need?
Copy link to clipboard
Copied
This is what I need, "Illustratoc CC (Legacy)"
Thank you!!
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();
Copy link to clipboard
Copied
Hello,
sorry, in my PC with Illustrator 2017, it says
code:
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.
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.
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
😉