How to add dimension in batch rename
hi all
in File property we have *dimension (in cm)* how to add this value to existed name in batch renaming for example ... name.tiff -> 12,3x45,6cm_name.tiff
hi all
in File property we have *dimension (in cm)* how to add this value to existed name in batch renaming for example ... name.tiff -> 12,3x45,6cm_name.tiff
This should be close....
#target bridge
if( BridgeTalk.appName == "bridge" ) {
var menuDel = MenuElement.create("command","Add size to Filename", "at the end of Tools","Addcmtofilename");
}
menuDel.onSelect = function () {
var sels = app.document.selections;
for(var a in sels){
var myThumb = new Thumbnail( sels);
var Resolution = myThumb.core.quickMetadata.xResolution;
if(Resolution == 0) Resolution = 72;
var CM = Resolution /2.54;
var Height = (myThumb.core.quickMetadata.height/CM).toFixed(1);
var Width = (myThumb.core.quickMetadata.width/CM).toFixed(1);
var newFileName = Width.toString() + "x" + Height.toString() +"cm_" + decodeURI(sels.name);
sels.spec.rename(newFileName);
}
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.