Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Saving the script as a project with Document.saveAs in Adobe Illustrator

I'm trying to save the script as a project to work with it later on

var doc = app.documents.add(null, 1080 , 1080, 1);
var file = New File("/c/Users/user/Documents/05illustratorScript.ai");
app.activeDocument.saveAs(file);

It marks line2 (expected ;)

If I do instead

var doc = app.documents.add(null, 1080 , 1080, 1);
app.activeDocument.saveAs("/c/Users/user/Documents/05illustratorScript.ai");

It says Illegal argument - argument 1 (on the line2)

Has anyone successfully used this method?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Seems that I was missing to include the second argument of the method Document.saveAs which is the "Save Options" , they are in turn another object that needs to be created.

The way to create a new document and save it as a certain .ai is

var doc = app.documents.add(null, 1080 , 1080, 1);
var newFile = new File("/c/your/Path/file.ai");
var saveOptions = new IllustratorSaveOptions();
app.activeDocument.saveAs(newFile , saveOptions);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!