Created
June 7, 2021 20:46
-
-
Save GoodBoyNinja/9546e49bd04ef6455a7156b931e645c1 to your computer and use it in GitHub Desktop.
Loops through the After-Effects project items and returns an array of items that match the name that you passed into the function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetItemsByName (nameString) { | |
// returns array of found matches | |
if (!nameString) { | |
return false; | |
} | |
var matches = []; | |
for (var i = 1; i <= app.project.numItems; i++) { | |
var crnt = app.project.item(i); | |
var crntName = crnt.name; | |
var isAMatch = | |
nameString && crntName.indexOf(nameString) > -1 ? true : false; | |
if (isAMatch) { | |
matches.push(crnt); | |
} | |
} | |
return matches; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment