Skip to main content
Known Participant
February 1, 2021
Answered

Using extend script to to get the name of current After Effects filename

  • February 1, 2021
  • 1 reply
  • 2646 views

I've decided to teach myself a little scripting to automate some of the tasks specific to my team. My first task to is to make a script that will take the selected comp, and match that name of the comp to match the name of the project file. In looking at the extendscript documentation I don't see the filename as a readable attribute of the project object. My quesiton is simply, how does one access the filename of the current AE project, using extendscript? we are using cc, AE 2019.

 

Thank you in advance,

Matt

This topic has been closed for replies.
Correct answer Paul Tuersley
Somethinglike this would check if a project has been saved and if so give the name of the project:
var projectName = "Untitled";
if (app.project.file != null) {
 projectName = app.project.file.name;
}
 

1 reply

Paul TuersleyCorrect answer
Inspiring
February 1, 2021
Somethinglike this would check if a project has been saved and if so give the name of the project:
var projectName = "Untitled";
if (app.project.file != null) {
 projectName = app.project.file.name;
}
 
Inspiring
February 1, 2021

Oh and you could always add to that:

if (projectName.indexOf(".") != -1) { // if project has a prefix (e.g. .aep) strip it
projectName = projectName.substring(0, projectName.lastIndexOf("."));
}