If you want to stay in touch + hear about new tools/resources, signup here →
How to use the script
Always check code before running it on your computer. Even basic scripts like this one. If you’re not a developer, ask an LLM like ChatGPT, Claude, or Gemini to verify it for you.
Option 1: Install to your AE Folder
Download and install the below .jsx file in your After Effects Script folder. You can then run it using the scripts menu, or by using a launcher like Quick Menu 3.
Option 2: Adapt the script yourself
Alternatively copy the code below and develop your own version. If you’re not a developer you can do this easily with an LLM like ChatGPT.
// Darkens the selected layer by adding an adjustment layer
// with a Levels effect to reduce brightness.
// Ensure a layer is selected before applying the effect.
if (app.project.activeItem.selectedLayers.length > 0) {
// Get the selected layer
var selectedLayer = app.project.activeItem.selectedLayers[0];
// Get the index of the selected layer
var layerIndex = selectedLayer.index;
// Create an adjustment layer
var adjustmentLayer = app.project.activeItem.layers.addSolid([1,1,1], "Adjustment Layer", app.project.activeItem.width, app.project.activeItem.height, 1);
adjustmentLayer.adjustmentLayer = true;
// Set the in and out points of the adjustment layer to match the selected layer
adjustmentLayer.inPoint = selectedLayer.inPoint;
adjustmentLayer.outPoint = selectedLayer.outPoint;
// Set the label color of the adjustment layer to Lavender
adjustmentLayer.label = 10;
// Add a Levels effect and set the output white to 130
var levelsEffect = adjustmentLayer.Effects.addProperty("ADBE Pro Levels2");
levelsEffect.property("Output White").setValue(130 / 255);
// Move the adjustment layer to the correct position in the layer stack
adjustmentLayer.moveBefore(app.project.activeItem.layer(layerIndex + 1));
} else {
alert("Please select a layer first.");
}
// Script created by Jack Vaughan (jackvaughan.com/tools)
So most screen casting software comes with like the ability to just throw on highlights or Circles or zooms and darkening the background and things like that But so often I find when I'm trying to highlight very specific parts of the UI the highlight is not right It just looks gimmicky or round or stock and actually I want to really highlight exactly the part of the UI That I want to highlight and so to do this with this kind of finesse you have to do it in After Effects There are a few tips I've picked up about how to do this fast. So let me show you so the first thing to do is make sure that the layer that you have that you want to sort of work on and do a Highlight on is a separate layer because that works with this next free script that I've got here Which you can download at my site Jack Vaughan comm slash tools So it's called dark in this when you do it you get an adjustment layer Which is exactly the same length as the layer that you have So if I delete that again and make this layer that long and run the script again You get an adjustment layer exactly that length with levels automatically applied I need to update this at some point because there's an issue there obviously Anyway, the next thing that I do is I zoom into the area that I want and I can then just draw a shape any After-effects shape that I want it could be drawn at the pencil tool. But in this instance, it's quite simple It's just going to be a mask, but I don't critically want it to be a mask of this adjustment layer I want its own shape because I'm going to do keyframes to move it in case you need to move that highlight or resize it And things like that So the first thing I'm going to do for this rectangle is just draw a rectangle roughly the size Obviously ignoring the rounded corners then I'm going to do command F you find the roundness and then dial into roughly What I want which is kind of roughly there right now. This next script is not mine and it's absolutely brilliant I've tried to recreate it and I have no idea how they are doing it, but it's absolutely brilliant It's called bought it's called border patrol and you know that annoying thing when you get your roundness really good and you're like I'm just gonna rip. Oh, what the hell? And your rectangle just goes mental you're like, hang on And so you try and like move the anchor point and the roundness still messes up border patrol solves this so what I'm gonna do is I'm going to select my shape layer and click top left and now I can resize and you can see that I've got this really nice piece of sort of Like a card like it would behave in a kind of a UI environment or in figma or something like that So that's nice So I'm gonna then make this the same size as my layer and then I'll just call this mask And then what we're gonna do is we're gonna drive this. I always get this the wrong around. Yes that way around Sorry, I'm gonna make this a matte of that and then I'm gonna Invert it with that one there and then you can eyeball it Select your shape and be like, okay, that's not quite right, you know, you get it get it how you want it But the beautiful thing about having border patrol in here is that you're like, okay, you know I don't need to worry about the roundness. Okay, so in this particular moment in the video I then go on and I talk about schedule, right? So what I want to do is I want to do a hold keyframe here and I've got keyboard shortcuts. I almost swore then That's terrible, isn't it? Keyboard shortcuts set up to make things a hold keyframe and I'd highly recommend you do that So when that is the case when you want to move it just simply move the thing, right? So then what we get is we get this kind of I'm gonna mute myself so you don't hear two jacks Boom right and you can also do which I really love and occasionally I don't have to do this here But say we had another thing that you wanted to highlight that was sort of a different shaped rectangle And I do this a lot with with glide say you need to just draw the user's attention without zooming or or doing something clumsy We could have another keyframe here. And let's make this not a hold keyframe and let's say that we Let's bring all these out a bit Let's bring all these out a bit Let's say that this one needed to go here and say we wanted to highlight all of them there Then what you need to do is you need to put scale keyframes on Your highlight mask, right? So this gets a bit weird but depending on the motion that you need but you see here that over the course of this motion here and let me just Apply my default easing with flow you can see that