7 Replies Latest reply on Feb 3, 2017 7:29 AM by cbishop01

    PLace images in a selected Frame with Script ?

    cbishop01 Level 2

      Hi All . I'm basically wondering if it would be possible to have a script with a list of about 10 Different pieces of art that can automatically place the in the Frame when I CLick on it. It wound matter if its a Named list or Pictures. A Mockup Picture is below if its possible.  If there is something like this please point me in that direction.Screen Shot 2017-02-02 at 1.13.15 PM.png

        • 1. Re: PLace images in a selected Frame with Script ?
          cbishop01 Level 2
          var w = new Window("dialog");
          w.spacing=0;
          var headers = w.add("group"); headers.spacing=0;
          headers.margins = [0,5,0,0];
          var dimH=[0,0,150,20];
          headers.add("statictext", dimH, "\u00A0Black");
          headers.add("statictext", dimH, "\u00A0Color");
          headers.add("statictext", dimH, "\u00A0White");
          headers.graphics.backgroundColor = w.graphics.newBrush(
          w.graphics.BrushType.SOLID_COLOR,[0.7,0.7,0.7], 1);
          for(var i = 0; i < headers.children.length; i++)
          headers.children[i].graphics.font = ScriptUI.newFont ("Arial", 'BOLD', 12)
          var columns = w.add("group"); columns.spacing=0;
          var dimC=[0,0,150,200];
          var ml;
          mL = columns.add("listbox", ["0", "0", "150", "350"]);
            
              with (mL) {
           // for (var i = 0; i < 1; i++)   
                var listItem1 = mL.add ("item", "Test Art1" )
                var listItem1 = mL.add ("item", "Test Art2" )
                 mL.onChange = function() {
              var curSelection1 = this.selection.index;
              //alert ( "You clicked item: "  + this.selection.index );
              switch (curSelection1) {
                case 0:
                  app.doScript(script1);
                  break;
                     
              } 
            }
          }
          function script1(){}
            
            
          //var col1 = columns.add ("listbox", dimC, ["Art1","Art1","Art1"]);
          var col2 = mL = columns.add("listbox", ["0", "0", "150", "350"]);
            
              with (mL) {
           // for (var i = 0; i < 1; i++)   
                var listItem1 = mL.add ("item", "Test Art3" )
                var listItem1 = mL.add ("item", "Test Art4" )
                }
          var col3 = mL = columns.add("listbox", ["0", "0", "150", "350"]);
            
              with (mL) {
           // for (var i = 0; i < 1; i++)   
                var listItem1 = mL.add ("item", "Test Art3" )
                var listItem1 = mL.add ("item", "Test Art4" )
                }
          w.show();
          

          This list's it like i am wanting.  But how do i get the functionality to WHen its clicked it past's my EPS/AI/PSD file in the selected frame?

          • 2. Re: PLace images in a selected Frame with Script ?
            Loic.Aigon Adobe Community Professional

            Aren't libraries what you are looking for ? Drag and drop is probably close from one click

            1 person found this helpful
            • 3. Re: PLace images in a selected Frame with Script ?
              cbishop01 Level 2

              Libraries is exactly what i want.  I was playing around with CC Library And drag and drop would be perfect.  However many of us use the same indd files.  And we work from a server.  So if i use my CC library files and someone opens up the file they will have to relink everything on every file i do.  Unless theres a way to make CC library link directly to our Server Folder.  Thats why i'm trying to script it so that way no one will have to relink when they open the file

              • 4. Re: PLace images in a selected Frame with Script ?
                cbishop01 Level 2

                Never Mind I never knew you could make you own.  THis is 100000% what i was wanting.  Thank you very much.

                • 5. Re: PLace images in a selected Frame with Script ?
                  Laubender Adobe Community Professional & MVP

                  CC Libraries? Scripting CC Libraries is not easy.


                  Alternatively consider InDesign Library files (*.indl).
                  The scripting DOM is more open to script them:

                   

                  Adobe InDesign CS6 (8.0) Object Model JS: Table of Contents, Libraries Suite

                  Adobe InDesign CS6 (8.0) Object Model JS: Asset

                  Adobe InDesign CS6 (8.0) Object Model JS: Library

                   

                  InDesign libraries are actual files. You can store them in your server.

                  Assets could be page items and whole layouts.

                  You are even able to store selected guides.
                  ( CC Libraries cannot do this.)

                   

                  You can selectively view assets in InDesign libraries.

                   

                  Problem perhaps:

                  You cannot control access to libraries with several users.

                  Everyone could add and remove assets.

                   

                  If images should be used as assets simply make sure that you place the images from folders on your server.
                  Place them and then store them as assets into a library. The links are maintained, if you drag them out to your layouts. At least that's the case with my Dropbox experiment I did with two Macs where I stored an InDesign library from CS6 and had access to it with CS6 on two Macs in my network.

                   

                  Other problems?

                  To see if someone else in the network updated a library you have to close and re-open the library.

                  Make sure that all participants are on the same version of InDesign.

                   

                   

                  Regards,
                  Uwe

                  1 person found this helpful
                  • 6. Re: PLace images in a selected Frame with Script ?
                    Laubender Adobe Community Professional & MVP

                    cbishop01 wrote:

                     

                    Never Mind I never knew you could make you own. THis is 100000% what i was wanting. Thank you very much.

                    I think you first (or still?) confused CC Libraries ( Adobe Web service, its panel is available with InDesign ) with InDesign Libraries that are available since—I don't know—InDesign CS2 or CS3?

                     

                    The both library types are not the same.

                     

                    With CC Libraries you can exchange assets between different apps like InDesign, Illustrator and PhotoShop.

                    Not so with InDesign Libraries. With inDesign libraries you stay in the inDesign eco system.

                    However you can convert InDesign Libraries to CC Libraries. With some penalties…

                     

                    Regards,
                    Uwe

                    1 person found this helpful
                    • 7. Re: PLace images in a selected Frame with Script ?
                      cbishop01 Level 2

                      Yes at first i thought there was only the CC Library.  I then went through the Menu's and fount the File>New Library and used that and works like a charm. We will more than likely never use CC Library so the Indesign Library is exactly what i needed.  Thanks again.