Extend Straight Segments
✦ Available exclusively on Patreon for Pro supporters.
Script for Adobe Illustrator
ㅤ
Description
Extend Straight Segments is an Adobe Illustrator script that allows you to easily extend or trim the straight line segments at the endpoints of open paths. The script provides precise control over how much to extend or shorten these segments, with options for uniform or random adjustments. It's particularly useful for designers who need to adjust line endpoints without manually redrawing or adjusting anchor points.
ㅤ
Features
- Extend or trim straight segments at the endpoints of open paths.
- Apply changes to both endpoints, or selectively to only start or end points.
- Intelligently targets multiple selected straight line segments simultaneously.
- Interactive adjustment via a slider or direct input.
- Random extension mode with customizable minimum and maximum range.
- Supports extension (>100%) or trimming (<100%) of segments.
- Real-time preview of changes.
- Cancel option to restore original paths.
ㅤ



ㅤ
Installation
1. Download the Extend Straight Segments.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.
ㅤ

ㅤ
Preparation
- Open your Adobe Illustrator document.
- Select one or more open paths with straight segments at their endpoints.
- Run the Extend Straight Segments script.
ㅤ
Using the Script
ㅤ
1. Select Points to Affect
Choose which endpoints you want to modify:
- Both Endpoints: Affects both the start and end points of all selected paths.
- Start Points: Only affects the beginning points of selected paths.
- End Points: Only affects the ending points of selected paths.

ㅤ
2. Choose Extension Mode
Select one of the two extension modes:
- Uniform Extension: Extends all selected endpoints by the same percentage.
- Random Extension: Extends each endpoint by a random percentage within your specified range.
ㅤ





ㅤ
ㅤ
3. Configure Extension Settings
For Uniform Extension:
- Use the slider to set the extension percentage (from 10% to 500%).
- Or directly enter a percentage value in the input field.
- 100% means no change, values below 100% will shorten the segments, values above 100% will extend them.
- Use arrow keys (↑/↓) to adjust values by 1%, or hold Shift + arrow keys to adjust by 10%.

ㅤ
For Random Extension:
- Set the minimum percentage.
- Set the maximum percentage.
- Click the "✚" button to generate new random values within the range.
- Use arrow keys to fine-tune min/max values.

ㅤ
4. Use Preview
- The "Preview" checkbox lets you see changes in real-time before applying them.
- Toggle it on/off to compare the original vs. modified paths.
ㅤ
5. Complete the Operation
- Click "OK" to apply the changes and close the dialog.
- Click "Cancel" to discard all changes and restore original paths.
ㅤ
Additional Notes
- The script only works with open paths (not closed shapes) that have straight segments at their endpoints.
- Move the slider right (>100%) to extend the segments.
- Move the slider left (<100%) to trim the segments.
- Use arrow keys (↑/↓) to adjust value by 1%.
- Hold Shift + arrow keys to adjust value by 10%.
- Only straight segments at path endpoints will be modified.
- Endpoints with Bezier curves (smooth corners) will be preserved.
- Click the icon ⏼ in the bottom right corner to access the user guide.
ㅤ
ㅤ
Wrap-up
The Extend Straight Segments script streamlines your Illustrator workflow by providing precise control over path endpoints.
With its intuitive interface and real-time preview, you can quickly adjust multiple open paths simultaneously without having to manually redraw or recreate elements.
ㅤ
ㅤㅤ