I've searched similar questions but none matched my need. Let's say you have a lot of rectangles with different width (12mm, 35mm, 6.54mm etc) and you want to add 2mm to each object's width, 1mm both left and right. I am trying to create a quick action but Transform tool doesn't have that ability and I've tried Transform again but it doesn't seem to work when saved as an action. Would it be possible to do this by using a script? Thanks in advance! Edit: the action I'm trying to make supposed to look like this: Copy- Paste in back- Transform- Deselect. Unfortunately, the Transform part is the one I can't make to work.
and welcome to GDSE. Here's my solution:
The trick is to save the transformation to a graphic style first. (As actions cannot record 'effects' directly, but they register applying graphic styles).
- Create a rectangle and apply the desired transformation:
The red square is the original one, and the blue one has
Covert to Shape/
Rectangleapplied to it. In this case it already is a rectangle, so we will only be using the extra width and height.
(As so often in Illustrator there are many different ways to achieve this transformation, i.e. you could also duplicate the shape and move it by certain increments)
- Next save the appearance of the blue rectangle as a new graphic style:
- Now you can record an action:
As you described in your question, the action copies and pastes the square in back, applies the graphic style and expands the shape.
This will create a blue shape behind the red square, that is 2mm wider on the left and right side, and 4mm taller on the top and bottom.