Copy link to clipboard
Copied
Hi guys
I want create folder name "Save" in destop
in this folder inside i want to seperate folder name "Low res" and "High Res"
less than 800 pixels images i want save low res folder
More then 800 pixels images i want save high res folder
Does this work?
...// use at your own risk;
#target photoshop
// the folders;
var saveFolder = createFolder("/Pfaffi 1.5TB/wegwerfen/Save");
var lowFolder = createFolder("/Pfaffi 1.5TB/wegwerfen/Save/Low res");
var hiFolder = createFolder("/Pfaffi 1.5TB/wegwerfen/Save/High Res");
// set to pixels;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// define file;
var myDocument = app.activeDocument;
var width = myDocument.width;
var height = myDocument.height;
//
Copy link to clipboard
Copied
less than 800 pixels images i want save low res folder
More then 800 pixels images i want save high res folder
What exactly do you intend save-wise? Save copy of open files, which format, move the originals …?
The folder-creation should be no problem, this may help you get started:
var theFolder = Folder("~/Desktop/Save");
if (theFolder.exists == false) {
theFolder.create()
}
else {};
Copy link to clipboard
Copied
save tiff format
Copy link to clipboard
Copied
Save as copy, flattened, …?
Copy link to clipboard
Copied
Hi guys
I want create folder name "Save" in destop
in this folder inside i want to seperate folder name "Low res" and "High Res"
less than 800 pixels images i want save low res folder
More then 800 pixels images i want save high res folder
Save tiff format
save Flatten images
Copy link to clipboard
Copied
This would save as a copy, leaving the layered file unchanged:
tifOpts = new TiffSaveOptions();
tifOpts.embedColorProfile = true;
tifOpts.imageCompression = TIFFEncoding.TIFFLZW;
tifOpts.alphaChannels = false;
tifOpts.byteOrder = ByteOrder.MACOS;
tifOpts.layers = false;
app.activeDocument.saveAs((new File("~/Desktop/Save/Low res/"+app.activeDocument.name+".tif")),tifOpts,true);
As for deciding on your target folder a simple if-clause (dependent on app.activeDocument.width and/or height) should be able to handle it.
Then adjust "~/Desktop/Save/Low res/" for the other case …
Copy link to clipboard
Copied
how i find out 800 pixel images
i want only save lower than 800 pixels files are saved in low res folder
bigger than 800 pixels images are saved in hires folder
please help me from the begining
Copy link to clipboard
Copied
It’s not much different from other issues that you have asked about previously.
// use at your own risk; #target photoshop // the folders; var saveFolder = createFolder("~/Desktop/Save"); var lowFolder = createFolder("~/Desktop/Save/Low res"); var hiFolder = createFolder("~/Desktop/Save/High Res"); // set to pixels; var originalRulerUnits = app.preferences.rulerUnits; app.preferences.rulerUnits = Units.PIXELS; // define file; var myDocument = app.activeDocument; var width = myDocument.width; var height = myDocument.height; // tif options; tifOpts = new TiffSaveOptions(); tifOpts.embedColorProfile = true; tifOpts.imageCompression = TIFFEncoding.TIFFLZW; tifOpts.alphaChannels = false; tifOpts.byteOrder = ByteOrder.MACOS; tifOpts.layers = false; // if smaller than 800 in both directions; if (height < 800 && width < 800) { myDocument.saveAs((new File(lowFolder+"/"+myDocument.name+".tif")),tifOpts,true) } else { myDocument.saveAs((new File(hiFolder+"/"+myDocument.name+".tif")),tifOpts,true) }; // reset; app.preferences.rulerUnits = originalRulerUnits; ////// create folder in not existant ////// function createFolder (thePath) { var theFolder = Folder(thePath); if (theFolder.exists == false) {theFolder.create()}; return(theFolder) };
Copy link to clipboard
Copied
Hi c.pfaffenbichler,
This script is Working now
But i have One Problem
when save this images the extention was came like this way
_Y8F2219.jpg (Source image)
_Y8F2219.JPG.tif (Output file)
i dont want .Jpg.tif
i only want
_Y8F2219.tif
this type of extension
Copy link to clipboard
Copied
You can amend that by for example using »slice« to cut the name.
myDocument.name.slice(0, x)
Just decide on an appropriate way to determine x, either in relation to myDocument.name.length or by the index of (a part of) ».JPG«.
Copy link to clipboard
Copied
sorry i cant understand this script
pls give me good solution
Copy link to clipboard
Copied
var name = myDocument.name.slice(0,myDocument.name.lastIndexOf("."));
if (height < 800 && width < 800) { myDocument.saveAs((new File(lowFolder+"/"+name+".tif")),tifOpts,true) } else { myDocument.saveAs((new File(hiFolder+"/"+name+".tif")),tifOpts,true) };
Copy link to clipboard
Copied
hi
please sorry about disturb You
(Adobe Photoshop.tif) when i rus this script i have this name
i want source file name whatever is there
i dont want create another name
and extension i need (.tif)
i dont want (.psd.tif, .jpg.tif) like two extension after source name
Copy link to clipboard
Copied
Does this work?
// use at your own risk;
#target photoshop
// the folders;
var saveFolder = createFolder("/Pfaffi 1.5TB/wegwerfen/Save");
var lowFolder = createFolder("/Pfaffi 1.5TB/wegwerfen/Save/Low res");
var hiFolder = createFolder("/Pfaffi 1.5TB/wegwerfen/Save/High Res");
// set to pixels;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// define file;
var myDocument = app.activeDocument;
var width = myDocument.width;
var height = myDocument.height;
// tif options;
tifOpts = new TiffSaveOptions();
tifOpts.embedColorProfile = true;
tifOpts.imageCompression = TIFFEncoding.TIFFLZW;
tifOpts.alphaChannels = false;
tifOpts.byteOrder = ByteOrder.MACOS;
tifOpts.layers = false;
// if smaller than 800 in both directions;
if (height < 800 && width < 800) {
myDocument.saveAs((new File(lowFolder+"/"+myDocument.name.slice(0,myDocument.name.length - 4)+".tif")),tifOpts,true)
}
else {
myDocument.saveAs((new File(hiFolder+"/"+myDocument.name.slice(0,myDocument.name.length - 4)+".tif")),tifOpts,true)
};
// reset;
app.preferences.rulerUnits = originalRulerUnits;
////// create folder in not existant //////
function createFolder (thePath) {
var theFolder = Folder(thePath);
if (theFolder.exists == false) {theFolder.create()};
return(theFolder)
};
Copy link to clipboard
Copied
thanks man now its work
Copy link to clipboard
Copied
And I think you owe c.pfaffenbichler a case of wine....
Copy link to clipboard
Copied
No thanks to the wine, no big friend of the stuff …
I had hoped sasientry would be able to piece the elements together, therefore I offered them in this fractured fashion … which prolonged the communication somewhat.