Thursday, April 15, 2010

Sorting Adobe InDesign PDF and Print Presets

I don’t know about you, but I use the print and pdf presets in InDesign for everything.

The biggest problem is that you cannot sort entries after you have created them.
A search on the internet and found these cool tricks for Indesign.

On the Fly menu sorting in InDesign (SUPER SECRET TRICK)
http://indesignsecrets.com/organizing-print-presets.php

This trick is cool, but is only a temporary fix. What I was looking for was something more permanent. More searching came up with this gem: (credit to Dave Suanders)

Do the following to use this script,
  • Copy and paste the text below into a new text file
  • Name the file "Sort Presets.js" and save it to the following location
    Applications/Adobe InDesign CS4/Scripts/Scripts Panel
  • Select the script from the scripts panel in InDesign to run it.
It won't look like it did anything, but when you select the pop-out menus for print or PDF presets, you will notice that they are all sorted!

//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

}

No comments: