Affichage des résultats 1 à 6 sur 6
Discussion: Filigrane incrementale
Mode arborescent
-
12/10/2014, 15h32 #1
- Inscription
- August 2006
- Localisation
- FRANCE
- Âge
- 52
- Messages
- 428
- Boîtier
- 7D + Grip
- Objectif(s)
- 15-85 IS USM + 70-200 F4 L IS+ 50 f1.4
Filigrane incrementale
Bonjour.
Je souhaite avoir un script qui inscrive un numéro incrémentale en bas de ma photo et qui l'enregistre sous le numero + le nom d'origine.
En cherchant sur le net j'ai trouvé ceci :
Code:// vous utilisez ce script à vos propres risques ! #target photoshop // folder selection; var theFolder = Folder.selectDialog ("select folder"); if (theFolder) { var theFolderFiles = retrieveTIFandPSDandJPG (theFolder, []); var originalRulerUnits = preferences.rulerUnits; preferences.rulerUnits = Units.PERCENT; // work through the files; for (var m = 0; m < theFolderFiles.length; m++) { var theNumber = bufferNumberWithZeros(m + 1, 3); var myDocument = app.open(File(theFolderFiles[m])); // getting the name and location; var docName = myDocument.name; var basename = docName.match(/(.*)\.[^\.]+$/)[1]; //getting the location; var docPath = myDocument.path; // create a text layer; var textLayer = myDocument.artLayers.add(); textLayer.kind = LayerKind.TEXT; textLayer.name = "text"; textLayer.blendMode = BlendMode.NORMAL; textLayer.opacity = 100; var myTextRef = textLayer.textItem; myTextRef.size = 150; myTextRef.font = "Arial"; var newColor = new SolidColor(); newColor.rgb.red = 255; newColor.rgb.green = 255; newColor.rgb.blue = 255; myTextRef.color = newColor; myTextRef.position = new Array( 1, 99); myTextRef.contents = theNumber; // jpg options; var jpegOptions = new JPEGSaveOptions(); jpegOptions.quality = 12; jpegOptions.embedColorProfile = true; //save jpg; myDocument.saveAs((new File(docPath+"/"+theNumber+"_"+basename+".jpg")),jpegOptions,true); myDocument.close(SaveOptions.DONOTSAVECHANGES) }; preferences.rulerUnits = originalRulerUnits; }; ////// get tif-, psd-, jpg-files from folder and subfolders ////// function retrieveTIFandPSDandJPG (theFolder, theFiles) { if (!theFiles) {var theFiles = []}; var theContent = theFolder.getFiles(); for (var n = 0; n < theContent.length; n++) { var theObject = theContent[n]; if (theObject.constructor.name == "Folder") { theFiles = retrieveTIFandPSDandJPG(theObject, theFiles) }; if (theObject.name.slice(-4) == ".tif" || theObject.name.slice(-4) == ".psd" || theObject.name.slice(-4) == ".jpg") { theFiles = theFiles.concat(theObject) } }; return theFiles }; ////// buffer number with zeros ////// function bufferNumberWithZeros (number, places) { var theNumberString = String(number); for (var o = 0; o < (places - String(number).length); o++) { theNumberString = String("0" + theNumberString) }; return theNumberString };
Avez vous une idée ?
Merci pour votre aide
Informations de la discussion
Utilisateur(s) sur cette discussion
Il y a actuellement 1 utilisateur(s) naviguant sur cette discussion. (0 utilisateur(s) et 1 invité(s))
Discussions similaires
-
Filigrane sous LR 3.6
Par Golgoth XII° dans le forum LightroomRéponses: 15Dernier message: 17/08/2014, 21h33 -
filigrane de ronce
Par dkeith dans le forum [Noir & Blanc]Réponses: 3Dernier message: 20/10/2011, 13h58 -
Filigrane or not ...
Par Michel_R dans le forum Discussions généralesRéponses: 6Dernier message: 04/06/2010, 22h54 -
filigrane et Lightroom
Par chacha95 dans le forum LightroomRéponses: 2Dernier message: 26/01/2009, 01h28 -
Filigrane
Par gribou dans le forum Les Logiciels photoRéponses: 1Dernier message: 03/05/2007, 16h21