Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Explorer ,
Aug 20, 2022 Aug 20, 2022

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. 

TOPICS
Scripting , SDK
315
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 20, 2022 Aug 20, 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.

 

Translate
Explorer ,
Aug 20, 2022 Aug 20, 2022

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 20, 2022 Aug 20, 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.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 20, 2022 Aug 20, 2022
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines