0 Replies Latest reply on Jun 23, 2010 6:05 AM by Colin Flashman

    [js][cs5] invoking menu actions to remove unused bits and pieces

    Colin Flashman Adobe Community Professional

      g'day there

       

      a post on the indesignsecrets forum spurred me on to get this done. a fellow poster asked if there was a single script which would add unnamed colours, deleted unused colours, unused master pages, unused styles, etc. it's a handy thing to have not just for me, but i'd imagine anyone using indesign who wanted to tidy up their finished art.

       

      so far, i have some of the items under control, but have been stumped trying to do the following:

      • add unnamed colors;
      • remove unused layers;
      • remove unused styles (everything from object, table, cell, paragraph and character)

       

      before doing this post, i did a search of the forums for "add unnamed colors" and came across this in a post from Jongware:

       

      You can't add unnamed colors in Javascript. Rather, that's what I learned, the hard way. But...

       

      In CS3 & 4 I can do it through menu actions (not supported in CS & CS2)

       

      this is probably naive of me, but all i really want to do is invoke the menu actions that i'd otherwise select with my cursor or access with KBSCs. really just trying to save a ton of mouse movements and clicks throughout the day.

       

      taking the first example (add unnamed colors) how would that be written in javascript to invoke it? i've searched the adobe indesign scripting guide for javascript and did find the bit on invoking menu actions, but i can't get my head around it.

       

      also, is invoking menu actions the right way of doing what i want to do or will it have unexpected consequences?

       

      many thanks

       

      colin