Skip to main content
Inspiring
August 13, 2021
Question

Using Extendscript/JavaScript to open a new file from an Illustrator .ait file.

  • August 13, 2021
  • 1 reply
  • 4406 views

Hello, everyone. I am writing a script to use with Illustrator. I have a template file I would like to create new documents from, saved as an .ait file. How can I use either ExtendScript or JavaScript to open a new document from the template file?

 

Thanks!

This topic has been closed for replies.

1 reply

femkeblanco
Legend
August 13, 2021

The same way you open any file.

 

1. Get the path to the file (below is an example of a path to a template on my PC to show the notation).
2. Create a new file (using the new File() constructor).
3. Open the file (using the app function open()).

 

app.open(new File("/C/Program Files (x86)/Adobe/Adobe Illustrator CS6/Cool Extras/en_GB/Templates/Blank Templates/Banner Ads.ait"));

 

Inspiring
August 16, 2021

Thanks, femkeblanco! I am getting an error that it cannot find the illustrator file. I tried using both the absolute and relative paths. The issue may be due to the network I am on. Even so, I am much closer to a solution now.

Thanks again!