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

Set After Effects To Clear Cache Upon Open/Close

Engaged ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

Is there a feature, script, or plugin available that clears the cache upon opening/closing After Effects? I have to clear the cache lately at least once a day. Honestly, I'm clearning my cache more than I take out the trash. 

 

I'd really like to just have it clear without needing to tell it. Is there something available that can help?

TOPICS
How to , Resources , Scripting

Views

579

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 , Mar 23, 2023 Mar 23, 2023

I guess you could add a one-line script like this to AE's Scripts/Startup and/or Scripts/Shutdown folders (haven't tried it though):

app.purge(PurgeTarget.ALL_CACHES);

Votes

Translate

Translate
Community Expert ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

I guess you could add a one-line script like this to AE's Scripts/Startup and/or Scripts/Shutdown folders (haven't tried it though):

app.purge(PurgeTarget.ALL_CACHES);

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 ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

Have you tried using ChatGPT?

 

Here's what came back when I tried:

To clear the cache automatically when After Effects shuts down, you can create a script that runs when the application is closed. Here's an example script that you can use:

WarrenHeaton_0-1679607846669.png

 

This script creates a function called clearCacheOnExit that clears all caches using the app.purge(PurgeTarget.ALL_CACHES) command, and then adds an event listener that runs the function when the application is closed using the app.addEventListener("afterClose", clearCacheOnExit) command.

To use this script, save the script with a .jsx file extension. Then, move the script file to the "Scripts > ScriptUI Panels" folder in your After Effects installation directory.

When you launch After Effects, the script will automatically run when the application is closed, clearing the cache and helping to improve performance and prevent errors in your project.

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
Engaged ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

Awesome, no I haven't tried using ChatGPT. Sounds like Mother from the movie, Alien. 

 

Very comprehensive. Thanks guys! I'll give it a shot!

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 ,
Mar 24, 2023 Mar 24, 2023

Copy link to clipboard

Copied

That's a very good example of the nonsense that ChatGTP produces, which looks convincing, but does not work. There is no method app.addEventListener in Adobe ExtendScript.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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 ,
Mar 24, 2023 Mar 24, 2023

Copy link to clipboard

Copied

LATEST

also, scripts which have no user interface should not be put in the ScriptUI Panels folder. And scripts which you put in the Script UI Panels folder are not launched when Ae starts - they are only launched when you execute the menu command which Ae creates for each script in the ScriptUI Panels folder.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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