AE Script: Function to directly refer to a Project Item by Name

Posted on Monday, 13 August 2007

Interested in a landing page video for your business? Contact us today!

Selected portfolio work samples:

SOFI K – Fall Back Down (Official Lyric Video) - Sundstedt Animation
SOFI K - Animated Lyric Video
The Big Balloon to the Moon Animated Music Video
Karl Baudoin - Animated Music Video
Wonder - Animated Music Video
Wonder - Animated Music Video
Catch a glimpse Official Music Video - Sundstedt Animation
Catch a glimpse - Animated Music Video
The Old Red Rooster Music Video
The Old Red Rooster - Animated Music Video
Kÿpe Poka Animated Rap Music Video
Poka - Animated Music Video
Lush Animated Music Video - Mother - Sundstedt Animation
Lush - Animated Music Video
Francis Martin – Mind Come Up (Trinity) [Official Music Video]
Francis Martin – Animated Music Video
Pale White Guy Animated Music Video - Sundstedt Animation
Live - Animated Music Video
Cayman Dance Animated Music Video - Sundstedt Animation
Cayman Dance - Animated Music Video
Glasgow City Council - Sundstedt Animation
Glasgow City Council – Animated Explainer Video
International Diabetes Federation - Taking Diabetes to Heart - Sundstedt Animation
IDF - Animated Campaign Video
DPRAA Animated Explainer Video
DPRAA - Animated Explainer Video
KiDS Educational Whiteboard Video
IDF KiDS - Educational Whiteboard Video
ADP Animations - North Ayrshire Council - Sundstedt Animation
ADP Animated Series
ECO-Schools Explainer Video by Sundstedt Animation
Eco-Schools - Animated Explainer Video
Pfizer Explainer Video
Pfizer - Pharmaceutical Explainer Video
Fewer Funerals Animated Explainer Video
Fewer Funerals - Animated Explainer Video
The Black Sheep - Animated Music Video
The Black Sheep - Animated Music Video
Glasgow University SHLC Animated Educational Video by Sundstedt Animation (21)
Glasgow University - Animated Educational Video
HAMMER - Wolfman (Music Video) - Sundstedt Animation
Wolfman - Animated Music Video (loops)
Phylli Sinclair - Sundstedt Animation
Phyllis Sinclair – Animated Music Video (Loop)
Title Sequences by Sundstedt Animation
Lofi Girl - Animated Music Video Loops
Microsoft Whiteboard Video - Sundstedt Animation
Microsoft - Windows Whiteboard Video
Windows Enterprise med Software Assurance
Windows Enterprise Software Assurance - Whiteboard Video
Windows Defender Advanced Threat Protection
Windows Defender - Whiteboard Video
Windows As A Service VideoScribe
Windows As A Service - Whiteboard Video
Kom igång med Windows i molnet - VideoScribe - Anders Sundstedt
Kom igång med Windows i molnet - Whiteboard Video
Duraflor Animated Explainer Video
Duraflor - Animated Explainer Video
BLS Animation - Sundstedt Animation
British Sign Language - Animated Infographics
100 Years in Marketing Explainer Video - Sundstedt Animation
100 Years in Marketing - Animated Explainer Video
Triple Card Holder - Sundstedt Animation
Triple Card Holder - Introduction Video
lamp

The AE function written to refer to a Project Item by Name

I wrote this function to allow you to directly refer to a Project item by it’s name (assuming you know the name). This way you do not have to use the index number for the item, something I didn’t like when writing scripts:

function projectItem(name)
{
var items = app.project.items;
i = 1;
while (i <= items.length) {
  if (items[i].name == name)
 {
  return app.project.item(i);
  break;
  }
i++;
}
}

And here is an example of using it. Assuming there is a folder named ‘folder’ in the Project Window:

newComp = projectItem("folder").items.addComp("Lower-Level Comp", 640, 480, 1.0, 5.0, 25.0);

Ready To Partner?


Back To Top

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Don`t copy text!