Approve the Cookies
This website uses cookies to improve your user experience. By using this site, you agree to our use of cookies and our Privacy Policy.
OK
Forums  •   • New posts  •   • RTAT  •   • 'Best of'  •   • Gallery  •   • Gear
Guest
Forums  •   • New posts  •   • RTAT  •   • 'Best of'  •   • Gallery  •   • Gear
Register to forums    Log in

 
FORUMS Post Processing, Marketing & Presenting Photos RAW, Post Processing & Printing 
Thread started 30 May 2008 (Friday) 08:03
Search threadPrev/next
sponsored links (only for non-logged)

Save for Web: a script that might help you with LR/CS3 automation

 
lkrms
"stupidly long verbal diarrhoea"
Avatar
4,558 posts
Likes: 1
Joined Jun 2006
Location: Newcastle, Australia
     
May 30, 2008 08:03 |  #1

I'm a bit obsessive about automating stuff, so a big bugbear of mine has been the lack of support for "Save for Web" in Photoshop actions (particularly when it comes to picking which folder images go to).

With moving to Lightroom and wanting to supply watermarked images for my clients to use on the web, I decided to have another go at this. With Lightroom's support for droplets on export, all I needed was an action that could save and close the currently open file ... with Save for Web.

The only way to do it is with a script. Here's what I put together:

// saveForWeb.jsx
// (c) 2008 one fine day photography
// ofdphoto.com
//
// $Id$
//
// WARNING: this script deletes and replaces the currently open file.
// For good measure, it also closes it.
//

var options = new ExportOptionsSaveForWe​b();
options.format = SaveDocumentType.JPEG;
options.quality = 70;

var doc = app.activeDocument;
var file = new File(doc.fullName.fsNa​me);
file.remove();
doc.exportDocument(fil​e, ExportType.SAVEFORWEB, options);
doc.close(SaveOptions.​DONOTSAVECHANGES);

Put this in a file (called, say, saveForWeb.jsx ;) ) and when recording an action, use File > Scripts > Browse... to find and run it. This should be the last step of your action, as it will close the file.

Bear in mind that it deletes and overwrites the original file. This is dandy given how droplet-friendly Lightroom is.

Hope it helps somebody. Save for Web makes such a difference to file sizes and quality ...

Luke
Headshot photographer Sydney and Newcastle (external link) | Twitter (external link) | Facebook (external link) | Blog (external link)

  
  LOG IN TO REPLY
nutsnbolts
Goldmember
Avatar
2,279 posts
Joined Jul 2007
Location: New Jersey, USA
     
May 30, 2008 22:17 |  #2

I don't understand where is this used? As a droplet?


Canon EOS 40D | EOS Rebel XTI/400D | G9
Lenses and Gear List
Review of my ThinkTank Gear

  
  LOG IN TO REPLY
lkrms
THREAD ­ STARTER
"stupidly long verbal diarrhoea"
Avatar
4,558 posts
Likes: 1
Joined Jun 2006
Location: Newcastle, Australia
     
May 31, 2008 00:54 |  #3

I use it at the end of actions that I then convert to droplets and use from Lightroom.


Luke
Headshot photographer Sydney and Newcastle (external link) | Twitter (external link) | Facebook (external link) | Blog (external link)

  
  LOG IN TO REPLY
cdifoto
Don't get pissy with me
Avatar
34,090 posts
Likes: 44
Joined Dec 2005
     
May 31, 2008 01:01 |  #4

So basically you just paste that text (customized) into a text file, save it as a jsx extension, then run it in PS? I don't understand why you'd want to over-write your original file though. Wouldn't it be better to specify a new folder and drop it into that instead? Is that even possible?


Did you lose Digital Photo Professional (DPP)? Get it here (external link). Cursing at your worse-than-a-map reflector? Check out this vid! (external link)

  
  LOG IN TO REPLY
