Skip to main content
Participant
May 15, 2017
Question

Save For Web Animated GIF - with saved settings script.

  • May 15, 2017
  • 1 reply
  • 1776 views

I've automated via actions and a macro to save out a single PSD setup for animation as a GIF in 11 different languages. The languages are defined within the source PSDs on layers. There are about 70 PSDs in total with different dimensions (same animation) but different composition based on dimensions - The actions turn on and off said layers and export.

Actions:

Turn off layer (language one)

Turn on layer (language two)

>Export (with dialog on)

Macro takes over and appends an underscore and a 2 character code for language like _EN at the end of the file name for language. Then saves.

The actions repeat until the full run of languages are exported. 11 in total for 70+ PSDs

My biggest hangup is that I have to save the GIFs to a particular file size limit - Like 300kb for example. So for each PSD with a particular dimension - I set up the file previous to exporting, then "Save for Web",  Optimize, and click Done to bake the optimization into the PSD. Which works great. All I have to do then is run my action once and run a macro - then sit back until it completes. What I have noticed is that having to have the dialog window come up for "Save for Web" can take at times, minutes to fully show as it tries to preview. Which eats up a lot of time throughout the entire process.

The problem I face is that I have to invoke the "Save for Web" dialog box for each language so that the macro can take over, and append the lang code at the end of the filename along with keeping the baked in optimization setting for each PSD.

I have used the ScriptListener to see whats going on to try and script some of this process to bypass the "Save for Web" dialog window. But every time I try to test it out based on the JS that's spit out.. The baked in optimization settings are no longer used.

I'm not looking for someone to write the code for me, but rather some direction on how I could potentially achieve a more streamlined way. That said I'm not a coder, but am not afraid to get my hands dirty.

If I could remove the use of macros for file naming and the "save for web" dialog window I could shave hours off this daunting process. I have used variable datasets for another case where just text is changed, and when exporting animated GIF without any file size limitations - I was able to generate updated PSDs, and export animated GIFs (with no use of the "save for web" dialog window) in under 10 minutes. So it got me thinking I could potentially refine my other process further and save heaps of time. There doesn't seem to be a lot of information with scripting the "Save for Web" for animated GIFs with saved settings. Any information on this would be greatly appreciated.

Thanks!

Chris

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
May 16, 2017

I think the reason there has been no response is the we know what  Photoshop Actions are.  We are not sure what your Macro is.

I think if I wanted to do what you are doing that I would create your PSD Template file and 11 Actions one for each language and use a custom Photoshop script something like Image Processor pro where I could process the Template Image files with the 11 Actions and have the Script save the output Aninated gif file where I want them with the names I want.

The Image Processor Pro can process PSD files and save out  Gif files and does have a use save for  web. Option however it limited to 10 output sets thus 10 Actions.. I also thin its output file would be just a gif nou and animated gif but I am not sure because the is that save for web check box I never tried to see what would happen

If there is only one PSD template file.  It would be far easier to run 11 Actions on that PSD where each Actions save for web step is an interactive step so you can manually enter the filenames and chose where to save. Then writing a script as complex as  the Image Processor Pro.

Edit I was correct I just processed a PSD that has a frame Animation timeline the GIF save by Image Processor Pro was not an animated Git it was just the first Frame of the animation.

JJMack
facecjfAuthor
Participant
May 16, 2017

Thanks for the detailed response JJMack!

My macro basically waits for the save for web window - Takes over and automatically hits "save" and when the "Save optimized as" window appears - it then appends the language code "_EN" or which ever language it's on - to the end of the file name and hits enter. Then it waits and allows the next set of actions to run. It repeats this process until the set is done.

It's not the most elegant approach - but works for my needs.

I also tested Image Processor Pro, sadly no animation :/  I'll have to figure out a way to use a script to handle this and try to speed this up.

Thanks again!