Swap Two Objects
Script for Adobe Illustrator
ㅤ
Functionality
This is a script for Adobe Illustrator that allows users to swap the positions and optionally the sizes of two selected objects. It creates a user-friendly panel interface with multiple swap options.
ㅤ
Installation
1. Download the Swap Two Objects.jsx script file.
2. Place it 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 Illustrator if it's already running to load the script into the File > Scripts menu.
ㅤ
Using the Script

ㅤ
➊ Select Two Objects:
- Open a document and select exactly two objects.
- The script will not run if fewer or more than two objects are selected.
ㅤ
➋ Run the Script:
- Navigate to File > Scripts > Swap Two Objects.
- Alternatively, you can use the File > Scripts > Other Script... option to locate and run the script manually.
ㅤ
➌ Choose Swap Mode:
A dialog box will appear with three radio button options:
ㅤ
-
Position Only
Swaps the positions of the selected objects without changing their size.
ㅤ
ㅤ



ㅤ
ㅤ
ㅤ
-
Position and Size (Maintain Aspect Ratio)
Swaps positions and resizes objects while maintaining their original aspect ratios.
ㅤ
ㅤ



ㅤ
ㅤ
ㅤ
-
Position and Size (Match Aspect Ratio)
Swaps positions and resizes objects to match each other's dimensions exactly.
ㅤ
ㅤ



ㅤ
ㅤ
ㅤ
➍ Execute the Swap:
- Click the Swap button or press Enter to apply the selected swap mode.
- The objects will be repositioned and resized (if applicable) based on the selected mode.
ㅤ
➎ Additional Features:
ㅤ
Keyboard Shortcuts:
- Enter – Executes the swap.
- Escape – Closes the dialog.
- Up/Down Arrow Keys – Switches between swap mode options.
ㅤ
- Click the ⏼ icon on the right for a user guide
- Click the ⊗ icon on the top left to close the panel.
ㅤ
☻ Conclusion:
This Swap Two Objects script streamlines your Illustrator workflow by eliminating tedious manual repositioning and resizing. Whether you're exploring layout alternatives, creating pattern variations, or simply organizing your artwork, this tool saves valuable design time with just a few clicks. The three swap modes give you flexibility for different design scenarios, while the intuitive interface makes it accessible for designers at any skill level.
Give it a try in your next project to experience how this simple utility can enhance your creative process and help you visualize design alternatives more efficiently.
ㅤ
ㅤ