4 Replies Latest reply on Aug 2, 2013 3:30 AM by Colin Flashman

    IDCS6 MAC OSX: trying to make a map to new spot script

    Colin Flashman Adobe Community Professional

      Hello all.

       

      I have a plethora of InDesign files that contain a custom-named spot color called PMS 295. So that the colour can be properly mapped using our RIP it needs to have the correct name "PANTONE 295 C" but the correctly renaming the source of the offending colour has the potential to affect other work. I'm after a script that will make the properly named colour and then map the PMS 295 colour to the correctly named colour.

       

      For ONCE, I have tried to do this myself, and I have the first part sorted! I can add the colour to the document using the following snippet of code:

       

       

      app.activeDocument.importAdobeSwatchbookSpotColor ("PANTONE 295 C");
      

       

      But getting the ink manager to map PMS 295 to this newly added colour is doing my head in. Is this something that is possible to script?

       

      Many thanks

       

      Colly

        • 1. Re: IDCS6 MAC OSX: trying to make a map to new spot script
          DaveSofTypefi Level 2

          This is not something I've ever done, but have you tried setting the aliasInkName property of the ink (in the document inks collection)?

           

          Something like:

           

          myInk = myDocument.inks.item("PMS 295");

          myInk.aliasInkName ="PANTONE 295 C";

           

          Dave

          • 2. Re: IDCS6 MAC OSX: trying to make a map to new spot script
            Colin Flashman Adobe Community Professional

            Thank you DaveSofTypefi. I've marked the answer as correct, but it needed one tweak: change the myDocument to app.activeDocument

             

             

            app.activeDocument.importAdobeSwatchbookSpotColor ("PANTONE 295 C");
            myInk = app.activeDocument.inks.item("PMS 295");
            myInk.aliasInkName ="PANTONE 295 C";
            

             

            otherwise it's all good

             

            Colly

            • 3. Re: IDCS6 MAC OSX: trying to make a map to new spot script
              Laubender Adobe Community Professional & MVP

              @Colly –  sometimes we use descriptive variables to illustrate something. The "my" in the name is always an indication, that a variable is in play, that has to be defined elsewhere… We could debate now, if that is "good style" or not, but no. I don't do that right now ;-)

               

              It's kind of "dummy" code and not meant to work immediately.
              In the case of "myDocument", you could use an additional line of code to define the variable "myDocument" at the start of the snippet and leave all other incidences of "myDocument" unchanged in the code:

               

              var myDocument = app.activeDocument;
              

               

              or you work with index 0 in an array like fashion:

               

              var myDocument = app.documents[0];
              

               

              or in a collection like fashion ("documents" is a collection of single document objects, and if you want to point out that to you, use the following syntax):

               

              var myDocument = app.documents.item(0);
              

               

              or you could have worked with the name of an open document (amongst others):

               

              var myDocument = app.documents.itemByName("MyDocumentName.indd");
              

               

              There are other examples as well…

               

              Uwe

              • 4. Re: IDCS6 MAC OSX: trying to make a map to new spot script
                Colin Flashman Adobe Community Professional

                thank you for the explanation.

                 

                the only reason that I mentioned the change in my script is that if I was to purely cut and paste dave's script and put it into my script, it wouldn't work until  myDocument was defined. this is par for the course for those familiar with scripting, but for users with little or no scripting experience who are looking for a script that will work now with little intervention, they may not be aware of this extra instruction.

                 

                nevertheless, the script does what I need it to do and I hope it can help others in similar situations.

                 

                Colly