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

Posted on Monday, 13 August 2007
Spell Checker for After Effects
After Effects Script: Improved version of our Keyframe Nudge Script

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

Selected portfolio work samples:

International Diabetes Federation - Taking Diabetes to Heart - Sundstedt Animation
IDF.org - Animated Campaign Video
Cayman Dance Animated Music Video - Sundstedt Animation
Cayman Dance - Animated Music Video
DPRAA Animated Explainer Video
DPRAA Animated Explainer Video
KiDS Educational Whiteboard Video
KiDS Educational Awareness Whiteboard Video
ECO-Schools-Explainer-Video
Eco-Schools Explainer Video
Microsoft Whiteboard Video - Sundstedt Animation
Windows 10 Protects against modern security threats
The-Mother-Lush-Animated-Music-Video
Lush - Animated Music Video
Live-Pale-White-Guy
Live - Animated Music Video
Milo Biotechnology Animated Explainer Video
Milo Biotechnology Animation
100-Years-in-Marketing-Explainer-Video
100 Years in Marketing
Dumfries & Galloway Animated Explainer Video
Dumfries & Galloway Animation
Windows 10 Defender Advanced Threat Protection
Windows 10 Defender Advanced Threat Protection
Duraflor Animated Explainer Video
Duraflor Animation
Zestica Educational Medical Animation
Zestica
Givvit Explainer Video
Givvit
ARCHIE-WeST Animation
ARCHIE-WeSt
BASW-Eddie-Animated-Explainer-Video-295x166
BASW Eddie
Windows 10 Enterprise med Software Assurance
Windows 10 Enterprise med Software Assurance
Track-My-Beef-Animated-Explainer-Video
Track My Beef
BASW-Steven Explainer Video by Sundstedt Animation Studio
BASW Steven
M-Squared-Lasers Explainer Animation
M Squared Lasers
BASW-Amber-Animated-Explainer-Video-Scotland
BASW Amber
LightForge-Powerphotonic-Explainer-Video
LightForge
Titan Vision Animated Explainer Video by Sundstedt Animation
Titan Vision
Kom igång med Windows 10 i molnet VideoScribe
Kom igång med Windows 10 i molnet VideoScribe
Push-Digital-Animated-Explainer-Video-Google-Ranking-SEO
Push Digital
Windows As A Service VideoScribe
Windows As A Service VideoScribe
Pfizer Explainer Video
Pfizer [Coming Soon]
How-to-Become-an-Early-Riser
Early Riser
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);

Contact Form – Get in Touch Today

[contact-form-7 id=”13249″ title=”Contact Form 2″]

READY TO PARTNER? – CONTACT US FOR A FREE QUOTE!

Please fill out this quick form and we’ll follow up.
Or call: +44 (0) 7531 800 711, or email: hello@sundstedt.co.uk

First name*

Last name*

Your website

Your email*

How can we help? Details please!*

What's your budget?*

* Indicates Required


Back To Top

Spell Checker for After Effects
After Effects Script: Improved version of our Keyframe Nudge Script
error: Alert: Content is protected !!