lkrms
THREAD ­ STARTER
"stupidly long verbal diarrhoea"
Avatar
4,558 posts
Likes: 1
Joined Jun 2006
Location: Newcastle, Australia
     
May 31, 2008 01:02 |  #5

Ya. Nothing revolutionary, it just saves the hassle of moving files after every Save for Web batch.


Luke
Headshot photographer Sydney and Newcastle (external link) | Twitter (external link) | Facebook (external link) | Blog (external link)

  
  LOG IN TO REPLY
cdifoto
Don't get pissy with me
Avatar
34,090 posts
Likes: 44
Joined Dec 2005
     
May 31, 2008 01:05 |  #6

Don't worry I'm not trying to be a bear on this. I think it's a great idea. The SFW popup is annoying as heck. :p

I don't see a parameter in the code for resizing though so I'm confused a bit. Do you run this on already resized images? In other words, use a Save As command initially and specify the folder the image goes into, and then immediately after, the script follows up with a "open, save, delete old"?


Did you lose Digital Photo Professional (DPP)? Get it here (external link). Cursing at your worse-than-a-map reflector? Check out this vid! (external link)

  
  LOG IN TO REPLY
cdifoto
Don't get pissy with me
Avatar
34,090 posts
Likes: 44
Joined Dec 2005
     
May 31, 2008 01:11 |  #7

Hmm. Tried to use it on PS7 but it won't work. PS7 doesn't recognize jsx extensions and then I get an error that Line 11 does not have a constructor when I try to run it as a js.

Boo!


Did you lose Digital Photo Professional (DPP)? Get it here (external link). Cursing at your worse-than-a-map reflector? Check out this vid! (external link)

  
  LOG IN TO REPLY
lkrms
THREAD ­ STARTER
"stupidly long verbal diarrhoea"
Avatar
4,558 posts
Likes: 1
Joined Jun 2006
Location: Newcastle, Australia
     
May 31, 2008 01:16 |  #8

Sorry, I'll explain more:

I do everything except the saving bit in a normal Photoshop action. Resizing, watermarking, framing, etc. Then, at the end of the action I do this save for web scripty bit.

