Text Highlighter
Script for Adobe Illustrator
✦ Available exclusively on Patreon for Pro supporters.
ㅤ
Description
Text Highlighter is an Adobe Illustrator script that automatically creates customizable highlight rectangles behind or in front of selected text frames. Perfect for eye-catching presentations, social media graphics, editorial layouts, and any project that calls for emphasis through colored text backgrounds.
The script offers four highlighting modes – by line, word, random words, or specific text – along with live preview, per-rectangle color randomization, and extensive controls for fine-tuning scale, offset, opacity, rounded corners, and placement.
ㅤ
Features
- Four Highlight Modes — Lines, Words, Random (% of words), or Specific words/phrases
- Live Preview — See changes in real-time as you adjust settings
- Flexible Scaling — Adjust width and height independently (0–200%)
- Custom Colors — Choose any color via hex code or the color picker
- Opacity Control — Set transparency from 0–100%
- Offset Controls — Fine-tune horizontal and vertical positioning (±100pt)
- Rounded Corners — Add a corner radius for softer highlights (0–20pt)
- Height Reference — Choose between Cap Height or x-height as the sizing baseline
- Placement — Place highlights behind or in front of the text
- Randomize Color — Slightly vary the hue and lightness of each rectangle for an organic look
- Zoom to Fit — Instantly frame the selection in the Illustrator window
- Batch Processing — Apply highlights to multiple text frames at once
- Settings Memory — Last-used settings are saved and restored on next run
ㅤ
Installation
1. Download the Text Highlighter.jsx script file.
2. Place the script in your Adobe Illustrator Scripts folder:
⮑ Mac: /Applications/Adobe Illustrator <Version>/Presets/<Language>/Scripts
⮑ Windows: C:\Program Files\Adobe\Adobe Illustrator <Version>\Presets\<Language>\Scripts
3. Restart Adobe Illustrator if it's already running
4. Access the script via File > Scripts > Text Highlighter
5. Alternatively, run it directly via File > Scripts > Other Script... and browse to the file location
Tip: You can also drag and drop the .jsx file directly onto the Illustrator workspace to run the script instantly – no installation needed.
ㅤ
Using the Script
ㅤ
ㅤ
Basic Usage
ㅤ
1. Open a Document:
- Launch Adobe Illustrator and open a document containing text
- If no document is open, the script will prompt you to open one
2. Select Text:
- Use the Selection Tool (V) to select one or more text frames
- You can select multiple text frames or groups containing text
- Empty text frames are skipped with an optional warning
3. Run the Script
- Go to File > Scripts > Text Highlighter
- Or drag and drop the .jsx file onto the Illustrator window
- The Text Highlighter dialog will open:
ㅤ

ㅤ
ㅤ
➊ Highlight Mode
ㅤ
Choose how the script targets text for highlighting. The mode panel appears at the top of the dialog with four radio buttons:
- Lines – One rectangle per line of text
- Words – One rectangle per individual word
- Random – A random percentage of words, chosen at run-time
- Specific Words – Only the exact words, characters, or phrases you specify
ㅤ
Random mode reveals a Highlight % slider (1–100%) and a ✚ re-roll button that picks a new random set of words at the current percentage without changing the slider value.
Specific Words mode reveals a Find text field and a Search button. Type one or more comma-separated terms and press Search to update the preview. If nothing matches, an alert will inform you.
ㅤ




ㅤ
ㅤ
➋ Scale Settings
ㅤ
Width Scale (0–200%)
- Adjusts the horizontal size of the highlight rectangle relative to the text bounds
- 100% = exact text width; values above 100% extend beyond text edges
ㅤ
Height Scale (0–200%)
- Adjusts the vertical size relative to the chosen height reference
- 100% = full reference height; values above 100% extend above and below the text
ㅤ
Tip: Use arrow keys in any input field for precise adjustments:
- Up/Down arrows: ±1
- Shift + Up/Down: ±10
- Option/Alt + Up/Down: ±0.1
ㅤ
ㅤ
➌ Offset Controls
ㅤ
Horizontal Offset (−100pt to 100pt)
- Shifts the highlight left (negative) or right (positive)
ㅤ
Vertical Offset (−100pt to 100pt)
- Shifts the highlight up (positive) or down (negative)
ㅤ

ㅤ
ㅤ
➍ Highlight Color
ㅤ
Color Swatch
- Click the colored swatch to open the color picker (Illustrator's native picker or a system fallback)
ㅤ
Hex Input
- Type a hex code directly (e.g., #FFEB00) to set the color without opening the picker
- The swatch updates live as you type
ㅤ
Randomize Checkbox
- When enabled, each highlight rectangle receives a slightly varied hue and lightness based on the chosen color
- Creates an organic, hand-marked appearance across multiple highlights
- Takes effect immediately in the live preview
ㅤ
Opacity (0–100%)
- Controls the transparency of every highlight rectangle
- 100% = fully opaque; 0% = fully transparent
ㅤ
Corners (0–20pt)
- Rounds the corners of the highlight rectangles
- 0pt = sharp corners; higher values = more pill-shaped
ㅤ

ㅤ
ㅤ
➎ Height Reference
ㅤ
Choose which character height is used as the sizing baseline:
ㅤ
Cap Height (X)
- Matches the height of capital letters
- Best for all-caps text or mixed-case content
ㅤ
x-height (x)
- Matches the height of lowercase letters (excluding ascenders and descenders)
- Best for body text or lowercase-dominant content
ㅤ

ㅤ
ㅤ
➏ Placement
ㅤ
Behind Text
- Places highlight rectangles behind the text layer
- Text remains fully visible and selectable
ㅤ
In Front of Text
- Places highlight rectangles in front of the text
- Reduce opacity to keep text readable
ㅤ

ㅤ
ㅤ
➐ Using the Preview
ㅤ
1. Preview Checkbox
- Displays live highlight rectangles on the canvas as you change settings
- Uncheck to hide the preview and improve performance on large documents
ㅤ
2. Hide Edges
- Hides the selection bounding box while previewing
- Makes it easier to evaluate the final look without the blue selection outlines
ㅤ
3. Adjust Settings
- Move any slider or type a value into an input field to see instant results
- Right-click a slider to reset it to its default value
- Click the ✖ button beside an input to reset that individual setting to its default
- Click a section label (e.g., "Width Scale:") to instantly reset that control
ㅤ
4. Zoom to Fit (✚ button)
- Fits the selected text frames into the Illustrator view window
- Useful for inspecting fine details while the dialog is open
ㅤ
ㅤ
➑ Finalizing
ㅤ
Apply (OK)
- Click OK to commit the highlights
- Live preview rectangles become the permanent result
- Multiple highlights from the same text frame are automatically grouped
ㅤ
Cancel
- Click Cancel to close the dialog without making any changes
- All preview rectangles are removed
ㅤ
That's all there is to it — select, tweak, and hit OK. Whether you're building a bold editorial spread or just need a single word to pop, Text Highlighter gets you there in seconds. Play with the modes, lean into the color randomization, and let the live preview do the heavy lifting.
ㅤ
ㅤ