Crear un calendario en Photoshop

¿Como crear calendarios en Photoshop? Ya hemos visto como crear Calendarios en Corel, tambien como hacer calendarios en Illustrator con la ayuda de un script, ahora veremos como crear un en Photoshop, al igual que en Illustrator con la ayuda de un Script para automatizar el resultado.

Antes de empezar con el script te recomiendo que leas la Referencia Javascript de Adobe CS4

Este es el Calendario del tutorial:

calendarioPhotoshop 300x187 Crear un calendario en Photoshop

Este es el codigo del Script para crear el calendario en Photoshop::

// DEFINE AUXILIARY FUNCTIONS
function daysInMonth(month, year){
return 32 – new Date(year, month, 32).getDate();
}

function makeDay(d){
if(d < 10)
d = “0″ + d;
return d + ” “;
}

// DOC. ATTRIBUTES
width = 1280;
height = 800;
resolution = 72;
docName = “PhotoshopScriptCalendar”;
year = 2010;

// COLOR SCHEME
normalColor = new SolidColor();
normalColor.rgb.hexValue = “FFFFFF”;
highlightColor = new SolidColor();
highlightColor.rgb.hexValue = “A4B1D1″;
backColor = new SolidColor();
backColor.rgb.hexValue = “1B4392″;

// DEFINE VARIABLES FOR TEXT LAYERS
monthHeader = “M T W T F S \r\r”;
sundayHeader = “S\r\r”;
firstIndent = ” “;
months = new Array(“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”);

// CREATE THE NEW DOCUMENT
doc = app.documents.add(width, height, resolution,
docName, NewDocumentMode.RGB);
doc.selection.selectAll();
doc.selection.fill(backColor);
doc.selection.deselect();

// SELECT BACKGROUNDIMAGE
file = app.openDialog();

if(file[0]){
app.load(file[0]);
backFile = app.activeDocument;
backFile.resizeImage(width, height);
backFile.selection.selectAll();
backFile.selection.copy();
backFile.close(SaveOptions.DONOTSAVECHANGES);
doc.paste();
doc.layers[0].name = “BackgroundImage”;
}

for(curr=0; curr<12; curr++){

x = curr % 4;
y= Math.floor(curr / 4);

group = doc.layerSets.add();
group.name = months[curr];

monthName = group.artLayers.add();
monthName.kind = LayerKind.TEXT;
monthName.name = months[curr];
monthName.textItem.color = normalColor;
monthName.textItem.size = 24;
monthName.textItem.kind = TextType.PARAGRAPHTEXT;
monthName.textItem.justification = Justification.RIGHT;
monthName.textItem.height = 35;
monthName.textItem.width = 145;
monthName.textItem.contents = months[curr];
monthName.rotate(-90);
monthName.textItem.position = new Array(55 + 300 * x, (202 + (210 * y)));

days = group.artLayers.add();
days.kind = LayerKind.TEXT;
days.name = “Days”;
days.textItem.Justification = Justification.CENTER;
days.textItem.color = normalColor;
days.textItem.size = 18;
days.textItem.position = new Array(85 + (300 * x), 70 + (210 * y));

sundays = group.artLayers.add()
sundays.kind = LayerKind.TEXT;
sundays.name = “Sundays”;
sundays.textItem.Justification = Justification.CENTER;
sundays.textItem.color = highlightColor;
sundays.textItem.size = 18;
sundays.textItem.position = new Array(287 + (300 * x), 70 + (210 * y));

text = monthHeader;
textSun = sundayHeader;

startDate = new Date(year, curr, 1);
n = startDate.getDay();

for(i=0; i
text += firstIndent;

d = 1;
while(d <= daysInMonth(curr, year)){
if(i == 6)
textSun += makeDay(d) + “\r”;
else{
text += makeDay(d);
if(i == 5)
text += “\r”;
}
i++;
d++;
if(i == 7)
i = 0;
}

days.textItem.contents = text;
sundays.textItem.contents = textSun;
}

// CREATE THE YEAR NUMBER LAYER
yearLayer = doc.artLayers.add();
yearLayer.kind = LayerKind.TEXT;
yearLayer.name = year;
yearLayer.textItem.contents = year;
yearLayer.textItem.size = 72;
yearLayer.textItem.color = highlightColor;
yearLayer.textItem.position = new Array(1050, 730);

// CREATE THE BOTTOM LINE
line = doc.artLayers.add();
line.name = “Line”;
region = Array(Array(80, 729), Array(1000, 729), Array(1000, 730), Array(80, 730));
doc.selection.select(region);
doc.selection.fill(normalColor)
doc.selection.deselect();

El Script deberás instalarlo en “Photoshop CS4/Presets/Scripts” en formato jsx, para ello utiliza el ExtendScript Toolkit que viene instalado en el Master collection CS4.

El tutorial está más que explicado en PSDTuts que es la fuente de este tutorial, en el que explican el codigo paso a paso.

Olvídate de estar creando calendarios en Photoshop de manera manual, ahora ya puedes hacerlo de una forma automatizada.

¿Este tutorial te ha sido de utilidad?

En una actualizacion que realizaron del tutorial recomiendan cambiar las lines 32 – 34 por las siguientes:

monthHeader = “M T W T F S \r\r”;
sundayHeader = ” S\r\r”;
firstIndent = ” “;

Espero que este tutorial te ayude a la creacion de futuros calendarios en Photoshop, además esto abre un nuevo abanico de posibilidades para la creacion de funciones en JavaScript y aplicarlas en Photoshop.

Via DiegoMattei

Articulos Relacionados:


7 Responses to “Crear un calendario en Photoshop”

  1. RT @solucionesseo: Crear un calendario en Photoshop http://bit.ly/crHDtH

  2. Crear un calendario en #Photoshop utilizando JavaScript http://bit.ly/crHDtH ✉ ENVÍA: @solucionesseo

  3. Studio ISB dice:

    Crear un calendario en #Photoshop http://bit.ly/9Siw4d

  4. RT @solucionesseo: Crear un calendario en Photoshop http://bit.ly/crHDtH

  5. RP {solucionesseo} crear calendario en Photoshop . http://bit.ly/dw9UjR

Leave a Reply

Copyright © 2011 · Tutoriales y Photoshop, All Rights Reserved.
Powered by Free Premium Wordpress Themes.