8 Replies Latest reply on Jan 28, 2011 2:18 PM by caseyctg

    FREE Mutliple drop shadow javascript. Enjoy!!

    caseyctg Level 1

      var myObject = app.selection[0];

       

          for(var i=0; i<app.selection.length; i++){

       

              var myObject = app.selection[i];

       

               with(myObject.transparencySettings.dropShadowSettings){

                  angle = 135;

                  opacity = 33;

                  distance = .06;

                  mode = ShadowMode.DROP;

                  blendMode = BlendMode.NORMAL;

              }

       

       

      }

       

       

      Thanks,

      http://casey-govero.blogspot.com/

      http://caseygovero.com

        • 1. Re: FREE Mutliple drop shadow javascript. Enjoy!!
          [Jongware]-9BC6tI Level 4

          I hate to be a bother, but ... how does this differ from selecting multiple objects and then setting the Drop Shadow?

          • 2. Re: FREE Mutliple drop shadow javascript. Enjoy!!
            caseyctg Level 1

            Not a bother. I can see where some people might not see the usefulness of this script.

             

            Well, with this I would consider it a "preset" similar to object styles. You can certainly do this with the drop shadow menu item, but this script allows you to set a preset to reuse time and time again. I guess you could also do this with object styles, but those are relevant to one document, whereas with this you will always have the SAME drop shadow preset in indesign. I've found that I tend to lean towards a certain parameter with my drop shadows. Meaning I always like them at 40% opacity, with a 135 angle. Well rather than configuring this every time I want a drop shadow that looks like this, I can consider this a preset of sorts. Create your shadow style once and reuse it. Otherwise everytime you select a different set of objects, you have to manually set up your drop shadows styling again and again. 40% opacity, at .0625, with a spread of 30%. 

             

            With this you always have the same drop shadow to be used again and again all with one command. Run script. Lets say you have a 200 page catalog, and you want the same  drop shadow on every product. Well with the built in drop shadow menu item, you'd have to set it up the same each and every time....or go through and shift select every item in the document and then run the menu item drop shadow effect. But with this I can set my parameters once, and reuse it in any document, on any page with no reconfiguring.

             

            Make sense??

            • 3. Re: FREE Mutliple drop shadow javascript. Enjoy!!
              Marijan Tompa [tomaxxi] Level 4

              I think you should consider creating new Object Style without any opened document with exact settings for your drop shadow. I think that would be easier... What will happen if you want to change drop shadow and not having applied through Object Style? Do Find/Replace?

               

              --

              tomaxxi

              http://indisnip.wordpress.com/

              http://inditip.wordpress.com/

              • 4. Re: FREE Mutliple drop shadow javascript. Enjoy!!
                [Jongware]-9BC6tI Level 4

                Sure! Absolutely -- on reflection, I was thinking along those lines. Lots of my own scripts use "my personal defaults", so all I only have to hit a script to git what I want, where everyone else has to wade through oodles of options.

                 

                You might want to add a unit, though, to that point-oh-six distance. My set-up is in millimeters, causing me to think it didn't do squat.

                 

                ('m guessing you are using inches, so you could change it to ".06in". All measurements in ID scripts can use a string of numbers plus measurement unit abbrev.)

                • 5. Re: FREE Mutliple drop shadow javascript. Enjoy!!
                  caseyctg Level 1

                  Great point Jongware! Thanks.

                   

                  And to Marjin, honestly I didn't know you could do that...I thought the styles were relevant to a document as I've always tried to create them with an open doc. Thanks for the tip. That's very useful.

                   

                  I guess the good part is now people can use this for scripting as well.

                  • 6. Re: FREE Mutliple drop shadow javascript. Enjoy!!
                    caseyctg Level 1

                    Excellent blog Marjin. You have some great stuff on there.

                    • 7. Re: FREE Mutliple drop shadow javascript. Enjoy!!
                      Marijan Tompa [tomaxxi] Level 4

                      Thanks

                      And, by the way, I'm not Marjin... I'm Marijan

                       

                      Yes, scripting is awesome! Here is another example how to use Object Styles in combination with script to get applied while placing image to document: http://bit.ly/ghMDPX Unfortunately this only work for CS5.

                       

                      --

                      tomaxxi

                      • 8. Re: FREE Mutliple drop shadow javascript. Enjoy!!
                        caseyctg Level 1

                        oops! lol.

                         

                        The only problem I've found with the object styles is that in opening old documents. The style then disappears even if you've created that object style with all docs closed. So going to past documents, the object style disappears. So this still can be useful if editing old docs. 

                         

                        Great plugin though. I'll be trying that out for sure.