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

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

Explorer ,
Aug 20, 2022 Aug 20, 2022

Copy link to clipboard

Copied

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

Views

157

Translate

Translate

Report

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.

 

Votes

Translate

Translate
Explorer ,
Aug 20, 2022 Aug 20, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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