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:

Catch a glimpse Official Music Video - Sundstedt Animation
Catch a glimpse - 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
The Old Red Rooster Music Video
The Old Red Rooster - Animated Music Video
Microsoft Whiteboard Video - Sundstedt Animation
Microsoft - Windows 10 Whiteboard Video
DPRAA Animated Explainer Video
DPRAA - Animated Explainer Video
Kÿpe Poka Animated Rap Music Video
Poka - Animated Music Video
Lush Animated Music Video - Mother - Sundstedt Animation
Lush - Animated Music Video
Fewer Funerals Animated Explainer Video
Fewer Funerals - Animated Explainer Video
The Black Sheep - Animated Music Video
The Black Sheep - Animated Music Video
KiDS Educational Whiteboard Video
IDF KiDS - Educational Whiteboard Video
Pfizer Explainer Video
Pfizer - Pharmaceutical Explainer Video
Eco-Schools-Explainer-Video-Sundstedt-Animation
Eco-Schools - Animated Explainer Video
Duraflor Animated Explainer Video
Duraflor - Animated Explainer 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
Windows 10 Enterprise med Software Assurance
Windows 10 Enterprise Software Assurance - Whiteboard Video
100-Years-in-Marketing-Explainer-Video
100 Years in Marketing - Animated Explainer Video
Windows 10 Defender Advanced Threat Protection
Windows 10 Defender - Whiteboard Video
Kom igång med Windows 10 i molnet VideoScribe
Kom igång med Windows 10 i molnet - Whiteboard Video
Windows As A Service VideoScribe
Windows As A Service - Whiteboard 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? – CONTACT US NOW!

Interested in working together? We do not work with just anyone. Please fill out this form and we’ll follow up. Or call Anders Sundstedt: +44 7531 800 711.

Your name*

Your email*

Your website

How can we help? Details please!*

  By using this form you agree with the storage and handling of your data by this website. Privacy Policy. *

* Indicates Required


Back To Top

Don`t copy text!