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

Re-Saving .ai files without pdf compatibiliy - Script/Droplet

New Here ,
May 22, 2020 May 22, 2020

Copy link to clipboard

Copied

Hi,

We create illustrator files with many linked images. Our designers frequently save the files with pdf compatibility selected which creates enormous file sizes. Is there a simple script or solution we can look into and run on the files we've already saved to our server? Looking for something more automated than manually selecting files and re-saving without pdf compatibility. Possibly a drag and drop solution.

TOPICS
Performance , Scripting , Sync and storage

Views

353

Translate

Translate

Report

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
Adobe
Community Expert ,
May 22, 2020 May 22, 2020

Copy link to clipboard

Copied

LATEST

Hi Paul,

 

Try the following code, it will open a window to select the folder that has your ai files and then resave it with a new name with _out appened at the end in the same folder.

var sourceFolder = Folder.selectDialog();
if(sourceFolder)
{
	filesToProcess = sourceFolder.getFiles("*.ai")
	if(filesToProcess != "")
	{
		for(var i = 0; i < filesToProcess.length; i++)
		{
			var doc = app.open(filesToProcess[i]);
			var mySaveOptions = new IllustratorSaveOptions();
			mySaveOptions.pdfCompatible = false;
			
			//save witn new name
			doc.saveAs(File(filesToProcess[i].fsName.replace(/.ai/i, "_out.ai")), mySaveOptions);
			doc.close(SaveOptions.DONOTSAVECHANGES);
		}
	}
}

 

-Manan

Votes

Translate

Translate

Report

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