Here's what I came with, wich will move selected anchors to the left by 1/10 of the Keyboard Increment saved in the Preferences:
var myLength = app.preferences.getRealPreference('cursorKeyLength') / 10,
mySelection = app.activeDocument.selection,
myDistance = [0 - myLength, 0]; // move selected anchors to the left
for (var i = 0; i < mySelection.length; i++) {
// for anchors
if (mySelection[i].typename === 'PathItem') {
var p = mySelection[i].pathPoints;
for (j = 0; j < p.length; j++) {
if (p[j].selected === PathPointSelection.ANCHORPOINT) {
with(p[j]) {
anchor = [anchor[0] + myDistance[0], anchor[1] + myDistance[1]];
leftDirection = [leftDirection[0] + myDistance[0], leftDirection[1] + myDistance[1]];
rightDirection = [rightDirection[0] + myDistance[0], rightDirection[1] + myDistance[1]];
}
}
}
}
// for anything else
else {
with(mySelection[i]) {
position = [position[0] + myDistance[0], position[1] + myDistance[1]];
}
}
}
To move the anchors in another direction, change variable myDistance:
var myDistance = [0 - myLength, 0]; // leftward
var myDistance = [0 + myLength, 0]; // rightward
var myDistance = [0, 0 + myLength]; // upward
var myDistance = [0, 0 - myLength]; // downward