Thanks for chiming in, I see you throughout the forum. Before responding to your reply, should I just mark the first reply stating "not possible" as the correct answer? Technically it's not possible to set default import options from what I understand. thank you I was not aware of the pixel limit- which would negatively impact a tertiary task to this one- nor the pdf tool. I didn't think of just hard coding the dims into the script... Since ppi can be set @300, pixel dims could be predefined to get the desired 3.9inx3.9in doc size. Untested code but for many files with static dimensions and static input directory I guess you could do something like this. 1170x1170 = 3.9in @300. Trying to avoid input dialogues: #target photoshop
// Set the parameters
var parameters = {
mode: 'RGB Color',
bits: 8,
resolution: 300,
cropTo: 'Bounding Box',
width: 1170,
height: 1170,
pages: 'All pages',
from: 1,
to: 1,
fileType: 'Single File',
filePath: 'C:/pdfs/files',
saveToOriginalFolder: false,
outputFolder: 'C:/output',
resizeToFit: false,
resizeWidth: 0,
resizeHeight: 0,
action: {
runAction: false,
actionSet: '',
actionName: ''
},
fileNameOptions: 'Document Name',
sequenceStart: 1,
sequenceLength: 4,
newFileName: '',
flattenDocument: false,
saveOptions: {
tif: {
enable: true,
compression: 'LZW'
},
psd: false,
png: false,
jpg: false,
pdf: false,
saveForWeb: false,
targa: false,
printOnly: false
}
};
// Process PDF files
function processPDF(filePath) {
// Your PDF processing logic here
$.writeln("Processing PDF file: " + filePath);
}
// Main function
function main() {
// Set up parameters and process PDF files
var pdfFolder = Folder(parameters.filePath);
var fileList = pdfFolder.getFiles("*.pdf");
// Iterate over each PDF file
for (var i = 0; i < fileList.length; i++) {
var pdfFile = fileList[i];
processPDF(pdfFile);
}
}
// Run the main function
main();
... View more