Export channels to tif in 600
Hi! I am trying to export channels into tif at 600, but the final resolution is always 300 and I am not sure why, I manually exported the channels and in fact the tif are in 600 (they are like 19mb in 300 and around 72mb in 60).
Here is the code:
function Split600() {
var outputFolder = new Folder("~/Downloads/nuevo");
if (!outputFolder.exists) {
outputFolder.create();
}
var channelsSplit = confirm("Have you already split the channels for the documents you want to export as TIFF?", "Channels Split Confirmation");
if (channelsSplit) {
var allDocuments = [];
for (var i = 0; i < app.documents.length; i++) {
allDocuments.push(app.documents[i]);
}
for (var i = 0; i < allDocuments.length; i++) {
var doc = allDocuments[i];
app.activeDocument = allDocuments[i];
var fileName = doc.name.replace(/\.[^\.]+$/, '') + ".tif";
var filePath = new File(outputFolder + "/" + fileName);
var tiffOptions = new TiffSaveOptions();
tiffOptions.layers = true;
tiffOptions.alphaChannels = true;
tiffOptions.imageCompression = TIFFEncoding.NONE; // Set the compression to "None" (uncompressed)
tiffOptions.resolution = 600; // Set the resolution to 600 DPI
tiffOptions.byteOrder = ByteOrder.MACOS;
doc.saveAs(filePath, tiffOptions, true);
doc.close(SaveOptions.DONOTSAVECHANGES);
}
// alert("Uncompressed TIFF export completed for all open documents at 300 DPI!");
} else {
// alert("No action taken. Please split the channels and run the script again.");
var documents = app.documents;
var doc = documents[0];
doc.splitChannels();
var allDocuments = [];
for (var i = 0; i < app.documents.length; i++) {
allDocuments.push(app.documents[i]);
}
for (var i = 0; i < allDocuments.length; i++) {
var doc = allDocuments[i];
app.activeDocument = allDocuments[i];
var fileName = doc.name.replace(/\.[^\.]+$/, '') + ".tif";
var filePath = new File(outputFolder + "/" + fileName);
var tiffOptions = new TiffSaveOptions();
tiffOptions.layers = true;
tiffOptions.alphaChannels = true;
tiffOptions.imageCompression = TIFFEncoding.NONE; // Set the compression to "None" (uncompressed)
tiffOptions.resolution = 600; // Set the resolution to 600 DPI
tiffOptions.byteOrder = ByteOrder.MACOS;
doc.saveAs(filePath, tiffOptions, true);
doc.close(SaveOptions.DONOTSAVECHANGES);
}
}
}
Split600();
First I ask if the channels are splitted, if not, I split them and then export tab by tab, but nothing happens, it exports to a fodler in downloads named "Nuevo", I'll appreciate some help.