3 Replies Latest reply on Jun 15, 2012 7:36 AM by Glenn Broadway

    Will I be able to achieve this with scripting?

    Glenn Broadway

      Here's my current workflow:


      I have a single master PSD file for an icon set. It has over 100 icons within it, each drawn as (sometimes multiple) vector layers withing a layer group. These icons need to be resized and styled for a number of different target platforms (mobile operating systems). Here's what I do.


      1. Resize the master image (I do this rather than using the export size inside Layer Saver as it gives cleaner resuts - my vectors are all drawn on a 64 pixel grid).

      1.a. Optionally run an action which adjusts the canvas size (I need this for some platforms which have odd sized icons).

      2. Run the LayerSaver script to export each icon as a PNG (black on transparent) into a named sub-folder.

      2.a. Optionally copy a folder full of exported icons into a another folder ready for 2.b (or I could re-export again using Layer Saver).

      2.b. Optionally apply a style to all the icons in the folder previously created (I use Batch Process and an Action for this - I can't use the action within Layer Saveras it needs to apply the style to the final PNG).


      The things is I'm up to about 12 different sets of icons now and it takes ages to save them all out. I suppose my ideal situation would be to have a script which includes the export of each icon type, into a designated sub-folder within a target folder. Then I could launch the script to get a control panel that has checkboxes for all the various targets and I could just hit go, safe in the knowledge that every icon will be saved for every platform.


      I'm not even sure who created the Layer Saver script, although it was referenced in this thread http://forums.adobe.com/message/4164611 and Paul Riggott seem like he might be an authority.


      Is this something I could achieve. I'm completely new to scripting, but I work in an office full of coders so hope that one of them could help me out.


      Thanks, Glenn.

        • 1. Re: Will I be able to achieve this with scripting?
          Paul Riggott Level 6

          Hi Glenn, yes I wrote the Layer Saver script.


          I'm not sure what I can do to help, it seems as if you would require a custom script.

          What menu option in Layer Saver are you using?

          • 2. Re: Will I be able to achieve this with scripting?
            Glenn Broadway Level 1

            HI Paul. Firstly, thanks so much for Layer Saver! It really is invaluable...


            I don't have Ps in front of me so I can't tell you the exact name, but I only ever use one option - which saves each layer sets as an image (without the background).


            I notice that Layer Saver seems to create a new file for each image it saves, looping through all the groups. I suppose the first stage in my process would be to create a new loop above that - in that it would be creating a process for each size. I imagine the dialog would have a section for each icon size and type, so if I checked on iOS 32, iOS 48 and iOS 64 it would run through the layer saver process three times, creating a subfolder for each type.


            It's important that the image is resized using Image Size before rasterisation. For some icons it's actually a 3 stage process (reduce canvas size, reduce image size, increase canvas size).


            And then finally I also need to run an action on some of the resulting PNGs to apply a style to the black icon.


            I've studied the code for your (and other) scripts and I have to say it's beyond me. If I was being cheeky (I am!) I would ask for this:


            A version of Layer Saver with an extra section at the top called 'ouput subfolders' with two checkboxes in it (named something like 'type a' and 'type b'). If checked then Layer Saver would loop through the export saving all the images multiple times (once for each folder).


            This would give me the chance to get going by renaming Type A to iOS32 for example and working on adding an Image Size = 32x32 into that part of the script. I could then gradually build up all my custom export modules, if that makes sense?


            If you are interested in helping me out perhaps we could pick this up on email? I don't even know if this is just something you do in your spare time...

            • 3. Re: Will I be able to achieve this with scripting?
              Glenn Broadway Level 1

              I've just found your amazing Picture Processor script Paul. This will help me through about half of my workflow. I'm still interested in talking about some custom work if you're up for it? Otherwise - many thanks!