• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

aling to key object (scripts, sdk or mouse macro)

Participant ,
Aug 22, 2023 Aug 22, 2023

Copy link to clipboard

Copied

hello 
from my understanding it is not possible to script that function Aling to > ket obj / artboard / selection

Is there any workaround ? it is very time consuming to click it for every object 
lets say my key obj is always on the top layer and the object to align is one layer below. 
i select both objects 

How to automate that ? 
I've looked thru scripts, and plugins but I'm not able to find anything yet. 
This : https://sysys.blog.shinobi.jp/Entry/104/ for me is not working yet 

the only thing I can think of is do a mouse capture macro to actually click the UI menus item + Jsx scripts hotkey to center it. 
Quite inelegant 

Any pointers would be greatly appreciated ! 

thx


-
www.instagram.com/mugen_labz/
TOPICS
Feature request , Scripting , SDK , Third party plugins

Views

398

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 2 Correct answers

Community Expert , Aug 22, 2023 Aug 22, 2023

Simply put, alignment/distribution is a rule-based get and set of coordinates. This can be achieved with scripts alone, without relying on the specialized functions provided in Illustrator.

 

I developed this script based on the concept.

 

Since the align and distribute process is written in my own code, alignment basis such as key object and artboard can also be handled by the script. This allows you to add keyboard shortcuts to it using other applications such as Keyboard Maestro or Karabiner-

...

Votes

Translate

Translate
Community Expert , Aug 23, 2023 Aug 23, 2023

I'm not sure I 100% understand what you are asking but I have a script that matches multiple objects to a 'key' object. The 'key' object can be either the top of bottom object of the selection. The match options are POSITION, SIZE, ROTATION, LAYER. When I need to align something to the artboard, I just draw a rectangle the size of the artboard and use that as the 'key' object. Cheers!

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 22, 2023 Aug 22, 2023

Copy link to clipboard

Copied

Simply put, alignment/distribution is a rule-based get and set of coordinates. This can be achieved with scripts alone, without relying on the specialized functions provided in Illustrator.

 

I developed this script based on the concept.

 

Since the align and distribute process is written in my own code, alignment basis such as key object and artboard can also be handled by the script. This allows you to add keyboard shortcuts to it using other applications such as Keyboard Maestro or Karabiner-Elements.

 

For key object acquisition, it basically uses OnegaiSDK, which you linked to, but this does not work on Apple Silicon. So there is a workaround based on the rule "try the Illustrator alignment, and the one that doesn’t move is the key object".

Votes

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 ,
Aug 24, 2023 Aug 24, 2023

Copy link to clipboard

Copied

thank you for the explanation ! 
well i was not able to make onegai work on latest AI version on w10 either. 
But your scripts are interesting ! I'll dive into that as well to learn a bit more 


-
www.instagram.com/mugen_labz/

Votes

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
Community Expert ,
Aug 23, 2023 Aug 23, 2023

Copy link to clipboard

Copied

I'm not sure I 100% understand what you are asking but I have a script that matches multiple objects to a 'key' object. The 'key' object can be either the top of bottom object of the selection. The match options are POSITION, SIZE, ROTATION, LAYER. When I need to align something to the artboard, I just draw a rectangle the size of the artboard and use that as the 'key' object. Cheers!

Votes

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 ,
Aug 24, 2023 Aug 24, 2023

Copy link to clipboard

Copied

thank you, your script is also great !
and I love the AiCommandPalette as well !
very good job and a lot of use-cases to dig here 

based on your code i was able to find what i needed. and automate that to a streamdeck XL 

Thank you ! great code here 🙂 


-
www.instagram.com/mugen_labz/

Votes

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
Community Expert ,
Aug 25, 2023 Aug 25, 2023

Copy link to clipboard

Copied

Glad to hear my script could help! I've been wanting a Streamdeck for my office. So many possibilities. Cheers!

Votes

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 ,
Aug 30, 2023 Aug 30, 2023

Copy link to clipboard

Copied

LATEST

it is awesome ! i use it very extensively for many use cases from office to live acts midi mapping. Daily with AI, (macros & shortcuts etc ..) 

by any means, take a XL, thank me later 🙂

You can also look at Companion for streamdeck. It is another software to program the streamdeck with advanced possibilities. Streamdeck software is nice enough tho  


-
www.instagram.com/mugen_labz/

Votes

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