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
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

Advance your current skills or acquire new skills in Photoshop by creating projects using our step-by-step tutorials. More Tutorials: Most Popular Materials | Fresh Materials | TutorialKit New Photoshop Tutorials

Add comments to "New Art Layer"

Only registered users can write comment

No comments yet...