Question
Custom sort, help required
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);}
