8 Replies Latest reply: Jul 14, 2014 3:21 PM by Jim Beals RSS

    Sort (or rearrange) Print Presets

    3ABNPublishing Community Member
      I have about 15 Print Presets, named according to job. The problem is that InDesign lists them in the order they were created (random), instead of in alphabetical order. Is there any way to rearrange the presets so that presets for related jobs go together? (Alphabetical order would be fine, arbitrary according to my choosing would be better.)
        • 1. Re: Sort (or rearrange) Print Presets
          Community Member
          Yes: you can export them one by one, and re-import them... one by one.

          Oli.
          • 2. Re: Sort (or rearrange) Print Presets
            3ABNPublishing Community Member
            Groan ... but thanks! At least that would save deleting and recreating them. I wonder if the data is saved somewhere in a more conveniently editable format, like as XML preferences file?
            • 3. Re: Sort (or rearrange) Print Presets
              spancilhill Community Member
              This has come up before several times, Michael. My method (I've done this twice now) is to click on the print preset you want at the top of the list, click 'new' and name it. Then delete the old preset. Select the print preset you want second on the list, click 'new' and name it. Then delete the old and so on through your 'old' presets.
              • 4. Re: Sort (or rearrange) Print Presets
                Community Member
                This JavaScript sorts the printer presets, leaving the [Default] where it is at the head of the list (if I tried to include it, the script failed):

                Bad version deleted, see below

                I've only tested it with CS2, but I expect it works with CS1.

                To use the script in CS2, copy and paste to ExtendScript Toolkit and save with an appropriate name in the form ScriptName.jsx in the Scripts folder of the Presets folder of your InDesign CS2 folder (you could put it in a subfolder if you wish). Then to run the script, set-up the appropriate initial conditions and double-click the script's name in the Scripts palette.

                For CS1, resave from ESTK (if you have it as part of CS2, otherwise, use a text editor and save as plain text) in the comparable location but with a name in the form ScriptName.js.

                BTW, this is a version of one of the scripts I'll be featuring in my JavaScripting InDesign session at Seattle at the InDesign Conference Master Class. For more info, look here: http://www.barrycon.com/schedule.php?sid=1&cid=16 You'll find my session in the fifth column on Tuesday afternoon.

                Dave
                • 5. Re: Sort (or rearrange) Print Presets
                  3ABNPublishing Community Member
                  Thanks, Dave. Works like a charm. Perfect!
                  • 6. Re: Sort (or rearrange) Print Presets
                    Community Member
                    I have belatedly realized that this script I so proudly published a month and a half ago has a serious bug. the middle loop is wrong.

                    Here is the corrected version:
                    //DESCRIPTION: Sort Printer Presets
                    
                    myPresets = app.printerPresets;
                    myNames = myPresets.everyItem().name;
                    myNames.shift(); // lose [Default]
                    myNames.sort(lc); // sort remaining names
                    for (j = 0; myNames.length > j; j++) {
                      myPresets.item(myNames[j]).duplicate();
                    }
                    for (j = myNames.length; j > 0; j--) {
                      myPresets[1].remove();
                    }
                    for (j = 0; myNames.length > j; j++) {
                      myPresets[j+1].name = myNames[j];
                    }
                    function lc(a,b){
                      a = a.toLowerCase();
                      b = b.toLowerCase();
                      if (a > b) { return 1 }
                      if (b > a) { return -1 }
                      return 0
                    }
                    The previous version messed up the definition of the alphabetically first preset. Sorry it took me so long to discover this.

                    Dave
                    • 8. Re: Sort (or rearrange) Print Presets
                      Jim Beals Community Member

                      Dave,

                       

                      I finally after many years, got fed up and decided to search for a solution to this problem and I see you solved it almost 8 years ago. I am VERY GRATEFUL.  My only question is if it is possible to modify the script to do the same thing with document presets? Thanks again.

                      Jim Beals

                      james.p.beals@gmail.com