2 Replies Latest reply: Sep 10, 2010 12:13 PM by Josiah S RSS

    Photoshop Logo Resizing Script

    Josiah S Community Member

      Im trying to build a script that is slightly complex. In short, the script will take logo images of any given dimensions and create eight different output files with a combination of horizontal/vertical dimensions and four different Layer Styles. Anyway, I don't have much experience with Photoshop scripting, and I've been looking through the official reference, but there are a few things I can't find.

       

      • How to resize either a layer or a selection with constrained proportions (ie, I only specify the height or width, and the object retains its original aspect ratio)
      • How to center a layer with a script. Without a script I would; select the whole document, Layers>Align Layers to Selection>Vertical Centers, Horizontal Centers.
        • The ability to move a layer or a selection would work as another option, but, suprisingly, I couldnt find how to do that either.
      • How to apply Layer Styles with specific parameters, How to Remove Layer Styles

       

      If anyone can help me with any of these, I would appreciate it! Thanks!

        • 1. Re: Photoshop Logo Resizing Script
          JJMack Community Member

          I think all of what you want to do can be done in an action which would be much easier then writing a script. 

           

          However there are script that you can download that can help you learn to order layers and add layer styles in a scripts for example http://morris-photographics.com/photoshop/scripts/sort-layers.html. Have not seen any that transforms layers or selections you may want to install the ScriptListener plugin and do some transforms to see if you can come up with a function to do the transforms you want, You may need to enter both width and height you should have no problem constraining the transform to the origimal aspevt ratio for you can get canvas size and layer size in a script.

           

          I think I may have done a major portion of what you want to do in an action.  My crafting actions package contains a sample action that add three watermarks to any size document and sizes the watermarks for the document size.  The three sample watermarks include a custom colored logo a custom shape and a custom text layer.

          Package

          http://www.mouseprints.net/old/dpr/JJMacksCraftingActions.zip

          Contains:

          Action Actions Palette Tips.txt

          Action Creation Guidelines.txt

          Action Dealing with Image Size.txt

          Action Enhanced via Scripted Photoshop Functions.txt

          CraftedActions.atn Sample Action set includes an example Watermarking action http://www.mouseprints.net/old/dpr/WM900x600.jpg

           

          Sample Actions.txt Photoshop CraftedActions set saved as a text file. This file has some additional comments I inserted describing how the actions work.

          12 Scripts for actions

          • 2. Re: Photoshop Logo Resizing Script
            Josiah S Community Member

            I ended up creating a set of actions. It's not completely automated, but I can now resize logos in a matter of seconds instead of a half hour. Thanks.