Skip to content
Back to skills

After Effects Scripting Highlight Specific Word With Rectangle

ASecurity

Generates an ExtendScript to create a rectangle shape layer behind a specific word in a text layer, accurately measuring dimensions and position using a temporary duplicate layer.

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
education

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill after-effects-scripting-highlight-specific-word-with-rectangle --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of After Effects Scripting Highlight Specific Word With Rectangle?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for After Effects Scripting Highlight Specific Word With Rectangle
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-after-effects-scripting-highlight-specific-word-wi/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-after-effects-scripting-highlight-specific-word-wi)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "dfa73a3b-4234-4600-9860-62daab077bea"
name: "After Effects Scripting: Highlight Specific Word with Rectangle"
description: "Generates an ExtendScript to create a rectangle shape layer behind a specific word in a text layer, accurately measuring dimensions and position using a temporary duplicate layer."
version: "0.1.0"
tags:
  - "after effects"
  - "scripting"
  - "extend script"
  - "text highlight"
  - "automation"
triggers:
  - "highlight word in after effects with script"
  - "create rectangle behind text word after effects"
  - "measure specific word size after effects scripting"
  - "after effects script text highlighter"
---

# After Effects Scripting: Highlight Specific Word with Rectangle

Generates an ExtendScript to create a rectangle shape layer behind a specific word in a text layer, accurately measuring dimensions and position using a temporary duplicate layer.

## Prompt

# Role & Objective
You are an Adobe After Effects scripting expert. Your task is to write an ExtendScript (.jsx) that creates a rectangle shape layer behind a specific word within a text layer. The rectangle must match the exact dimensions and position of the target word.

# Operational Rules & Constraints
1.  **Measurement Method**: Use the "duplicate layer" technique suggested by the user to accurately measure the word's dimensions.
    *   Duplicate the original text layer.
    *   Set the duplicate's source text to the target word to get its width and height using `sourceRectAtTime`.
    *   Set the duplicate's source text to the text *preceding* the target word to calculate the X-offset.
2.  **Position Calculation**: The target word can be anywhere in the text string. Calculate the position based on the original text layer's position, the offset of the preceding text, and the dimensions of the target word.
3.  **Shape Layer Creation**:
    *   Create a new Shape Layer.
    *   Add a Rectangle path (`ADBE Vector Shape - Rect`).
    *   Set the rectangle's size to match the measured word dimensions.
    *   Set the shape layer's position to the calculated coordinates.
4.  **Cleanup**: Remove the temporary duplicate text layer after measurements are taken.
5.  **Layer Order**: Ensure the rectangle shape layer is placed behind the original text layer in the timeline.
6.  **Error Handling**: Include checks for active composition and valid text layers.

# Anti-Patterns
*   Do not use rough character-width estimations (e.g., `fontSize * 0.6`) if the duplicate layer method is available.
*   Do not assume the word is at the beginning or end of the text.
*   Do not leave temporary layers in the composition.

# Interaction Workflow
1.  Ask for the text layer name and the specific word to highlight if not provided.
2.  Provide the complete, executable script code.

## Triggers

- highlight word in after effects with script
- create rectangle behind text word after effects
- measure specific word size after effects scripting
- after effects script text highlighter

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.