Monday, February 09, 2009

UPDATE: CopyToMultipleObjects.js Now with more options!

This one goes out to all you Cartography Aficionados,

I've checked out cartoTalk.com today.
(thanks to Hugo for hawking my scripts there.)

I did a vanity search of the forums, and found some of you folks would be a lot more chummy with my Copy To Multiple Objects script if the objects were allowed to keep their original proportions.

Since, I was feeling all warm and fuzzy this afternoon thanks to all the positive feedback on my latest offering, I've updated copyToMultipleObjects.js to now offer the option of NOT resizing when copied.

Enjoy,
-J

10 comments:

Hugo Ahlenius said...

Cool! thanks.

Blender Sushi said...

Hi John,

Cool script. But I think the script is behaving strange sometimes.

From my understanding is that:
- you select the master X object
- select other object(s) to be copied into
- run the script

Sometimes the script does something funky and copied the wrong object, instead of the master X object. Maybe a little bug?

I like this script a lot because you can replace "dummy objects" with the final more complex object.

Thanks John.

John said...

I believe the script sources from the front-most object, not the first one selected. Hopefully this gives you some more reliable results.

best,
-J

Blender Sushi said...

"Front-most object" clears my confusion. Cheers John!

Ty said...

Hi, great script.

I have been reviewing this script and similar replace and copy scripts and have not found one that also preserves the rotation of the item being replaced.

Is this possible to preserve this attribute and add it to such a script? Do any of your scripts offer this or are you aware of any that include rotation preservation?

Any feedback, advice, or even encouragement is welcome ;-)

Thanks for your time and efforts and sharing your great scripts!

Thanks,
Ty

PS: I am re-submitting this post as I am unsure if it went through, sorry if you already received it ;-)

John said...

Hey Ty,
Thanks for posting! I'm sorry for the delay, I'm really swamped right now. I don't know of such a script, but one could modify my script to do rotation. I have just moved my stuff to github, so if you or anyone you know wants to take a stab at it, you're welcome to give it a shot...
I wrote an article on Matrix transforms on objects in illustrator a while back... Ah, here it is: http://js4ai.blogspot.com/2010/11/flip-on-x-axis.html

Cheers,
-J

Ty said...

Hi John,

Thanks so much for the feedback and taking time to reply. It really gives me encouragement to know its actually possible.

I am just getting into Illustrator scripting (JS), I have had a great time researching others scripts (yours are wonderful!) and have written a number of my own already for various tasks I desire.

But this is the one I cant seem to wrap my head around, and I found it odd that all the scripts I found for copying/replacing an item with another do not deal with or include rotation. I searched pretty exhaustedly and figured perhaps it was not possible for some reason, with not knowing in-depth Illustrators methods of things I just assumed it was not possible since no script or references I found for such scripts dealt with it.

Thus far I was not able to imagine how to gather and set the rotation values. You give me hope that it is possible, however up to this point it has eluded me. I will look into the "matrix transforms" as you pointed out.

Again I appreciate your time, and you give me hope that it is in fact possible. I just am not sure being new to Illustrator scripting if I can sort it out, but I will roll up my sleeves and give it a go.

Thanks again John for all you offer the community with your wonderful scripts and resources. Thanks again for taking the time to respond, I greatly appreciate it.

Ty

John said...

Hey Ty,
Sadly, I'm also a bit of a noob myself when it comes to matrix transforms. I've learned everything I know about them by reading internet posts and by fiddling with them using my explore script. I think I remember that you might have to rebuild the matrix (as an array of arrays) and then apply the whole thing to an object, rather than directly changing values. Let me know how it goes.
cheers,
-J

Ty said...

Hi John,

Sorry to bother you again, just wanted to give an update, I still cant seem to wrap my head around using a Matrix, as it applies to this situation.

I did however find a thread on Adobe's forum that referenced your site and one of your scripts, as well as another simple script posted in the thread itself.

http://forums.adobe.com/thread/939631

I was advised there by members to use "tags". Which I tried and have had some success but still remain to have questions and sadly have not been able to seem to get any further help on the outcomes I am getting thus far from the forum?

Still trying, but sadly struggling ;-)

John said...

Hey Ty,
Sorry to hear you're having such trouble getting assistance. It looks like you are blazing a trail, and have a pretty good handle on what the problems are. If you can get things to rotate at all, then you should be able to handle the corner cases with further testing. Sadly, sometimes, there are a lot of corner cases. Email me direct if you want to troubleshoot.