Copy link to clipboard
Copied
I am looking for a script that will work similar to Zamena script (for Illustrator). I need to swap the geometry of a bunch of objects that I've created in InDesign. After I made many, many copies of the object in question, I took a closer look at the bezier curves and they are not as clean as I would like. So I want to swap their geometry with a newer cleaner version.
Does such a script exist? I'm not a scripter, and I don't know any coding languages, so this is not something I can write for myself.
To illustrate what my script is doing.
Before running the script on that selection:
After running the script:
Path and position of the master is applied to all selected objects.
All other properties like stroke weight, stroke color, fill color are not transferred.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hi Kelly,
is this still an issue for you?
Looked a bit around but couldn't find a script for that purpose with InDesign.
How would you like to handle this if a script is possible?
Selecting the new object first, then adding all other objects to the selection that should be substituted?
Best,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hi Uwe,
I don't have any preference for how it should be handled. But your suggestion sounds good to me. The obejcts would just need to keep their same X-Y coordinates. Also, if it is possible, to just select the objects that have the same fill color as the first object.
Copy link to clipboard
Copied
Hi Kelly,
the only script I found that is very close to your task is Marc Autret's Equalizer script where one of the many features is to swap two selected objects:
Equalizer PRO 3.0 released!
Marc Autret, October 11, 2016
https://www.indiscripts.com/post/2016/10/equalizer-pro-3-0-released
Do all of your objects you want to exchange have the same size compared to the new master object?
If not how would you like to swap the master to the old objects? From the center of the object?
Thanks,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Thanks Uwe! I'll give Equalizer a try.
The old and new objects are the exact same size.
Copy link to clipboard
Copied
Then an ad-hoc script from my side could do the trick!
[1] Select your new master object first
[2] Then add all other objects you want to change to the selection.
[3] Run that script code on your selection:
var s = app.selection ;
var m = s[0] ;
var mp = m.paths[0].entirePath ;
for( var n=1; n<s.length; n++ )
{
var xy = [ s[n].geometricBounds[1] , s[n].geometricBounds[0] ];
s[n].paths[0].entirePath = mp ;
s[n].move( xy );
};
It should work if the objects are no compound ones and have only one path each.
It's not working as expected on objects that are flipped. If there are any objects like that, I could expand the code.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
To illustrate what my script is doing.
Before running the script on that selection:
After running the script:
Path and position of the master is applied to all selected objects.
All other properties like stroke weight, stroke color, fill color are not transferred.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Wow, Uwe, thant's great! Your script works wonderfully! Thank you so much. 🙂