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

Script to match size and position of foreground object with object behind it?

Explorer ,
Aug 07, 2018 Aug 07, 2018

Is there a script that anyone here knows of to match a foreground object's size and position to that of the object behind it? Currently I have to copy x, y, width and height values from the background object and paste them into the respective fields of the foreground object to match them. Thank you!

TOPICS
Scripting
1.5K
Translate
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

Community Expert , Aug 07, 2018 Aug 07, 2018

check Wundes copyToMultipleObjects script, his script deletes background object, so make a copy of it if you want to keep it.

GitHub - johnwun/js4ai: Collection of Javascripts for Adobe Illustrator

Translate
Adobe
Valorous Hero ,
Aug 07, 2018 Aug 07, 2018

This could work if we're working in a constrained scope of use - such as, there's got to be a grounding rule to help us determine which objects in the document are the background objects of what other objects.

Translate
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 ,
Aug 07, 2018 Aug 07, 2018

Yes the process would be to select the two objects and run the script. Alternatively a copy/paste transform attributes would be cool too. Especially if it popped up with a box asking what of the transform attributes you wanted to paste/apply to your other object i.e. (paste x values and height, or paste x, y, width and height values or just the y and the height values etc)

Translate
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 07, 2018 Aug 07, 2018

check Wundes copyToMultipleObjects script, his script deletes background object, so make a copy of it if you want to keep it.

GitHub - johnwun/js4ai: Collection of Javascripts for Adobe Illustrator

Translate
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 ,
Aug 08, 2018 Aug 08, 2018

Thanks Carlos, I tried that a couple of days ago, but I get a long complicated error message. It probably has something to do with the things I'm trying to apply this to are two groups containing compound paths.

2018-08-08 12_10_22-4th Floor.pdf_ @ 66.67% (RGB_GPU Preview).png

Translate
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
Valorous Hero ,
Aug 08, 2018 Aug 08, 2018

This means you downloaded the web page the script was rendered inside of, instead you should highlight the text in your browser and use copy/paste to then paste the text into a notepad text editor and then save as .jsx format.

Translate
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 ,
Aug 08, 2018 Aug 08, 2018

Oh wow, I thought when you right clicked to save the link to the .js file in github it downloaded the .js file not the webpage. That worked wonderfully! Thank you Silly-V and CarlosCanto!

Translate
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 08, 2018 Aug 08, 2018

These sorts of issues are common enough that I made a guide here:

Prepression: Downloading and Installing Adobe Scripts

Translate
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 ,
Aug 08, 2018 Aug 08, 2018
LATEST

Thanks Stephen_A_Marsh!

Translate
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