Expression request: Updating slate
Posted: March 23rd, 2008, 6:56 am
Hi Guy's
I'm trying without luck to modify this script to be an expression.
I want to create a text line slate with "date", "project name" and "comp. name", and want it to update every time the comp. is opened.
Thanks
>kenneth
---------------------------------------------
//
//
//Name Stamp by Lloyd Alvarez (July 2006)
// updated Dec 2007
//
//Creates a new Text Layer with the name of the Project
//
//
clearOutput();
app.beginUndoGroup("Project Name Stamp");
var myComp = app.project.activeItem;
var myProj = app.project.file;
if (myProj != null) // make sure proj is saved
{
var myProjName = myProj.name.replace(/%20/gi," ");
var selItems = app.project.selection;
var startPos = [myComp.width * 0.10, myComp.height * 0.15];
for (j=0; j < selItems.length; j++){
myLayer = selItems[j].layers.addText(myProjName);
myLayer.position.setValue(startPos);
writeLn("stamped comp # " + j);
}
app.endUndoGroup();
} else {
alert("You must save and name the project first!");
}
I'm trying without luck to modify this script to be an expression.
I want to create a text line slate with "date", "project name" and "comp. name", and want it to update every time the comp. is opened.
Thanks
>kenneth
---------------------------------------------
//
//
//Name Stamp by Lloyd Alvarez (July 2006)
// updated Dec 2007
//
//Creates a new Text Layer with the name of the Project
//
//
clearOutput();
app.beginUndoGroup("Project Name Stamp");
var myComp = app.project.activeItem;
var myProj = app.project.file;
if (myProj != null) // make sure proj is saved
{
var myProjName = myProj.name.replace(/%20/gi," ");
var selItems = app.project.selection;
var startPos = [myComp.width * 0.10, myComp.height * 0.15];
for (j=0; j < selItems.length; j++){
myLayer = selItems[j].layers.addText(myProjName);
myLayer.position.setValue(startPos);
writeLn("stamped comp # " + j);
}
app.endUndoGroup();
} else {
alert("You must save and name the project first!");
}