Copy link to clipboard
Copied
I work with large prints on Plotters and use many PDF and Tiff files. I found here a Script that makes my life a lot easier when I need to save PDF images .... It saves all the images in a "Roland-Prints" folder in the same directory. I need a script that does this same function only in TIFF format. Is it possible to make a modification to the script? Thank you..
Here is the script:
var docRef = app.activeDocument;
var imgName= docRef.name;
imgName = imgName.substr(0, imgName.length -4);
// Get name of Folder Path
var docFolder = docRef.fullName.parent;
var folderPath = docFolder.fsName;
// Create a sub-folder called PDFs in the working folder
var newPathFolder = new Folder( folderPath + "//Roland-Prints/");
newPathFolder.create();
// Flatten layers before saving
docRef.flatten();
// Save Options for PDFs
pdfFile = new File( folderPath + "//Roland-Prints/" + imgName + ".pdf")
pdfSaveOptions = new PDFSaveOptions()
pdfSaveOptions.PDFCompatibility = PDFCompatibility.PDF16;
pdfSaveOptions.colorConversion = false;
pdfSaveOptions.destinationProfile = "U.S. Web Coated (SWOP) v2";
pdfSaveOptions.embedColorProfile = false;
pdfSaveOptions.optimizeForWeb = true;
pdfSaveOptions.profileInclusionPolicy = false;
pdfSaveOptions.encoding = PDFEncoding.JPEG;
pdfSaveOptions.downSample = PDFResample.PDFBICUBIC;
// set to NONE to allow PDF Security Options. Permission is for Printing only. A common password
// needs to be added as soon as the file is saved without typing it in all the time
pdfSaveOptions.PDFStandard = PDFStandard.NONE;
pdfSaveOptions.downSampleSize = 200;
pdfSaveOptions.downSampleSizeLimit = 250;
pdfSaveOptions.layers = false;
pdfSaveOptions.preserveEditing=false;
pdfSaveOptions.jpegQuality = 12;
docRef.saveAs(pdfFile, pdfSaveOptions, true, Extension.LOWERCASE);
docRef.close(SaveOptions.DONOTSAVECHANGES);
Folder((fnp = (aD = activeDocument).fullName.parent + '/Roland-Prints/')).create()
aD.saveAs(File(fnp + aD.name), new TiffSaveOptions()), aD.close(SaveOptions.DONOTSAVECHANGES)
Copy link to clipboard
Copied
Add a save as section for tiff file here are the Tiff save options you can use.
Copy link to clipboard
Copied
This script I just found ... I have no idea how to modify, so I do not know how this information can help me! Anyway I'm grateful for the help and good intentions.
Copy link to clipboard
Copied
Here is the Adobe link ​Adobe Photoshop Scripting | Adobe Developer Connection
Copy link to clipboard
Copied
This is not helping me at all! designer is not programmer ... Thank you Lord.
Copy link to clipboard
Copied
tokuredit wrote:
This is not helping me at all! designer is not programmer ... Thank you Lord.
There is a difference between asking for help and asking someone to do your work for you.
I do not actually know JavaScript but I was a programmer when I was a working man. Using Photoshop actions I ran into imitations so I started hacking at Photoshop scripting. For I wanted to do some things that could not be done with Actions.
You found some Photoshop uses make work they did for themselves available for free to help others. I do the same and I also try to help other with hacking at Photoshop scripts. Photoshop scripting is programing and a little hacking can help a designer improve their workflow. IMO you should do your own work and it is OK to ask for help with hacking it.
As you found out it only took two lines.
Copy link to clipboard
Copied
JJMack, very grateful for your help and attention, sorry the way I expressed myself, I understood your words, happens that you do not learn programming from one moment to another, if you do not find complex and learned fast, congratulations! I just asked for a help, like many others like me. Any help is valid and I am grateful for the help of all who have always helped me here including the Lord. I think I'm going to be away for a while here and try to turn my resources around
Copy link to clipboard
Copied
Yes it is sometime strange how one become a programmer. In 1965 I was a happy young man employed by a business machine company as a repair man and I was good at repairing machines IMO. One day my boss Chuck called me into his office and took my tool bag away from me and handed me. A green Card and two books. The Principals of Operations IBM 360 and Basic Assembler Language. Then he said John your now a programmer. For the next 35 years a programmers I was. In 2002 I retired from their research lab. I know all about learning programming out of necessary.
Copy link to clipboard
Copied
Folder((fnp = (aD = activeDocument).fullName.parent + '/Roland-Prints/')).create()
aD.saveAs(File(fnp + aD.name), new TiffSaveOptions()), aD.close(SaveOptions.DONOTSAVECHANGES)
Copy link to clipboard
Copied
Kukurykus ... Which lines should I add your code to?
Copy link to clipboard
Copied
I don't understand what you mean, because it's completed code, just a short version of that you provided. Simply use it as it is, and it should save your (saved and) opened file in Photoshop as Tiff in Roland-Prints fodler.
Copy link to clipboard
Copied
I just want to swap everything that is PDF by Tiff only.
Copy link to clipboard
Copied
That's not possible. PDF has other saving options. Tiff has only those you see in that JJMack post.
Copy link to clipboard
Copied
Kukurykus You solved my problem, it worked! I added your code from line 16 left as I wanted. Thank you my friend.
var docRef = app.activeDocument;
var imgName= docRef.name;
imgName = imgName.substr(0, imgName.length -4);
// Get name of Folder Path
var docFolder = docRef.fullName.parent;
var folderPath = docFolder.fsName;
// Create a sub-folder called PDFs in the working folder
var newPathFolder = new Folder( folderPath + "//Roland-Prints/");
newPathFolder.create();
// Flatten layers before saving
docRef.flatten();
Folder((fnp = (aD = activeDocument).fullName.parent + '/Roland-Prints/')).create()
aD.saveAs(File(fnp + aD.name), new TiffSaveOptions()), aD.close(SaveOptions.DONOTSAVECHANGES)
Copy link to clipboard
Copied
It should work without lines 1 - 15. It's not needed part. You can try only my code and the result will be the same. I'm only not sure to the end about activeDocument.flatten(), but I think it's not needed as well.
Copy link to clipboard
Copied
It really works perfect! Boy, you were great, with only two lines solved my problem! Very good indeed .... Thank you my friend!
Copy link to clipboard
Copied
What for?
Copy link to clipboard
Copied
You confused threads, this one is not about pdfs but tiffs.