2 Replies Latest reply on Dec 1, 2015 6:22 AM by c.pfaffenbichler

    Save as - make active document name

    eyescreamer Level 1

      Does anyone know how to script a save new filename with Javascript for Photoshop?

      I can save the file with a new name but it doesn't replace the current active document that it's saving from. The current active document still possesses the old name.

       

       

          saveFile = new File(filePath()+"/"+fileName())

          saveOptions = new PhotoshopSaveOptions();

          saveOptions.layers = true; // Preserve layers.

          saveOptions.embedColorProfile = true; // Preserve color profile.

          saveOptions.annotations = true; // Preserve annonations.

          saveOptions.alphaChannels = true; // Preserve alpha channels.

          saveOptions.spotColors = true; // Preserve spot colors. 

       

       

          app.activeDocument.saveAs(saveFile, saveOptions, true,Extension.LOWERCASE);

          $.writeln(saveFile);