Essaies ce script : il ne fais rien mais il sauve les image - compressees dans un autre dossier. Je m en suis servi comme base de depart.

Code:
//DocumentInfo.jsx
// Save the current preferences
var startDisplayDialogs = app.displayDialogs
// Set Adobe Photoshop CS2 to use pixels and display no dialogs
app.displayDialogs = DialogModes.NO

// ask the user for the input folder
var inputFolder = Folder.selectDialog("Select a folder to tag")
//var inputFolder = new Folder("C:/Documents and Settings/moi/Mes documents/Mes images/Z_TRAITEMENT_TIFFS");

// ask the user for the output folder
var outputFolder = Folder.selectDialog("Select a folder for the output files")
//var outputFolder = new Folder("C:/Documents and Settings/moi/Mes documents/Mes images/Z_TRAITEMENT_ENREGISTRER");

// see if we got something interesting from the dialog
if (inputFolder != null && outputFolder != null) {



// get all the files found in this folder
var fileList = inputFolder.getFiles("*.jpg")
// save the outputs in JPEG
var jpegOptions = new JPEGSaveOptions()
// set the jpeg quality really low so the files are small
jpegOptions.quality = 1
// open each one in turn

//+++++++++++++++++++++++++++++++++++++++++
//Rajout pour l image 0
// The fileList includes both folders and files so open only files
//if (fileList[0] instanceof File && fileList[i].hidden == false) 

// get a reference to the new document
var docRef = open(fileList[0])





// flatten because we are saving to JPEG
docRef.flatten()
// go to 8 bit because we are saving to JPEG
docRef.bitsPerChannel = BitsPerChannelType.EIGHT
// save and close
docRef.saveAs(new File(outputFolder + "/Output" + 0 + ".jpg"),
jpegOptions)


// don’t modify the original
docRef.close(SaveOptions.DONOTSAVECHANGES)


//+++++++++++++++++++++++++++++++++++++ fin de rajout

for (var i = 1; i < fileList.length; i++) 
{
// The fileList includes both folders and files so open only files
if (fileList[i] instanceof File && fileList[i].hidden == false) 
{
// get a reference to the new document
var docRef = open(fileList[i])





// flatten because we are saving to JPEG
docRef.flatten()
// go to 8 bit because we are saving to JPEG
docRef.bitsPerChannel = BitsPerChannelType.EIGHT
// save and close
docRef.saveAs(new File(outputFolder + "/Output" + i + ".jpg"),
jpegOptions)


// don’t modify the original
docRef.close(SaveOptions.DONOTSAVECHANGES)
}
}
}
// Reset the application preferences
app.displayDialogs = startDisplayDialogs