Copy link to clipboard
Copied
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!
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
These sorts of issues are common enough that I made a guide here:
Copy link to clipboard
Copied
Thanks Stephen_A_Marsh!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now