Script to convert all colors to CMYK Process?

Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Script to convert all colors to CMYK Process?

Viewing 9 reply threads
  • Author
    Posts
    • #56941
      Cindy Kelley
      Participant

      Does a script exist that can convert all spot colors to CMYK Process. Seems I am having to convert colors in every document before packaging.

      Thanks for the script info or any other work around out there :)

      cindy in indy

    • #56942
      David Blatner
      Keymaster

      I don't know of a script, but that is pretty easy to accomplish with the Ink Manager. Just turn on a checkbox and they all get changed. Yes?

      Oh, but you're packaging, not printing or exporting…. hm… interesting. Yes, I can see how that would be helpful to have a script that just converts them all.

    • #56943

      I wonder if this is enough:

      app.activeDocument.colors.everyItem().properties = {space:ColorSpace.CMYK, model:ColorModel.PROCESS};

      Save a copy of your document before, and check everything after running!

    • #56952
      Cindy Kelley
      Participant

      Jongware to the rescue, as usual :)

      but,

      I used your Select Code button and pasted the text in AppleScript Editor but it wouldn't let me save due to a syntax error.

      I pasted in Extendscript Tookkit.app and saved it to my Indesign CS5 scripts folder, restarted Indesign, created a new doc, they some spot color objects on it, ran the script and it worked.

      Many many thanks.

    • #56956

      Yeah, sorry — I accidentally left out what it was for. This is Javascript, which is something entirely different from Applescript; they might as well be two different languages. Oh wait — they are :p

      The AppleScript Editor can only handle AppleScript; with the ESTK you can edit lots of different programming languages, but fortunately its default setting for new documents is … Javascript! (A lucky escape for me, there!)

      I prefer Javascript over AppleScript — both scripting languages have their strengths, but Javascripts single huge advantage is the same script works on both Mac OS X and Windows versions of InDesign!

      AppleScript, on the other hand, only works on OS X. I've said on a few occasions the third supported option, VBScript, has no good points at all – but that's just me. Anyway, VBS only works on Windows.

      (Edit:)

      .. saved it to my Indesign CS5 scripts folder, restarted Indesign ..

      You don't have to do that! Next time you save a script into the Scripts folder and go back to InDesign, you will see it's already there, in the Scripts panel!

    • #76004

      Thank you, works great with Indesign CC 2014. How could I get the ‘Name with Colour Value’ check on too within the Swatch options?

    • #76163
      Masood Ahmad
      Participant

      Jongware, I had a script with me which deletes all the unused colours. I inserted your script code at the end of that script to do the following and it worked great:

      1. Add unNamed Colours
      2. Delete Unused Colours
      3. Convert Colours to CMYK Process

      I renamed it: Swatches_Add-UnNamed_Delete-Unused_Convert-2-CMYK-Process

      The script is here including your one line code;

      #target indesign
      app.menuActions.item("$ID/Add All Unnamed Colors").invoke();
      var myIndesignDoc = app.activeDocument;
      var myUnusedSwatches = myIndesignDoc.unusedSwatches;
      for (var s = myUnusedSwatches.length-1; s >= 0; s--) {
      var mySwatch = myIndesignDoc.unusedSwatches[s];
      var name = mySwatch.name;
      if (name != ""){
      mySwatch.remove();
      }
      }
      app.activeDocument.colors.everyItem().properties = {space:ColorSpace.CMYK, model:ColorModel.PROCESS};

      • #111366

        @Masood Thanks for the thorough script that does exactly what I want! And thanks to everyone for their contribution.

        I’m curious if there’s a way for the script to also rename those colors (ie PANTONE, user-defined) to the CMYK values.

    • #98545

      Hi.

      I need to convert all process swatch colors to an specify color. Black 50%

      Is ti possible?

      Ps. Indesign CS6

      Thanks

    • #98554
      David Blatner
      Keymaster

      Luis, what do you mean by 50% black? Are you trying to convert spot colors to process colors? Or change one color to another color?

    • #101173
      Matt Martel
      Member

      Jongware, I just had to join this site so I can thank you. Brilliant little piece of code that probably save me two hours work across many, many documents.

      Cheers.

      Matt

Viewing 9 reply threads
  • You must be logged in to reply to this topic.
>
Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo