Skip to content

Instantly share code, notes, and snippets.

@quinn
Created March 11, 2009 17:31
Show Gist options
  • Save quinn/77594 to your computer and use it in GitHub Desktop.
Save quinn/77594 to your computer and use it in GitHub Desktop.
correct file extension is jsx, i changed it to js for syntax highlighting
preferences.rulerUnits = Units.PIXELS;
bgGrey = new SolidColor();
bgGrey.rgb.red = 255;
bgGrey.rgb.green = 255;
bgGrey.rgb.blue = 255;
backgroundColor = bgGrey;
var newDocumentRef = documents.add(89,36, 72.0, "Whattech Menu");
newDocumentRef = null;
var AD = activeDocument;
var textArray = [
"FRONT",
"BLOG",
];
brown = new SolidColor();
brown.rgb.hexValue = '643615';
white = new SolidColor();
white.rgb.hexValue = 'FFFFFF';
var bgLayer = AD.artLayers.add();
var TextLayer = AD.artLayers.add();
TextLayer.kind = LayerKind.TEXT;
var txtRef = TextLayer.textItem;
txtRef.font = "BellGothicStd-Black";
txtRef.size = 24.79;
txtRef.position = [44.5,27];
txtRef.justification = Justification.CENTER;
var options = new ExportOptionsSaveForWeb();
options.format = SaveDocumentType.PNG;
options.PNG8 = false;
for(a=0;a<textArray.length;a++) {
txtRef.contents = textArray[a];
txtRef.color = brown;
AD.activeLayer = bgLayer;
AD.selection.fill(white);
AD.exportDocument(new File('/Users/quinn/Documents/Adobe Scripts/nav-'+textArray[a]+'.png'), ExportType.SAVEFORWEB, options);
txtRef.color = white;
AD.activeLayer = bgLayer;
AD.selection.fill(brown);
AD.exportDocument(new File('/Users/quinn/Documents/Adobe Scripts/nav-'+textArray[a]+'-hover.png'), ExportType.SAVEFORWEB, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment