13 Replies Latest reply on Jan 9, 2017 10:28 PM by Silly-V

    Writing scripts to move layers

    GratefullyDyed

      Hey!


      I am hoping to speed up my workflow with a script of some sort. If someone can help it would be greatly appreciated. I am not very familiar with scripts and assuming this will be above my level of expertise, so if someone would like to help write this script for me I am willing to pay for it to be done. Any direction is appreciated. not even sure if I can do what I am after.

       

      Ok so, I use illustrator mainly for creating printing templates for apparel. there is a panel for the front of the garment, back, sleeve, etc. Each panel is made into a clipping mask and a copy of my artwork layer will go under each mask to make something like this:

       

      2zhe5qv.png

       

      I would start with the 3x like you see in the picture, save it, and then move down in size. I would have to scale the XXXL group down a small amount so the panels fit the XXL group more closely. Then I would move the individual XXXL panels to fit over the corresponding XXL panels and after they are where they need to be I would drag the artwork layers down the the XXL clipping masks, save, and repeat the process.

       

       

      or5ea0.png102lf89.png

       

       

      After the original placing of the artwork how I want it there really is not anything but to resize the group, move the individual layers to fit on top of the next size down, and then dropping down all of the artwork layers. I feel like all of this can be automated in some way. This was for a TEE. I do this for tee's, tanks, hoodies, etc.

       

      If you think you could help with this it would be greatly appreciated. I can provide any more info you need, such as a video of the process. Just let me know what you need from me and if this would even be possible.

       

      Thank you

        • 1. Re: Writing scripts to move layers
          williamadowling Level 4

          Absolutely possible. This is what i do at work every day.

           

          Here at Illustrator scripting we're driven by community participation and any number of people here are ready and willing to help someone learn or help troubleshoot and debug code they're working on. But as you said, it may be above your level of expertise (i got started here exactly like you and decided to try and learn it myself, and it turned into an entire department at my company because it was so wildly successful at saving time and money).

           

          If you're interested in learning the Illustrator API and Javascript, we're here to help right away.

           

          Otherwise, I'm sure your inbox will see some love from any of the truly talented developers around here.

           

          Best of luck to you!

          • 2. Re: Writing scripts to move layers
            Silly-V Adobe Community Professional

            I was thinking, why don't he just have linked images in the clipping masks which can be sized down to each of the mask areas while being linked to the same file that can be changed to make all of the products change?

            • 3. Re: Writing scripts to move layers
              williamadowling Level 4

              that's a great idea. that would definitely make changes easy

              • 4. Re: Writing scripts to move layers
                GratefullyDyed Level 1

                Thanks for the responses! I would love to learn how to do this stuff on my own but I do think it is above what I am capable of currently. I may be surprised though!

                 

                Silly-V, I have thought about using linked images but I do not think it would really help the workflow too much and may even slow it down with the changing out of all the images and what I need to do to make them print properly. I think the best way would be to manually set up the first file (largest size) and the run an automation to complete the rest of the sizes. In photoshop this kind of automation would be pretty simple to set up but actions in Illustrator do not work nearly as intuitive as the PS actions do. Hoping a script could be what I am looking for.

                • 5. Re: Writing scripts to move layers
                  williamadowling Level 4

                  At the risk of messing up any project you might have pending with anyone, I believe I can clarify what Silly-V was saying. I can't imagine that using linked images would slow down your workflow. Here's how i picture it..

                   

                  You have one "blank" file setup that contains each size of a particular garment. So for each size you have a clipping mask with a linked image placeholder in it. So you'll have a clipping mask for the front, back and collar (or whatever pieces) with the linked image already clipped in and scaled appropriately.

                   

                  Then, it's just a matter of opening the blank file, re-linking the image (which should automatically replace all the existing linked images that are already scaled appropriately for each piece) and then you just have to export your output PDFs (or whatever filetype you print).

                   

                  It's a time investment up front, but then each new design should only be a matter of a few clicks.

                  • 6. Re: Writing scripts to move layers
                    Silly-V Adobe Community Professional

                    He said that the issue is that the movement of the shapes after the new artwork is imported, I assume because the different artwork needs to be moved around every different piece for best printed look. To which I suggested a system of a couple of files - one where all the sizes are located and one where just the biggest size is located with all the composing artwork shapes clipped into the largest size. He then has to arrange only the one file with the individual largest size shapes and save, whereby the multi-size template will be automatically updated. The only problem is that if there is needed to be specific positional editing which is different for different sizes - but as the objective is to automate the same placement/scaling of shapes, I assume this must not be a common demand here.

                    • 7. Re: Writing scripts to move layers
                      williamadowling Level 4

                      hmmm. i guess i'm not understanding the process. I'd need to see the existing workflow to figure out how to streamline it.

                      • 8. Re: Writing scripts to move layers
                        Silly-V Adobe Community Professional

                        I think it's this: He first arranges the art for the largest size under the largest clipping paths and then has to duplicate the art pieces, pasting each one under the smaller-sized clipping paths. The reason having all placed images within one template that has all sizes would be cumbersome is that he positions the images (probably proper rotation & panning to encompass more interesting art within the cutlines) - so while the art will instantly update on new image import, he'd still have to re-position every clipped art shape. I think that with 2 templates where one is just the largest size and the other is one with all sizes, this could be solved. The one thing to make a tiny script for could be auto-relinking multiple placed files to another destination though - as Illustrator forces you to select and click for every single placed file, even if they are identical and you want them all to go to the same new source.

                        • 9. Re: Writing scripts to move layers
                          GratefullyDyed Level 1

                          Hey guys,

                           

                          I appreciate the feedback. i will make a short video and post the link on here to better show the workflow for these asap.

                           

                          Thanks!

                          • 10. Re: Writing scripts to move layers
                            GratefullyDyed Level 1

                            Took longer than anticipated with a busy start to the year here but I went ahead and made a video to show the process. If anyone thinks they can do something to help automate this as much as possible please get back to me at your convenience.

                             

                            Thanks!

                             

                            Video - Dropbox - Templating-Script-Vid.mp4

                            • 11. Re: Writing scripts to move layers
                              tomr11694738 Level 1

                              GD, you are a hard-working and industrious man.

                               

                              Have you tried SYMBOLS?

                              • 12. Re: Writing scripts to move layers
                                GratefullyDyed Level 1

                                lol thanks Tom!

                                 

                                I have tried symbols and it's not really any use to me. The artwork itself is not really a problem at all, and just putting it in there and duplicating it when needed works just fine. I need to automate all of the repetitive tasks that take up the majority of the time for these templates. Moving the artwork layers down to the next sizes clipping group would be a great start.

                                • 13. Re: Writing scripts to move layers
                                  Silly-V Adobe Community Professional

                                  I checked out the video, here's some thoughts!

                                  - If you kept one such template that has been processed for all sizes, if you changed the image inside via link panel ( a script can easily relink all files, too) then you could have instantly made a new hoodie with all different sizes.

                                  - The problem with the above is that in all these different designs, the placement for each piece may be different as to how the artwork fits within its clipping path.

                                  - So you could have a 'size-template' file with all sizes already arranged on all different artboards but each of the pieces that are clipped off are holding a placed file which has just the largest-size design with all pieces on different artboards. The size-template file would reference the artboards inside the one-size file, and those reference placed items would be pre-arranged and pre-scaled.

                                  - Now you theoretically would need to change the art inside the one-size file to have an instant new multi-size file.

                                  - Using the new Asset Exporter you can save jpegs of all artboards with their unique names followed by whatever special suffix you add.

                                   

                                  While it's totally all scriptable, the native options come close to what you need here, unless there's a prohibitive reason I'm not aware of.