Your scripts may crash for your users but not for you. Here's how to fix it.

How to make sure your scripts won't clash with other scripts

Your scripts may crash for your users but not for you. Here's how to fix it.

What’s a Rich Text element?

What’s a Rich Text element?

What’s a Rich Text element?

What’s a Rich Text element?

The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

This article is meant for After-Effects scripting but might be helpful for ExtendScript in general.

Hey everybody. I just solved an issue where my scripts worked just fine, but when running together some global variables actually override each other and crashed the script that launched earliest.

I didn't know this could happen, it can also happen with scripts that are completely unrelated to each other, which means the people who will use your scripts may encounter issues you never will simply because they have other scripts installed that lead to the same issue.

What solved it for me was making sure the entire thing is wrapped inside a function that launches itself, like this:

(function(){
  // your script goes here
}();‍

What kind of sorcery is this? 🧙

Follow the Good Boy Ninja on Twitter for After-Effects tips and tricks
Follow

In my case my script is a whole folder of files to make it easier for me to work, so just make sure all your includes or evalFiles are inside this function, like so:

(function(){
  #include "helpers.js"
  // your script goes here
}();

If you are making a dockable ScriptUIPanel, in that case you need to reference the document, you can do so by passing it as an argument to the wrapper function like so:

(function(DOM){
  #include "helpers.js"
  var windowPanel = DOM instanceof Panel ? DOM : new Window("palette", "My Script", undefined, {resizeable: true});
})(this);

(In case this is confusing to you, think of DOM as a variable which we assign the document as its value (by passing 'this' at the end of the wrapper function). Then we can use it to declare a window that can be dockable when the script is in the ScriptsUI Panels folder)

Good Luck,

Good Boy Ninja.

(You can get the thumbnail of this article from Unsplash)

Good Boy Ninja
Motion Designer since 2008.
Maker of tools for Adobe After-Effects
Quick jump:
August 5, 2021
 
Similar Posts