Learn ADABAS-SCRIPTING with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Create a New Document in Photoshop
var doc = app.documents.add(800, 600, 72, 'New Document');
Create a new Photoshop document with specific dimensions.
2
Add a Text Layer
var textLayer = app.activeDocument.artLayers.add();
textLayer.kind = LayerKind.TEXT;
textLayer.textItem.contents = 'Hello Adobe';
Add a text layer to the current document.
3
Resize the Active Document
app.activeDocument.resizeImage(1024, 768);
Resize the current document to new width and height.
4
Apply Gaussian Blur Filter
var layer = app.activeDocument.activeLayer;
layer.applyGaussianBlur(5);
Apply a Gaussian blur filter to the active layer.
5
Export Document as PNG
var file = new File('~/Desktop/output.png');
var opts = new PNGSaveOptions();
app.activeDocument.saveAs(file, opts, true);
Save the current document as a PNG file.
6
Loop Through All Layers
var layers = app.activeDocument.layers;
for(var i = 0; i < layers.length; i++) {
$.writeln(layers[i].name);
}
Iterate through all layers and print their names.
7
Duplicate Layer
var original = app.activeDocument.activeLayer;
var copy = original.duplicate();
copy.name = 'Copy of ' + original.name;
Duplicate the active layer in the document.
8
Change Fill Color of Shape Layer
var shapeLayer = app.activeDocument.activeLayer;
var color = new SolidColor();
color.rgb.red = 255;
color.rgb.green = 0;
color.rgb.blue = 0;
shapeLayer.fillColor = color;
Set the fill color of a shape layer to red.
9
Create a New Layer Group
var group = app.activeDocument.layerSets.add();
group.name = 'My Group';
Add a new layer group to organize layers.
10
Close Document Without Saving
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
Close the active document without saving changes.