Skip to main content
Inspiring
August 21, 2022
Answered

script - check if any project is opened in ae via extended script

  • August 21, 2022
  • 2 replies
  • 447 views

via script - How to check if any project is opened or not. So, i could open project if it is not empty. How to check if any project is opened. How to known that no project is opened in after effects via extended script. 

This topic has been closed for replies.
Correct answer Dan Ebberts

I think it depends. You could use this to see if a project file has been opened:

 

if (app.project.file == null){
  // no project file open
}else{
  // project file open
}

 

But that won't work in the case where you've opened a project file that had to be converted from an older version of AE, so there's technically no project file associated with the converted project. It might work for you though, depending on what your requirements are.

 

2 replies

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
August 21, 2022

I think it depends. You could use this to see if a project file has been opened:

 

if (app.project.file == null){
  // no project file open
}else{
  // project file open
}

 

But that won't work in the case where you've opened a project file that had to be converted from an older version of AE, so there's technically no project file associated with the converted project. It might work for you though, depending on what your requirements are.

 

Inspiring
August 21, 2022

Thanks dan sir. I added extra try catch if any active item for safety thanks.

Inspiring
August 21, 2022

How to check when empty after effects with no projects is opened. Then how to known.