Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for professional graphic designers and non-designers trying to do their own graphic design. It's 100% free, no registration required.

I'm trying to run a batch file on a custom action. The action does one thing: File -> Export -> Paths to Illustrator.

However, whenever I run that action as a batch on multiple files, it saves each file with the same name. So if I open File1.psd and save it as working/File1.ai, then run the batch on File2.psd, File3.psd, and File4.psd, what I get is working/File1.ai as an Illustrator file exported from File4.psd. Files 2 and 3 have been overwritten (as was File1.ai, obviously).

Here's my Batch dialog: Screen shot of Batch dialog box

If I change the destination to e.g. Folder, it re-saves all the files as PSD in addition to overwriting the AI files. How can I run this export on an arbitrary number of PSD files and get the same number of AI files out the other end?

EDIT: re-recording the action and refusing the dialog box gets me the dialog box on the first run of the batch, and subsequent files saved under the name I provide in that dialog (in other words, one dialog box for all files).

EDIT 2: Following the answer below, I tried saving to Folder and overriding action save commands (screen shot): second try batch process dialog

This produced the same results. :(

Here's the action I'm running: action definition screen shot

ETA 3: Based on the comments, my problem might be that the Export -> Paths to Illustrator command does not honor the "Override Action Save As" checkbox, which means I'm just stuck with that shortcoming of Photoshop.

share|improve this question
    
How familiar are you with javascript etc.? –  horatio Jun 14 '12 at 20:09
    
It's not my first language, but I get along. Part of the end goal of these scripts is to get path strings I can use in Raphael.js. –  pjmorse Jun 14 '12 at 23:46
    
OK, see my answer. –  horatio Jun 19 '12 at 15:01
    
Downvotes: care to offer constructive criticism? –  pjmorse Nov 21 '12 at 12:07
add comment

2 Answers

Choose a destination folder (last not-grayed out option) then choose ' override action save as' below it. You can see that below that, it says 'Starting serial#' which indicates it'll name each file with a next number.

share|improve this answer
    
Hmm. I tried this, and I get the same behavior as before. I'll add a screen shot of the action I'm running, maybe that will help... –  pjmorse Jun 14 '12 at 18:53
    
Strange it works for me.. It's probably a little detail you're doing differently. –  poepje Jun 14 '12 at 18:55
    
Yeah, that little detail is what I need to figure out. :( If only I could edit the action directly! –  pjmorse Jun 14 '12 at 19:01
    
Can you post a screen shot of your batch dialog so I can look for differences? –  pjmorse Jun 14 '12 at 19:30
1  
I think "export" does not honor the "save-as override" since it is not a "save as" command. I do know from personal experience that a "save for web" action is not affected by this –  horatio Jun 14 '12 at 20:01
show 7 more comments

One way to work with this is to use scripting (applescript, vbscript, javascript). Phtoshop exposes the export command (exportDocument (exportIn [, exportAs][, options])) (see for instance adobe's document photoshop_cs4_javascript_ref.pdf ) and so all you need to do is open a document and then feed the command a destination filename and options.

A quick google search brought me to this script from Photoshop for Geeks (http://www.tranberry.com/panels/) NOT MY CODE:

// openFolderTemplate.jsx
// Copyright 2007
// Written by Jeffrey Tranberry
// Photoshop for Geeks Version 1.0

/* 
Description:
This script is a template script that will
open and process a folder of images
*/

// enable double clicking from the 
// Macintosh Finder or the Windows Explorer
#target photoshop

// Make Photoshop the frontmost application
// in case we double clicked the file
app.bringToFront();


///////////////////////////
//       SET-UP          //
///////////////////////////


// A list of file extensions to skip, keep them lower case

    gFilesToSkip = Array( "db", "xmp", "thm", "txt", "doc", "md0", "tb0", "adobebridgedb", "adobebridgedbt", "bc", "bct" );


// Pops open a dialog for the user to
// choose the folder of documents to process

    var inputFolder = Folder.selectDialog("Select a folder of documents to process");


// Pops open a dialog for the user to
// set the output folder

    var outputFolder = Folder.selectDialog("Select a folder for the output files");



///////////////////////
//         MAIN          //
//////////////////////



// Open Folder of Images

    OpenFolder();


// show the path to an output folder

    alert(outputFolder);



///////////////////////////
//       FUNCTIONS       //
///////////////////////////



// Given the a Folder of files, open them

function OpenFolder() {
        var filesOpened = 0;
        var fileList = inputFolder.getFiles();
        for ( var i = 0; i < fileList.length; i++ ) {
                   // Make sure all the files in the folder are compatible with PS
                if ( fileList[i] instanceof File && ! fileList[i].hidden && ! IsFileOneOfThese( fileList[i], gFilesToSkip )) {
                        open( fileList[i] );
                        filesOpened++;


                    /////////////////////////////////////
                    // Put all your processing functions... //
                    /////////////////////////////////////

                        // Alert and show the document name
                        alert(app.activeDocument.name);

                        // Cloes the file without saving
                        app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

                    ////////////////////////////////////////////
                    // ...in the area between these two comments. //
                    ////////////////////////////////////////////


                }

        }
        return filesOpened;
}


// given a file name and a list of extensions
// determine if this file is in the list of extensions

function IsFileOneOfThese( inFileName, inArrayOfFileExtensions ) {
    var lastDot = inFileName.toString().lastIndexOf( "." );
    if ( lastDot == -1 ) {
        return false;
    }
    var strLength = inFileName.toString().length;
    var extension = inFileName.toString().substr( lastDot + 1, strLength - lastDot );
    extension = extension.toLowerCase();
    for (var i = 0; i < inArrayOfFileExtensions.length; i++ ) {
        if ( extension == inArrayOfFileExtensions[i] ) {
            return true;
        }
    }
    return false;
}

You can pick a source and destination folder, and the script will enumerate the files. You can then insert your own function to do magic.

share|improve this answer
    
Does that also work for Illustrator? ^ –  Just Jace Mar 3 at 6:50
    
Illustrator does support scripting, but my guess is that the script above would not work without alterations in illustrator. Adobe hosts documentation about the scripting model in general and for individual products. –  horatio Mar 4 at 15:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.