AE ENHANCERS

Expressions/Scripts/Presets
It is currently Thu Apr 17, 2014 5:30 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Expression request: Updating slate
PostPosted: Sun Mar 23, 2008 6:56 am 
Offline

Joined: Mon Mar 17, 2008 3:25 pm
Posts: 7
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!");

}


Top
 Profile  
 
 Post subject: Re: Expression request: Updating slate
PostPosted: Fri Apr 04, 2008 1:14 pm 
Offline
Enhancement master
User avatar

Joined: Thu Jun 17, 2004 9:27 am
Posts: 458
Location: New York City, NY
Hey Kenneth,

The reason I wrote it as a script is because you can't access the project name from expressions. You can get date and comp name, though.

You can get the date like this:


Code:
parts = Date(0).toUpperCase().split(" ");
parts[0] + " " + parts[1] + " " + parts[2] + " " + parts[3]


And you can get the Comp Name like this:

Code:
thisComp.name


-Lloyd

_________________
http://aescripts.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group