Why overwrite the currently open file? Well, because this made the most sense within my Lightroom workflow. Now I can batch a set of JPEG's out of Lightroom, assign a droplet to run after export, and I only have one set of JPEG's at the end of the procedure. It does mean I waste a bit of CPU time (by generating a new set of JPEG's for each export), but it's a one-click procedure and I like coffee, so I don't really care.

You could experiment with adding "Save As" to your action, before running this script, to pick up Photoshop's automatic overriding of Save/Save As targets before doing Save for Web, but test this at your own risk!


Luke
Headshot photographer Sydney and Newcastle (external link) | Twitter (external link) | Facebook (external link) | Blog (external link)

  
  LOG IN TO REPLY
lkrms
THREAD ­ STARTER
"stupidly long verbal diarrhoea"
Avatar
4,558 posts
Likes: 1
Joined Jun 2006
Location: Newcastle, Australia
     
May 31, 2008 01:17 |  #9

cdifoto wrote in post #5629288 (external link)
Hmm. Tried to use it on PS7 but it won't work. PS7 doesn't recognize jsx extensions and then I get an error that Line 11 does not have a constructor when I try to run it as a js.

Boo!

:( That sucks. Save for Web must have a different API in PS7.


Luke
Headshot photographer Sydney and Newcastle (external link) | Twitter (external link) | Facebook (external link) | Blog (external link)

  
  LOG IN TO REPLY
cdifoto
Don't get pissy with me
Avatar
34,090 posts
Likes: 44
Joined Dec 2005
     
May 31, 2008 01:19 |  #10

Must be. I tried removing the "ExportOptions" part and having it as just "SaveForWeb" but that didn't help. I'm code-dumb so that's about as far as I know to try at this point. Like you, I enjoy coffee so it doesn't bother me to run something and walk away from it. I do already batch into a folder but I use SaveAs. It'd be nice to get those files smaller using the SaveForWeb though...if for no other reason than my web proofing.


Did you lose Digital Photo Professional (DPP)? Get it here (external link). Cursing at your worse-than-a-map reflector? Check out this vid! (external link)

  
  LOG IN TO REPLY
lkrms
THREAD ­ STARTER
"stupidly long verbal diarrhoea"
Avatar
4,558 posts
Likes: 1
Joined Jun 2006
Location: Newcastle, Australia
     
May 31, 2008 02:32 |  #11

I've gone hunting for Photoshop 7 documentation, and found very little of it :( Sorry.


Luke
Headshot photographer Sydney and Newcastle (external link) | Twitter (external link) | Facebook (external link) | Blog (external link)

  
  LOG IN TO REPLY
cdifoto
Don't get pissy with me
Avatar
34,090 posts
Likes: 44
Joined Dec 2005
     
May 31, 2008 02:34 |  #12

Eh no shakes. It's not a huge deal since my website auto-generates thumbs usually under 8K and those are loaded by default. The ~50K images load pretty fast when it's just one at a time (I only proof at 435px on the long side). I was hoping to eek out about 30K though. :D

EDIT: I just remembered I can batch the small proof files in IrfanView & squeeze out smaller files without EXIF and such.


Did you lose Digital Photo Professional (DPP)? Get it here (external link). Cursing at your worse-than-a-map reflector? Check out this vid! (external link)

  
  LOG IN TO REPLY
2tall
Member
92 posts
Joined Feb 2002
Location: San Francisco
     
Jul 08, 2008 02:48 |  #13

linarms, thanks for this. i was specifically looking for the solution to bypass the "overwrite?" prompt in my workflow. i had always found a way to get around it... but in my latest round of streamlining my workflow, this one thing really bugged me.




  
  LOG IN TO REPLY
lkrms
THREAD ­ STARTER
"stupidly long verbal diarrhoea"
Avatar
4,558 posts
Likes: 1
Joined Jun 2006
Location: Newcastle, Australia
     
Jul 08, 2008 03:28 |  #14

No worries :) Glad it helped you.


Luke
Headshot photographer Sydney and Newcastle (external link) | Twitter (external link) | Facebook (external link) | Blog (external link)

  
  LOG IN TO REPLY
sponsored links (only for non-logged)

5,450 views & 0 likes for this thread, 4 members have posted to it.
Save for Web: a script that might help you with LR/CS3 automation
FORUMS Post Processing, Marketing & Presenting Photos RAW, Post Processing & Printing 
AAA
x 1600
y 1600

Jump to forum...   •  Rules   •  Forums   •  New posts   •  RTAT   •  'Best of'   •  Gallery   •  Gear   •  Reviews   •  Member list   •  Polls   •  Image rules   •  Search   •  Password reset   •  Home

Not a member yet?
Register to forums
Registered members may log in to forums and access all the features: full search, image upload, follow forums, own gear list and ratings, likes, more forums, private messaging, thread follow, notifications, own gallery, all settings, view hosted photos, own reviews, see more and do more... and all is free. Don't be a stranger - register now and start posting!


COOKIES DISCLAIMER: This website uses cookies to improve your user experience. By using this site, you agree to our use of cookies and to our privacy policy.
Privacy policy and cookie usage info.


POWERED BY AMASS forum software 2.58forum software
version 2.58 /
code and design
by Pekka Saarinen ©
for photography-on-the.net

Latest registered member is semonsters
1695 guests, 139 members online
Simultaneous users record so far is 15,144, that happened on Nov 22, 2018

Photography-on-the.net Digital Photography Forums is the website for photographers and all who love great photos, camera and post processing techniques, gear talk, discussion and sharing. Professionals, hobbyists, newbies and those who don't even own a camera -- all are welcome regardless of skill, favourite brand, gear, gender or age. Registering and usage is free.