Skip to main content
Miyano_
Inspiring
December 26, 2018
Answered

Save as .ait (adobe illustrator template)

  • December 26, 2018
  • 4 replies
  • 4548 views

Hi everybody,

I would like to save my file as a .ait format. I have tried browsing the forum but it seems impossible to save a file as a .ait file. I also already have tried to rename the file as "xxx.ait" when saving it but it does not work.

Thank you for your answers,

Happy holidays !!

Miyano

This topic has been closed for replies.
Correct answer Disposition_Dev

from an illustrator script you can locate the file directly, or batch a whole folder, and then use the File.rename() method.

var myFile = File("path/to/file/art_file.ai");

myFile.rename("art_file.ait");

///////////////

now let's get a little fancier in the batch and change the extensions dynamically so you don't have to hard code the rest of the filename like i did above.

///////////////

var myFolder = Folder("path/to/folder");

var files = myFolder.getFiles();

for(var x=0, len=files.length; x<len; x++)

{

     files.rename(files.name.replace( /.ai$/ , ".ait" ));

}

4 replies

Miyano_
Miyano_Author
Inspiring
January 9, 2019

Hi!

Thank you very much williamadowling, I was focused on saving the file as an ".ait" file but I didnt thought about renaming it as an ".ait".

Thanks for all!

Have a nice day!

Miyano

Miyano_
Miyano_Author
Inspiring
January 6, 2019

Hello Carlos & William,

Thank you very much for your answers.

CarlosCanto I tried your method. It looks like it is working fine at the moment.

williamadowling​​ Is it possible to change the file extension from a script launched from illustrator or does the file extension needs to be changed from the file system only?

I hope you spent great holidays with your relatives and friends,

Thank you both very much for your help, I now have a clearer view on the problem

Have a nice day.

Miyano

Disposition_Dev
Disposition_DevCorrect answer
Legend
January 7, 2019

from an illustrator script you can locate the file directly, or batch a whole folder, and then use the File.rename() method.

var myFile = File("path/to/file/art_file.ai");

myFile.rename("art_file.ait");

///////////////

now let's get a little fancier in the batch and change the extensions dynamically so you don't have to hard code the rest of the filename like i did above.

///////////////

var myFolder = Folder("path/to/folder");

var files = myFolder.getFiles();

for(var x=0, len=files.length; x<len; x++)

{

     files.rename(files.name.replace( /.ai$/ , ".ait" ));

}

pixxxelschubser
Community Expert
Community Expert
January 7, 2019

Hi william,

I think this works as expected under Windows. But I doubt if a simple change of the extension works with a Mac.

Disposition_Dev
Legend
December 26, 2018

in my experience, i find it much better to save the file as an .ai file, then change the name in the file system to .ait. this causes illustrator to open the file as a .ait file as you'd expect, but if you need to make a change to that template file, you can simply rename the extension back to .ai, make your fix, save the file and update the extension. it's pretty easy to make customized tools for quickly updating extensions. i use a simple bash script i wrote to do so.

This method helps prevent you from having to see a save as dialog every time you want to change a template file (or batch a whole folder of them). just my $.02

rcraighead
Legend
January 7, 2019

I'm confused… When I rename an ".ait" to ".ai" in the Finder it still opens as "Untitled" in AI. I would expect it to open with the file name.

pixxxelschubser
Community Expert
Community Expert
January 7, 2019

Try to open another "*.ait" in Illustrator. What result do you get?

It is a template.

CarlosCanto
Community Expert
Community Expert
December 26, 2018

Record an Action to Save as Template, then have the script play the action. The action will always save the template in the same location, you can then move and rename the file if necessary.