Here you\'ll find tutorials that don\'t belong to either of the above categories. This is the place for the most extraordinary materials.  Home Photoshop Miscellaneous New Art Layer

New Art Layer


New Art LayerIf you are new to scripting for Photoshop, please view our Photoshop Scripting Basics tutorial for an introduction to Photoshop scripting and a few exercises about basic JavaScript.

1. Check for an opened document so that this script will only run if there is an opened document.

if (documents.length > 0) {

}


2. Type in add(); to tell the script we want to add something.

if (documents.length > 0) {
add();
}


3. Now we can tell the script that we want to add a layer. Type in artLayers followed by a period.

if (documents.length > 0) {
artLayers.add();
}


4. Finally, we need to tell the script which opened document to add the layer to. Type in activeDocument followed by a period.

if (documents.length > 0) {
activeDocument.artLayers.add();
}


5. We can also create a name for the layer. Type in .name = followed by the title. Because the title is a string, don't forget to add quotations around it.

if (documents.length > 0) {
activeDocument.artLayers.add().name = "My Photoshop Layer";
}

Save the script and run it inside Photoshop (File> Scripts> Browse). If the script does nothing, it means that you don't have any documents opened for it to create a new layer for.



Author's URL: FotoFects
Final results of our readers
New!
Passed through all the steps? Share your result!
Your result will be premoderated.
Please make sure you choose the right image.
 
 



Captcha

*Required fileds
Here you\'ll find tutorials that don\'t belong to either of the above categories. This is the place for the most extraordinary materials. More Miscellaneous Tutorials: Featured Materials | Fresh Materials | TutorialKit New Photoshop Tutorials

No comments yet...
Add comments to "New Art Layer"

Captcha