Skip to content

Instantly share code, notes, and snippets.

@lauripiispanen
Created August 30, 2012 08:13
Show Gist options
  • Save lauripiispanen/3524052 to your computer and use it in GitHub Desktop.
Save lauripiispanen/3524052 to your computer and use it in GitHub Desktop.
Adobe Hello, World ExtendScript example
// Hello Word Script
// Remember current unit settings and then set units to
// the value expected by this script
var originalUnit = preferences.rulerUnits
preferences.rulerUnits = Units.INCHES
// Create a new 2x4 inch document and assign it to a variable
var docRef = app.documents.add( 2, 4 )
// Create a new art layer containing text
var artLayerRef = docRef.artLayers.add()
artLayerRef.kind = LayerKind.TEXT
// Set the contents of the text layer.
var textItemRef = artLayerRef.textItem
textItemRef.contents = "Hello, World"
// Release references
docRef = null
artLayerRef = null
textItemRef = null
// Restore original ruler unit setting
app.preferences.rulerUnits = originalUnit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment