Is a script possible for uniform scaling based on clicking points instead of the default dragging?

Explorer ,
Mar 15, 2022 Mar 15, 2022

Copy link to clipboard

Copied

Hi there! This community has been immensely helpful to me when it comes to scripting needs, and this is one of those questions and use cases that has been bugging me for a while. I'm genuinely curious if it can be done, or if something like this already exists out there.

 

I find the Scale tool to be incredibly hard to use in its current form when you're looking to scale uniformly. I was wondering if there's a possibility of creating a script that would allow you to:

  1. Step 1: Select the fixed base anchor point based on which you're going to scale the item from. Let's say, for a rectangle, the top-left corner.
  2. Step 2: Select the point on the item from which you want to begin scaling. Let's say, for the same rectangle, the bottom-right corner.
  3. Step 3: Select a point on the artboard towards which the scaling will be done. And here I see two options:
  • Option A: You select a specific point on the artboard, and the item scales uniformly towards that point's horizontal/vertical axis (depending on the situation), and then the script snaps the item (using the anchor point chosen on Step 2) into the point from Step 3.
  • Option B: No more snapping of the scaled item. It simply scales to the horizontal/vertical axis of the selected point at Step 3, and then you'll have to manually move it yourself to the end position you're looking for. This would also remove the necessity for Step 2, I believe.

 

Why this particular use-case? Because most often than not, I find myself in the situation of having to scale items uniformly, and the way it currently works includes a lot of intermediary steps and a lot of dragging (which also glitches a lot when using Smart Guides). Doing all this just by selecting the base anchor point, the point you want to scale, and the endpoint where you want to arrive would be so much easier.

 

Looking forward to hearing your opinions on this. Also, I'm happy to explain things further if anything above doesn't make complete sense.

TOPICS
Scripting

Views

211

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Apr 04, 2022 Apr 04, 2022

Likes

Translate

Translate
Adobe Community Professional ,
Mar 15, 2022 Mar 15, 2022

Copy link to clipboard

Copied

Hi @Eduard Buta, I know what you mean. Actually to do what you ask would require a plug-in to be written to make a special scale tool. It's not a bad idea, but I have no idea how to do it.

 

For what it's worth, I find myself having the same issues you have and my solution is the following:

1. using snap to point ON

2. snap an anchor point of the selected object to an anchor point of another object (both chosen specifically, not randomly!)

3. click once with the scale tool on that point

4. click and drag with the scale tool on another point *of the selected object* (again, chosen specifically)

5. drag until this point snaps to a point on the underlying artwork (usually the same object from step 2) and release. Note: DO NOT HOLD SHIFT—holding shift to constraint proportions will mess up the snapping! So now you have scaled your object correctly in one dimension, but probably wrong in the other dimension.

6. Press Return key to show the scale dialog box and copy the value from the relevant dimension (Horizontal or Vertical), then press ESC key to exit scale dialog box.

7. Undo

8. Alt-click with scale tool on whatever point you want (usually the point from step 2). This will show the scale dialog box.

9. Paste the value from step 6 into the Uniform scale field and press return.

 

Admittedly this method seems long winded but with practice it becomes quite fast.

- Mark

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 15, 2022 Mar 15, 2022

Copy link to clipboard

Copied

Thanks for the detailed breakdown, Mark. My go-to technique was selecting the base anchor point that remains fixed and dragging from the opposite corner using the built-in Uniform tooltip as a guide. It gets super annoying when you're working with huge shapes, but I still find it just a bit easier than going through that whole workflow you've described above.

 

To your knowledge, is it possible to scale shapes with scripts? And most importantly, is it possible to choose the fixed point based on where you'll do the scaling from? My post was mainly a curiosity as to whether such a thing would even be possible with some advanced scripting.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 28, 2022 Mar 28, 2022

Copy link to clipboard

Copied

Do you need something like this?

 

ScaleTool.gif

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 28, 2022 Mar 28, 2022

Copy link to clipboard

Copied

Nice! Did you make that? I like it. 🙂

- Mark

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 28, 2022 Mar 28, 2022

Copy link to clipboard

Copied

Yeah, I made  a quick prototype. I can upload an aip file for Win platform a bit later.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 28, 2022 Mar 28, 2022

Copy link to clipboard

Copied

I'm really intrigued. Your (and Eduard's) UI makes sense to me. Yes, I'd be grateful to be kept in the loop if you go further with this.

- Mark

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 28, 2022 Mar 28, 2022

Copy link to clipboard

Copied

I'm on MacOS though. Not sure what makes it Win only... maybe I could compile the source on my machine? Just thinking ahead.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 03, 2022 Apr 03, 2022

Copy link to clipboard

Copied

This looks absolutely perfect. Please let us know if you'll be willing to share it anytime soon!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 04, 2022 Apr 04, 2022

Copy link to clipboard

Copied

LATEST

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines