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

How to use Save for Web with Actions and Save a Unique Filename?

New Here ,
Nov 20, 2017 Nov 20, 2017

Copy link to clipboard

Copied

I recorded an action that saves opened documents using the "Save to Web" action. It works well but it only saves using the same name (eg Untitled3.jpg) How can I save them all using an incremental number or anything else that would make the filename unique?

I have also tried applying a batch action to all opened files and the Starting Serial # is exactly what I need but this only applies to "Save as" actions and I would like to use "Save to Web"

Views

884

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 ,
Nov 20, 2017 Nov 20, 2017

Copy link to clipboard

Copied

Have you tried to use Image Processor Pro which can save optimized images for the web. Here is my tutorial which can help you something DesignEasy: How to Add Prefix and Suffix to File Name When Batch Processing Files in Photoshop

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
New Here ,
Nov 30, 2017 Nov 30, 2017

Copy link to clipboard

Copied

LATEST

I've solved this by using the ExtendScript toolkit CS6 with this code:

#target photoshop

//alert("Hello Photoshop!");

//app.activeDocument.activeLayer.opacity = 50;

var randomString = function(length) {

    var text = "";

    var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

    for(var i = 0; i < length; i++) {

        text += possible.charAt(Math.floor(Math.random() * possible.length));

    }

    return text;

}

var rs  = randomString(7);

function main(){ 

if(!documents.length) return; 

//var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');  

var saveFile = File("c:"+ "/test/img/woman/" + rs + ".jpg"); 

if(saveFile.exists){ 

   if(!confirm("Overwrite existing document?")) return; 

    saveFile.remove(); 

    } 

SaveForWeb(saveFile,100); //change to 60 for 60% 

main(); 

function SaveForWeb(saveFile,jpegQuality) { 

var sfwOptions = new ExportOptionsSaveForWeb();  

   sfwOptions.format = SaveDocumentType.JPEG;  

   sfwOptions.includeProfile = false;  

   sfwOptions.interlaced = 0;  

   sfwOptions.optimized = true;  

   sfwOptions.quality = jpegQuality; //0-100  

activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions); 

}

and included this script into my actions.

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