Skip to main content
Kazem Rahimi
Inspiring
September 23, 2021
Question

How to Change "Align to" option with script?

  • September 23, 2021
  • 1 reply
  • 1233 views

hi everyone,

is there a way to change "align to" option with script?

i want to write code for align object with my script to Artboard or to selections....

but the Align to option the Align Palette not chaneged.

Thank for answers...

 

This topic has been closed for replies.

1 reply

Charu Rajput
Community Expert
Community Expert
September 23, 2021

Hi,

May be following link will be helpful to you

 

For Selection or key objectss

https://community.adobe.com/t5/illustrator-discussions/library-for-aligning-objects-via-script/m-p/11925954

 

For artboard

https://community.adobe.com/t5/illustrator-discussions/script-to-align-selected-objects-to-artboard/m-p/5595164

 

Not tested myself but can give you an idea. It may not able to achieve what you want to see on UI,  but ofcourse end result will be same.

Best regards
Kazem Rahimi
Inspiring
September 25, 2021

Hi.

Thanks a lot for your response.

I wire the script for aligning,

the problem is that this method work well in the case that selected one object or one group,

but when I select an cliped mask object or group that has clip mask and etc dont work corectly,

 

use of align panel of Illustrator dont this problem. you can use align for objec or group that inside of many clip mask or etc.

my solution is that use an Action for the align object, and call the Action from a UI dialog and command button.

every thing is ok. but new problem is that i can not change the "Align to" option from my dialog....

thanks again.

best regards.

 

jduncan
Community Expert
Community Expert
October 1, 2021

Here's a script I wrote that matches selected objects on multiple attributes, alignment being one of those. The script also accounts for groups, clipping masks, groups inside of clipping mask, etc. You can read more here.

 

Download Script:

https://github.com/joshbduncan/adobe-scripts/blob/main/MatchObjects.jsx