Ah Richard, you’re in luck! You basically only have to change “cursorKeyIncrement” to “kerningKeyIncrement”. The Kerning Key Incement value is not in ViewPreferences, but in TextPreferences. Other than that, it looks pretty much the same:
app.activeDocument.textPreferences.kerningKeyIncrement = setWidth.editValue;
A few notes, though: when copying the above script, I noticed double quotes were translated to curly “smart” quotes, and scripts do not like these at all. Also, the last value in yourList is missing its quotes altogether – it will throw an error, because the dropdown list expects only text strings. Finally, Nudge values allow fractions (0.01 is fine) but Kerning accepts whole numbers only. So, you need to populate yourList with a range of acceptable values. And finally finally, you must replace the dialog title with a bad pun based on kerning, not nudging:
//DESCRIPTION:Set Kern Nudge Value
// A Jongware Script 11-May-2018
var yourList = ["1", "2", "5", "10", "20", "50"];
var val = app.activeDocument.textPreferences.kerningKeyIncrement;
var aDialog = app.dialogs.add({name:"Kern you feel it", canCancel:true});
with (aDialog)
{
with(dialogColumns.add())
{
with(dialogRows.add())
{
staticTexts.add({staticLabel:"&Kern", minWidth:80});
var setWidth = integerComboboxes.add({editValue:val, minWidth:100, largeNudge:10, smallNudge:1, minimumValue:1,maximumValue:100, stringList:yourList});
}
}
}
if (aDialog.show() == true)
app.activeDocument.textPreferences.kerningKeyIncrement = setWidth.editValue;
Some other changes in the dialog itself: as Kerning only supports whole numbers, no need to ask for a “real” (fractional) number, “integers” (whole numbers only) are fine. The minimum and maximum allowed Kern Step values are 1–100, so best not to allow anything outside that range.