Mailing List AE-List@media-motion.tv ? Message #49335
From: David Torno <torno@sydefxink.com>
Subject: Re: [AE] comp name expression
Date: Tue, 04 Jun 2013 16:02:35 +0000
To: After Effects Mail List <AE-List@media-motion.tv>
Forgot to mention too, just save the text in textedit or notpad and change the file extension to .jsx instead of .txt.

Copy only the text starting from "/*    Rename..." all the way to the last "}".

Save the file to your Scripts folder, launch After Effects and it will appear in the Scripts menu under File.


--
David Torno
Visual Effects Artist and Supervisor
http://www.ghosttownmedia.com
david@ghosttownmedia.com
O: 213.739.2290
C: 818.391.6060
------------------------------------------------
http://www.sydefxink.com  (main portfolio)
http://aeioweyou.blogspot.com (vfx tutorials and AE scripts blog)
http://mactex.blogspot.com  (free textures blog)

-----Original Message-----
From: David Torno [mailto:torno@sydefxink.com]
Sent: Tuesday, June 4, 2013 08:57 AM
To: 'After Effects Mail List'
Subject: Re: [AE] comp name expression

This should change all comps in your project to the name of the first layer. As long as there is at least one layer in the comp. I through an error catcher on it too just incase.

/* Rename comp based on first layer name
Request from Daniel Velez on AE-List ©2013
*/
try{
var proj, totalItems, firstLayerName, compAry, totalComps;
proj = app.project;
totalItems = proj.numItems;

//Grab all comps
for(var i=1; i<=totalItems; i++){
curItem = proj.item(i);
if(curItem instanceof CompItem){
compAry[compAry.length] = curItem;
}
}

//Update comp names
totalComps = compAry.length;
app.beginUndoGroup("Change comp names");
for(var c=0; c<totalComps; c++ ){
if(compAry[c].numLayers > 0){
compAry[c].name = compAry[c].layer(1).name;
}
}
app.endUndoGroup();
}catch(err){
alert("Error at line #" + err.line.toString() + "\r" + err.toString());
}


--
David Torno
Visual Effects Artist and Supervisor
http://www.ghosttownmedia.com
david@ghosttownmedia.com
O: 213.739.2290
C: 818.391.6060
------------------------------------------------
http://www.sydefxink.com  (main portfolio)
http://aeioweyou.blogspot.com (vfx tutorials and AE scripts blog)
http://mactex.blogspot.com  (free textures blog)

-----Original Message-----
From: Daniel Velez [mailto:velez.daniel@gmail.com]
Sent: Tuesday, June 4, 2013 08:46 AM
To: 'After Effects Mail List'
Subject: Re: [AE] comp name expression

No im not in a hurry, that would be great!
Thank you

Dan

On Tue, Jun 4, 2013 at 11:36 AM, David Torno <torno@sydefxink.com> wrote:

> Expressions cannot change project item properties like name, width,
> height, etc... This is where a script comes into play. If you are not in a
> hurry, I can probably write one up for you as soon as I am at the office.
>
>
> David Torno
> Visual Effects Artist & Supervisor
> http://www.ghosttownmedia.com
> O: 213.739.2290
> C: 818.391.6060
> ---------------------
> http://www.sydefxink.com
> http://aeioweyou.blogspot.com
> http://mactex.blogspot.com
>
> "The most useless day is that in which we do not laugh"
> -Charles Field
>
> On Jun 4, 2013, at 7:59 AM, Daniel Velez <velez.daniel@gmail.com> wrote:
>
> > Hi Guys
> >
> > is there an expression that can name the comp automatically  as the name
> first layer on that comp?
> >
> >
> > Dan Velez
>
> +---End of message---+
> To unsubscribe send any message to <ae-list-off@media-motion.tv>
>



+---End of message---+
To unsubscribe send any message to <ae-list-off@media-motion.tv>



 
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to ListMaster