Copy link to clipboard
Copied
hello there i need a script or action or else in adobe photoshop can multiple size dimentions height and weight by x100 and divide the resolution by x10 or as i set but this is auto apply for batch files opened after apply job then save as tage size example:-
embert_230x120cm.tiff
Copy link to clipboard
Copied
// 2020, use it at your own risk;
var myDoc = app.activeDocument;
var theWidth = myDoc.width;
var theHeight = myDoc.height;
var theResolution = myDoc.resolution;
myDoc.resizeImage(theWidth*10, theHeight*10, theResolution*0.1);
Copy link to clipboard
Copied
thanks you mr. c_pfaffenbichler ,
i try it but what about save as with tag size?
thanks in advanced
Copy link to clipboard
Copied
I would sugest using JavaScript it the only supported Photoshop Scriting language that is supported on bth PC and Mac machines.
Photoshop scripting guide 2020
Copy link to clipboard
Copied
thank you mr.jjmack ,
but i dont have knowledge about adobe photoshop scripting.
Copy link to clipboard
Copied
You seem to want a custom script for you workflow its your task to code it or hier a programmer and work with him to develop a procedure that will automate your work flow. What you want to do is not something that is commonly done. You are not going to find an existing script the does your workflow. You will need to develop or help develop what you want. An action will not be able to be recorded to automate what you want automated. What you want requires programming.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
thank you
Copy link to clipboard
Copied
More info is required.
Are the files always saved as TIFF? If so what options/settings? Or will the files be different format saves depending on the original file input?
Are the files being saved to the input location or elsewhere?
What is the original filename?
embert.tiff
embert_230x120cm.tiff
Should the script handle the batch open and save? Or will you use another method such as Batch or Image Processor to handle the bulk open/saves?
Copy link to clipboard
Copied
thanks mr. Stephen_A_Marsh ,
all files in tiff , and files opened save in same location or else no important i do save in image porccessor
original file name is :- embert.tiff
and i need the script do open and save
Copy link to clipboard
Copied
You wrote the above. When I read that I saw four statements I outline in red, Which lead me to believe you have some understanding about digital image processing that is wrong and you do not know how to put things together.
Starting from the bottom "230x120cm" looks a suffix you struck on a document name to denotes its print size in centimeters. Quite a big print. Above that there a tag for this size, But above that there some formulas for changing the document size that make no referencer to the tag or what the current size is that is being changed. The is no correlation to any particular size.
Dividing the print resolution by 10 the low resolution print Height and Width will be much larger then the 10X higher resolution print. A normalt print size doceument may well print 230x120cm
"multiple size dimentions height and weight by x100" Some clarification is need with that. If that means resample 100x that interpolation up in size would not go well and may exceed photoshop canvas size limit.
Copy link to clipboard
Copied
You tried the script from c_pfaffenbichler – how did it work for you?
You mentioned that it did not rename, this was by design, the resize is just one part of the entire process...
I tested on a file 23 x 12.01 cm @ 125 ppi (1132 x 591 px)
The result in Image > Image Size was reported as:
230.02 x 120.09 cm @ 12.5 ppi (1132 x 591 px)
A script can use the image size info to create the filename. I have added some more code to the offering by c_pfaffenbichler to illustrate:
var origUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.CM;
var myDoc = app.activeDocument;
var theWidth = myDoc.width;
var theHeight = myDoc.height;
var theResolution = myDoc.resolution;
myDoc.resizeImage(theWidth * 10, theHeight * 10, theResolution * 0.1);
var docName = myDoc.name.replace(/\.[^\.]+$/, '');
var printWidth = myDoc.width.value;
var printHeight = myDoc.height.value;
alert(docName + "_" + printWidth + "x" + printHeight);
app.preferences.rulerUnits = origUnits;
From a file named "test.tif" the result is:
test_230.0224x120.0912
I don't think that this is exactly what you are looking for.
Copy link to clipboard
Copied
Stephen they know nothing about Photoshop scripting so they could not test that script code for it not a completed script and it would fail with some preferences settings or some document conditions. IMO they also do not actually know what they want given what they wrote. You script developed an output file name but did not add the Tags suffix they wrote about and their resize description did not reference any tag information to see what resizing should be done. What they wrote does not compute.
I see this when I run your script No resize was done. Yes I cheated its DPI resolution was 1DPI to begin with.
a resolution of 0.1 would invalid and set to 1.... No change
Copy link to clipboard
Copied
.