It sounds like you’re referring to a custom script that converts selected point text items into a block of text with equal width, often used in creating a consistent visual style, such as “SlabType.” Below is an example of how you could write a script for Adobe Illustrator to achieve this effect. Please note that this script will resize each text frame to have the same width and convert the final block of text to outlines.
Script: textBlock.jsx
target illustrator
// Check if a document is open
if (app.documents.length > 0) {
var doc = app.activeDocument;
// Get the selected objects
var selection = doc.selection;
if (selection.length > 0) {
var maxWidth = 0;
// Find the maximum width among selected text items
for (var i = 0; i < selection.length; i++) {
if (selection[i].typename === "TextFrame") {
selection[i].textFramePreferences.textRangeJustification = TextFrameJustification.LEFT_JUSTIFIED;
if (selection[i].width > maxWidth) {
maxWidth = selection[i].width;
}
}
}
// Resize all text frames to the maximum width and convert to outlines
for (var j = 0; j < selection.length; j++) {
if (selection[j].typename === "TextFrame") {
selection[j].textRange.characterAttributes.size = maxWidth;
selection[j].convertToOutline();
}
}
alert("Text blocks have been aligned and converted to outlines.");
} else {
alert("Please select one or more text items.");
}
} else {
alert(“No document is open.”);
}
Download Link : textBlock
How to Use the Script:
- Copy the Script:
- Copy the above code into a text editor and save the file with a
.jsx
extension, for example,textBlock.jsx
.
- Copy the above code into a text editor and save the file with a
- Run the Script in Illustrator:
- Open Adobe Illustrator.
- Go to
File > Scripts > Other Script...
. - Locate the saved
textBlock.jsx
file and run it.
- Select Text Items:
- Select the point text items in Illustrator that you want to align and convert to a block.
- Execute the Script:
- The script will resize the selected text items to have the same width and convert them to outlines.
Notes:
- The script assumes that the selected items are point text. If you’re using area text, adjustments may be necessary.
- The final block of text will be converted to outlines, meaning it won’t be editable as text anymore.
This script can be adjusted and expanded based on specific needs, such as additional alignment options or customization of the conversion process.
Advertisements