Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Save as .ait (adobe illustrator template)

Explorer ,
Dec 26, 2018 Dec 26, 2018

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

TOPICS
Scripting
4.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 07, 2019 Jan 07, 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++)

{

...
Translate
Adobe
Community Expert ,
Dec 26, 2018 Dec 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 26, 2018 Dec 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2019 Jan 07, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2019 Jan 07, 2019

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

It is a template.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2019 Jan 07, 2019

Untitled-[number]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2019 Jan 07, 2019

If you initially save a file as an .ait, it will open as "untitled" forever. but if you save it as an .ai file, you can swap the behavior back and forth at will

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2019 Jan 07, 2019

Oh! I didn't catch that. Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 06, 2019 Jan 06, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2019 Jan 07, 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" ));

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2019 Jan 07, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2019 Jan 07, 2019

I use mac exclusively. i just tested this code before i posted it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 27, 2020 Mar 27, 2020
LATEST

Hmm... I agree the method should work, but the code is assigning an array of File objects to "files" and then calling .rename() and .name.replace() methods on that array. Perhaps you were testing with one file and .getFiles() was able to convert it to a single File object?

 

Edit: Also want to point out the need to escape the dot in those regular expressions.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 09, 2019 Jan 09, 2019

Hi!

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

Thanks for all!

Have a nice day!

Miyano

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines