Skip to main content
Paul Riggott
Inspiring
November 26, 2008
Question

Custom sort, help required

  • November 26, 2008
  • 1 reply
  • 681 views
Please could someone tell me what I am missing/what to do next to get this sort working?



var dsc = app.defaultSortCriteria;

var sc1 = new SortCriterion("sortByCity", "string","http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrCity","City");

dsc.push(sc1);

try{

var sortHandler = new ExtensionHandler("sortHandler");

}catch(e){$.writeln(" New Extension Handler " +e.message);}

try{

app.registerExtension(sortHandler);

}catch(e){$.writeln("Registering Handler " +e.message);}

app.registerPrefix( "bridge:sorts:", sortHandler);

try{

var customInfoset = new Infoset("customInfoset", dsc);

}catch(e){$.writeln("New Infoset " + e.message);}

try{

app.registerInfoset(sortHandler, customInfoset);

}catch(e){$.writeln("Register Infoset " + e.message);}



var mySortObj = {};

mySortObj.name = "sortByCity";

mySortObj.type= "string";

mySortObj.reverse = false;

var mySortsArray = [];

mySortsArray.push(mySortObj);

try{

app.document.sorts = mySortsArray;

}catch(e){alert(e.message);}
This topic has been closed for replies.

1 reply

Paul Riggott
Inspiring
November 30, 2008
Update, just tried the CustomSortExtensionHandler.jsx from SDK CS3 and CS4 They do not work so I don't think I stand a chance!