Paste to Replace
Script for Adobe Illustrator
✦ Available exclusively on Patreon for Pro supporters.
ㅤ
Description
Paste to Replace is a modeless Adobe Illustrator script that replaces one or more selected objects with artwork from the clipboard. It provides precise sizing and nine-point alignment, selectable visible or geometric bounds, optional preservation of the original targets, top-level appearance matching, and a searchable built-in User Guide.
ㅤ
Features
Paste to Replace combines repeatable clipboard placement with compact controls and safeguards for dependable replacement workflows.
- Multiple targets. Replace every outermost selected object with the same clipboard artwork in one operation.
- Two paste actions. Replace each target or paste a copy while keeping the original artwork.
- Three sizing modes. Keep the clipboard dimensions, fit proportionally within the target, or stretch to its exact width and height.
- Nine-point alignment. Align the pasted artwork by any corner, edge midpoint, or center point.
- Explicit bounds modes. Use Visible Bounds to include strokes and appearance, or Geometric Bounds to use path geometry only.
- Live preview. Review the selected sizing behavior and reference-point placement before running the action.
- Appearance matching. Optionally apply each target's opacity and blending mode to the pasted top-level object without altering its children.
- Selection safety. Process only outermost targets and reject unsupported text-edit selections before making changes.
- Layer validation. Detect locked or hidden target layers, including unavailable parent layers, before replacement begins.
- Reliable execution. Use stable selection snapshots, zero-size safeguards, and single-job BridgeTalk processing.
- Modeless workflow. Keep the palette open while selecting new artwork and repeating replacements.
- Built-in guidance. Search a resizable User Guide containing setup instructions, control references, troubleshooting, release notes, and support resources.
ㅤ
Installation
1. Download the Paste to Replace.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 > Paste to Replace
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
ㅤ
Launch the Script
Open an Illustrator document, then launch Paste to Replace from the Scripts menu or by opening the JSX file directly.
- The modeless palette remains available while you work in the document.
- Center is the default reference point, Keep Size is the default sizing mode, and both appearance-matching options are enabled initially.
- The initial bounds mode follows Illustrator's Include Stroke in Bounds preference.
- Hover over a control to view a short description of its action.
ㅤ
ㅤ

ㅤ
ㅤ
➊ Copy the Replacement Artwork
Copy the Illustrator artwork that should be placed at each target.
- Copy one object or multiple objects with Command+C on macOS or Ctrl+C on Windows.
- Multiple copied objects are grouped into one replacement when pasted.
- Keep valid Illustrator artwork on the clipboard until the replacement operation finishes.
ㅤ
ㅤ
➋ Select the Target Artwork
Select one or more complete artwork objects to use as replacement targets.
- Each outermost selected object is processed once.
- If a group and one of its children are both selected, the group is used and the nested child is ignored.
- Exit text-edit mode and select the complete text object instead of a text range or insertion point.
- Unlock and show every target layer and all of its parent layers before continuing.
- Confirm that every selected target can be moved, translated, and removed by Illustrator.
ㅤ
ㅤ
➌ Choose the Paste Action
Use the split paste button to decide whether each original target remains in the document.
- Paste to Replace. Paste the clipboard artwork and remove the original target.
- Paste, Keep Original. Paste the clipboard artwork while retaining the original target.
- Click the main part of the button to run the currently selected action.
- Click the arrow to open the action menu and select the other action.
ㅤ
ㅤ
➍ Choose a Sizing Mode
Select how the clipboard artwork should be sized relative to each target.
- Keep Size. Preserve the clipboard artwork's original dimensions and align only its selected reference point.

- Fit. Scale the pasted artwork proportionally so it fits within the target bounds without changing its aspect ratio.

- Stretch. Scale width and height independently so the pasted artwork matches the target bounds exactly.

- Click the live preview to cycle through the three sizing modes.
ㅤ
ㅤ
➎ Choose a Reference Point
Use the 3×3 selector to choose which point on the pasted artwork aligns with the corresponding point on the target.
- Choose Top Left, Top, Top Right, Left, Center, Right, Bottom Left, Bottom, or Bottom Right.
- Center is selected by default.
- Option-click on macOS or Alt-click on Windows to reset the selector to Center.
- The live preview shows the chosen alignment in Keep Size and Fit modes.
- The selector is disabled in Stretch mode because the stretched artwork already matches every target edge.
ㅤ
ㅤ
➏ Choose a Bounds Mode
Choose which Illustrator bounds the script uses for sizing and alignment.
- Visible Bounds. Include strokes and appearance when measuring both the target and pasted artwork.
- Geometric Bounds. Use path geometry without stroke or appearance expansion.
- The initial selection follows Illustrator's Include Stroke in Bounds preference.
- Switch bounds modes when stroked artwork appears unexpectedly offset or sized.
ㅤ
ㅤ
➐ Match the Target Appearance
Use the Match controls when replacements should inherit the target's transparency behavior.
- Opacity. Apply the target's opacity to the pasted top-level object.
- Blending Mode. Apply the target's blending mode to the pasted top-level object.
- Both controls are enabled by default.
- Child objects inside pasted groups remain unchanged, preventing compounded transparency or altered internal appearance.
ㅤ
ㅤ
➑ Run the Replacement
Confirm the selected action and controls, then execute the replacement.
- Click the main paste button or press Enter.
- Wait while the script pastes, groups, sizes, aligns, and styles one replacement for each valid target.
- Continue working when the completed replacements become the active selection.
- The script validates every target before changing the document, preventing a mixed selection from being partially processed because of an invalid target.
- Repeated clicks are ignored while a BridgeTalk replacement job is already running.
- The palette stays open so you can select another target set and repeat the workflow.
ㅤ
ㅤ
➒ Keyboard Controls
Use these shortcuts while the main palette is active.
- Enter. Run the currently selected paste action.
- Escape. Close the palette.
- Up Arrow. Select the previous sizing mode.
- Down Arrow. Select the next sizing mode.
- Option-click or Alt-click. Reset the reference-point selector to Center.
When the built-in User Guide is open, Escape closes the guide and the Up and Down Arrow keys scroll its content.
ㅤ
ㅤ
☻ Wrap-Up
Paste to Replace turns repetitive object swapping into a consistent workflow for individual objects and large selections. Its sizing, alignment, bounds, appearance, and validation controls keep replacements predictable, while the built-in guide and support resources make help readily available.
ㅤ
ㅤ