7 Replies Latest reply: Jul 24, 2014 7:18 AM by alanomaly RSS

    Downsaving, Backsaving, Legacy save CS6 to CS5 batch processing

    jason@micrographix.co.uk Community Member

      Hi,

      I have hundreds of files that I need to back save from CS6 to CS5 using the Batch process in the Actions palette. Previous attempts using Actions have resulted in the file not being backsaved, but instead just being saved again in CS6 format.

      Does anybody know how to back save to CS5 in batch processing?

      Cheers

        • 1. Re: Downsaving, Backsaving, Legacy save CS6 to CS5 batch processing
          Larry G. Schneider CommunityMVP

          You could use a script. Very easy. When I get to work I'll post something.

          • 2. Re: Downsaving, Backsaving, Legacy save CS6 to CS5 batch processing
            Larry G. Schneider CommunityMVP

            One more question. What options do you use on the Illustrator options page? PDF Compatible, Font subset, embed images?

            • 3. Re: Downsaving, Backsaving, Legacy save CS6 to CS5 batch processing
              jason@micrographix.co.uk Community Member

              Hi Larry, PDF compatible, include linked files and use compression are the only boxes that I need checking.

              Many thanks

              • 4. Re: Downsaving, Backsaving, Legacy save CS6 to CS5 batch processing
                Larry G. Schneider CommunityMVP
                /**********************************************************
                
                ADOBE SYSTEMS INCORPORATED 
                Copyright 2005 Adobe Systems Incorporated 
                All Rights Reserved 
                
                NOTICE:  Adobe permits you to use, modify, and 
                distribute this file in accordance with the terms
                of the Adobe license agreement accompanying it.  
                If you have received this file from a source 
                other than Adobe, then your use, modification,
                or distribution of it requires the prior 
                written permission of Adobe. 
                
                *********************************************************/
                
                /**********************************************************
                
                SaveAsAI15.jsx
                
                DESCRIPTION
                
                This sample gets files specified by the user from the 
                selected folder and batch processes them and saves them 
                as PDFs in the user desired destination with the same 
                file name.
                
                **********************************************************/
                
                // Main Code [Execution of script begins here]
                
                // uncomment to suppress Illustrator warning dialogs
                // app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
                
                var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, illustratorSaveOpts;
                
                // Select the source folder.
                sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator files you want to convert to AI', '~' );
                
                // If a valid folder is selected
                if ( sourceFolder != null )
                {
                    files = new Array();
                    fileType = prompt( 'Select type of Illustrator files to you want to process. Eg: *.ai', ' ' );
                    
                    // Get all files matching the pattern
                    files = sourceFolder.getFiles( fileType );
                    
                    if ( files.length > 0 )
                    {
                        // Get the destination to save the files
                        destFolder = Folder.selectDialog( 'Select the folder where you want to save the converted AI files.', '~' );
                        for ( i = 0; i < files.length; i++ )
                        {
                            var optRef = new OpenOptions();
                            optRef.updateLegacyText = true;
                
                
                            sourceDoc = app.open(files[i], DocumentColorSpace.CMYK, optRef); // returns the document object
                                                    
                            // Call function getNewName to get the name and file to save the ai
                            targetFile = getNewName();
                            
                            // Call function getIllustratorOptions get the illustratorSaveOptions for the files
                            illustratorSaveOpts = getIllustratorOptions( );
                            
                            // Save as AI
                            sourceDoc.saveAs( targetFile, illustratorSaveOpts );
                            
                            sourceDoc.close();
                        }
                        alert( 'Files are saved as AI in ' + destFolder );
                    }
                    else
                    {
                        alert( 'No matching files found' );
                    }
                }
                
                
                
                
                /*********************************************************
                
                getNewName: Function to get the new file name. The primary
                name is the same as the source file.
                
                **********************************************************/
                
                function getNewName()
                {
                    var ext, docName, newName, saveInFile, docName;
                    docName = sourceDoc.name;
                    ext = '.ai'; // new extension for AI file
                    newName = "";
                        
                    for ( var i = 0 ; docName[i] != "." ; i++ )
                    {
                        newName += docName[i];
                    }
                    newName += ext; // full AI name of the file
                    
                    // Create a file object to save the ai file
                    saveInFile = new File( destFolder + '/' + newName );
                    
                
                    return saveInFile;
                }
                
                
                
                
                /*********************************************************
                
                getIllustratorOptions: Function to set the AI saving options of the 
                files using the illustratorSaveOptions object.
                
                **********************************************************/
                
                function getIllustratorOptions()
                {
                    
                    // Create the PDFSaveOptions object to set the AI options
                    var illustratorSaveOpts = new IllustratorSaveOptions();
                    
                    // Setting IllustratorSaveOptions properties. 
                    illustratorSaveOpts.embedLinkedFiles = true;
                    illustratorSaveOpts.fontSubsetThreshold = 0.0
                    illustratorSaveOpts.pdfCompatible = true
                    illustratorSaveOpts.compatibility = Compatibility.ILLUSTRATOR15
                    illustratorSaveOpts.embedICCProfile =  false
                
                    return illustratorSaveOpts;
                }
                

                 

                 

                Here's the script. Copy asd paste into a text editor and save as PLAIN text with a .jsx extension. Place it in the HD/Applications/Adobe Illustrator CS6/Presets/en_GB/Scripts folder and restart AI (or do the same before starting AI). Run it from the File/Scripts menu. Let me know if you have any problems.

                • 6. Re: Downsaving, Backsaving, Legacy save CS6 to CS5 batch processing
                  Creative SOB Community Member

                  Hey Larry, is it possible to get the script to look through sub-folders and to save those converted files back to the same directory where the original file was located?  Either way, thank you so much for posting your script, it's helped me to convert numerous eps files already. 

                  • 7. Re: Downsaving, Backsaving, Legacy save CS6 to CS5 batch processing
                    alanomaly Community Member

                    Great script, very useful, thanks! Here's a few notes for anyone looking to batch save as CS4 not used to scripting so they know what to expect:

                    • If you want to change the version, e.g. to downsave to CS4 instead of CS5, just change the line "illustratorSaveOpts.compatibility = Compatibility.ILLUSTRATOR15" near the bottom. CS5 = ILLUSTRATOR15, CS4= ILLUSTRATOR14, etc etc
                    • It asks you to specify a folder to save to: creating new files not overwriting old ones. It also lets you choose file type (so you could use this to batch convert .svg, .pdf, .eps etc etc to a specific version of AI if you wanted)
                    • It works by having Illustrator open then save then close each file in turn, so be prepared for it to take a while if you have hundreds
                    • One gotcha to look out for: it doesn't like filenames with dots in them. If you have a filename like "Section 2.4 - Stuff about things.ai" it'll save it as "Section 2.ai"