Tutorial: Write your first Photoshop script Creative

Ive already explained how to write a script for Illustrator using the ExtendScript toolkit in a previous tutorial. This time, Im scripting for Photoshop and Im also building a panel for my script using Adobe Configurator.

My Script: Export selected layer

There is a manual operation that I do ALL THE TIME in Photoshop: exporting a single layer to a single PNG or JPEG file. Every time, I copy the content of a layer, create a document, paste the content, save for the web, etc So I took the opportunity to create a script that will automate these tasks. You could use the classic Photoshop actions, but I like the freedom of coding to control the experience.

I showcase my script Export selected layer at the beginning of my video tutorial, but you can test it yourself in Photoshop. To do so, just open the Adobe Exchange panel in Photoshop and search for my name chaize, or type export. Youll be able to install and test my script.

The video tutorial: Develop a script for Photoshop in less than 15 minutes

Its in High Definition on YouTube. Enjoy:

My Script: The source code

Here is the source code of my script that exports the selected layer of your PSD to a transparent PNG:

If you have any questions, dont hesitate to post a comment.

In a future post, Ill explain how to distribute your panel on the Adobe Exchange marketplace, and Ill feature some cool scripts for Photoshop coders such as the xTools. Ive also been told that the pan PNG-Express is a professional script to produce PNG files from layers, with A LOT of features compared with my little script.


Previous
Next Post »