Creating a Useful Function for After Effects: Find the Longest Side

Creating Useful Functions for After Effects: Find the Longest Side

David Torno adds to his Free Function Friday series, which dives into creating useful Ae functions using Extend Script. Here, David shows how to build a function that can return which directional length of a composition or footage asset is longer.

a function that will return which directional length of comp or footage asset is longer

David notes that this can be a useful function when you are trying to find out if an asset in After Effects is a portrait or landscape. Determining which side is the longest will make short work of placing a landscape asset into a portrait-oriented composition, or vice-versa.

David shows how to customize the data that is returned through the function by using an object array. Check out the article for Free Function Friday itemLongestSide here.