When you save files in Photoshop through user interface, you can preview file size, depending on the parameters you choose.
Is there any way to do this in script?
For example you want to fit file size to some value.
You check file size, if it is too big, you lower the quality of the file etc.
Getting file size when saving file.
Getting file size when saving file.
There have been lengthy threads about this at the Adobe scripting forum. The short answer is NO, you cannot other than reading the file size after the file has been saved. It is possible to create an iterative mechanism that keeps resaving the file until it falls into some size target range however it is likely to be very slow and inefficient.
Andrew
Andrew