Trying to dtermine file size before file is saved

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
barcan
Newbie
Posts: 1
Joined: Sat May 28, 2005 9:13 pm

Trying to dtermine file size before file is saved

Post by barcan » Sat May 28, 2005 9:20 pm

Hi.
I am working in photoshop and need to save an image as JPG
but it has to be under 65K. If it is over 65K then I need to reduce the
JPG quality settings until the file size is under 65K.
How can I do this (in a macro) without actually saving the file and checking the file size many times.

Thanks for your help.

Barry

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat May 28, 2005 10:04 pm

I don[t have photshop here, but am guessing this type of approach might work:

Do in macro what you do manually:

1. Save File
2. Wait Window Open if file is too big. Have a time out for Wait Window Open.
3. If no size message, then Time Out will allow macro to continue to save.
4. If size message window comes up, then use MessageModal to alert you.

---------------------------------

If no error messsage, can only check size after saved, then:
Save file
FileSize>.......
If File size >65 then open file again in same Image Editor, Else Done.

-------------------------------------------
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts