Copy link to clipboard
Copied
Copy link to clipboard
Copied
var sourceFolder = Folder.selectDialog("Select the folder to process");
var outputFolder = Folder.selectDialog("Select Output folder");
if (sourceFolder != null)
{
var fileList = sourceFolder.getFiles("*.tif")
for (var i = 0; i < fileList.length; i++)
{
displayDialogs = DialogModes.NO;
if (fileList instanceof File)
{
open(fileList);
var startRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
var doc = app.activeDocument;
var docName = app.activeDocument.name;
var saveFile =new File(outputFolder + "/" + docName);
doc.selection.selectAll();
doc.selection.copy();
var W = activeDocument.width.value;
var H = activeDocument.height.value;
var R = activeDocument.resolution;
var MODE = app.activeDocument.mode;
var doc2 = app.documents.add(W, H, R, "Untitled-"+(documents.length+1), eval("New"+MODE), DocumentFill.WHITE,1.0);
doc.close(SaveOptions.DONOTSAVECHANGES);
doc2.paste();
doc2.flatten();
SaveTIFF(saveFile);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
app.preferences.rulerUnits = startRulerUnits;
}
}
}
function SaveTIFF(saveFile){
tiffSaveOptions = new TiffSaveOptions();
tiffSaveOptions.embedColorProfile = true;
tiffSaveOptions.alphaChannels = true;
tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW;
activeDocument.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE);
}
Copy link to clipboard
Copied
Update: modern versions of ExifTool do not appear to have any problems fully removing all traces of Photoshop history metadata from TIFF files:
exiftool -history= '/Path/to image/file.tif'
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
// StripExif.js
// This script strips all the Exif and other information from a file.
//It is based on CopyAndPaste.js by Adobe, Copyright 2002-2003. Adobe Systems, Incorporated. All rights reserved.
//All amendments Copyright Brian Price 2004 (brian@secalis.com)
// This script selects all of the active document, copies the selection,
// to the clipboard, creates a new document of the same dimensions
// and pastes the contents of the clipboard into it without the Exif data,
//applying the original filename to the new stripped document
//Check if a document is open
if (documents.length > 0)
{
//Check that the document has no Layers
if (activeDocument.artLayers.length ==1)
{
// This ensures that rulerUnits are set before creating the new document.
var originalRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.INCHES;
// Set variables for the Initial File and filename
var originalDoc = activeDocument
var Filename = (originalDoc.name)
//Select All and Copy
originalDoc.selection.selectAll();
originalDoc.selection.copy()
// record original dimensions
var x = originalDoc.width
var y= originalDoc.height
var r = originalDoc.resolution
var m = originalDoc.Mod
var b = originalDoc.bitsPerChannel
// Close original file
originalDoc.close(SaveOptions.DONOTSAVECHANGES)
// Create the new document and paste the original into it (without the Exif data)
var stripDoc = documents.add(x, y, r, Filename,m , DocumentFill.TRANSPARENT);
stripDoc.bitsPerChannel = b
stripDoc.paste();
stripDoc.flatten();
// Reset Variables
stripDoc = null;
originalDoc = null;
x = null;
y = null;
r = null;
m = null;
b = null
Filename = null;
// Reset rulers
preferences.rulerUnits = originalRulerUnits;
//Open alert box if the document has layers
}
else
{
alert("This Document has layers - the script cannot be used");
}
//Open alert box if there is no document open
}
else
{
alert("You must have a document open before running this script!");
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
#target bridge // let EntendScript know what app the script is for
clearHistory = {};// create an object
clearHistory.execute = function(){// create a method for that object
var sels = app.document.selections;// store the array of selected files
for (var i = 0; i < sels.length; i++){//loop though that array
var md = sels.synchronousMetadata;// get the metadata for the file
md.namespace = "http://ns.adobe.com/photoshop/1.0/";// set the namespace
md.History = " ";//set the porperty
}
}
// this script only works in bridge
if (BridgeTalk.appName == "bridge"){
//creage the munuItem
var menu = MenuElement.create( "command", "Clear history in Metadata", "at the end of Tools");
menu.onSelect = clearHistory.execute;
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Find more inspiration, events, and resources on the new Adobe Community
Explore Now