Set transform origin to centre of selection

I tried to make this script then realised it’s harder than it seems! Is there a way to return the selected path but with extrema added, without changing the actual outlines… to calculate the correct bounding box (i.e. ignore the off-curve handles, but still include the path at bounding box when there is no extrema)?

Use the bezierPath property of path or layer and ask for its bounds().

Actually I just needed to change selectionBounds to bounds and it works :D?

I changed the script a bit:

1 Like

Thanks! Is there a way to write in a line of code that changes the current tool to Rotate as well?