- Community Moderator
- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Item was Featured
- Author had a File in an Envato Bundle
- Beta Tester
- Has been a member for 4-5 years
- United Kingdom
Ask Your Expressions and Scripting Questions Here.
It has been requested in various threads now, that I make an expressions sticky thread. So here it is.
For those of you that don’t know, expression language is a Javascript based language that After Effects uses to make simple (or complicated) dynamic relationships between comps, layers, and properties. It can take your After Effects to another dimension, and it’s particularly useful for templates. Making complex templates easy to organise and manage for the novices who often buy them is easy with expressions.
I might add a few scripting bits and pieces in here too. Scripting is also a very powerful way of extending After Effects capabilities. More powerful than expressions, in fact, because scripting can automate most of what the user can do in Ae. But because scripting is a much more complicated beast, most of this thread will be dedicated to expressions.
Above all, the point of this thread is to collect the answers to those frequently asked questions on the forums. Some buyers might find it useful, but it’s basically aimed at Videohive authors.
Like the Essential Resources thread, I’ll collect the best stuff in this post. I’ll edit and format the best responses and then link to them from this post as a kind of expressions knowledge-base. Please make sure to format any code you post inside “pre” tags.
Expressions
- What are expressions?
- After Effects Expression Language Reference (external link)
- How to set min and max values for an Expression Slider Control
- How to globally set depth of field
- How to use an Expression Layer Control
- How to use a master Checkbox Control to turn layers on and off (using the value keyword)
- Dealing with different data types in expressions.
- value and valueAtTime()
- How to parent a camera to a null using only expressions
- How to wiggle a layer at a certain angle
- Expression for a smooth credit roll
- Auto fade expression
- Auto fade expression (more robust)
- How to make a squish and squash expression with layer markers
- Is it possible to change only a specific keyframe in an animation?
- Simple 3D Depth Cueing
- How to Build a Simple Bar Chart From a Text Layer (video)
- How to give layers a random rotation
- How to link a property to a control layer based on its own layer name (regex)
- Going mad with regex
- Controlling CC Page Turn With Expressions
- Getting 2D Screen Coordinates of a 3D Object
- Boolean Logical Operators in Expression Language
- Simple Time Offset
- Robustly Linking Positions Across Comps With Layer Space Transforms
- Freezing Animation At A Layer Marker
- Setting Camera To The Default Camera’s Position
Scripting
- What is scripting?
- CS6 Scripting guide – Note: Scripting, NOT expressions (external link)
- Javascript Tools Guide CS5 (external link)
- How to turn motion blur on for all layers
- Offsetting Y Position Of All Layers By 50 Pixels
- Writing A Binary Image File To Disk
- Writing A Binary Image File To Disk Pt. 2
- How To Detect All Text Layers In A Project
- Community Superstar
- Has been a member for 2-3 years
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Author was Featured
- Author had a File in an Envato Bundle
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
Finally 
Great idea! Those things are not easy to find. This will be a great place for that:) Don’t let it slip:)
Awesome idea, thank’s to the founders! 
Good Idea 
I’m waiting for the sources.,
Thank you so much felt, 

This thread will be more useful!
Thanks for posting, really a nice idea to share. 
- Community Moderator
- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Item was Featured
- Author had a File in an Envato Bundle
- Beta Tester
- Has been a member for 4-5 years
- United Kingdom
crazydesigns said
I’m waiting for the sources.,
Thank you so much felt,![]()
Well we need some questions first! Expression questions usually pop up at a rate of about 1 a week, so you shouldn’t have to wait for long.
- Sold between 250 000 and 1 000 000 dollars
- Author was Featured
- Item was Featured
- Contributed a Tutorial to a Tuts+ Site
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Exclusive Author
- Has been a member for 3-4 years
- Bulgaria
I’ll start with a simple one. 
I am assuming it is beyond the power of an expression but no matter, for conversation’s sake – can I control a layer’s attributes like the 3D box, motion blur and shy layer switch? Would be e nice one.
