Hi Kurt,
I'm so happy - and I hope you are too - to tell you that you're wrong 🙂
I found this and it works. cm2pts is just my conversion constant for converting centimeters to points.
app.preferences.setRealPreference('Grid/Horizontal/Spacing', 0.9*cm2pts)
$.writeln("Spacing: " + app.preferences.getRealPreference('Grid/Horizontal/Spacing'));
app.preferences.setRealPreference('Grid/Vertical/Spacing', 0.9*cm2pts)
$.writeln("Spacing: " + app.preferences.getRealPreference('Grid/Horizontal/Spacing'));
app.preferences.setIntegerPreference('Grid/Horizontal/Ticks', 1);
app.preferences.setIntegerPreference('Grid/Vertical/Ticks', 1);
$.writeln("Hor ticks: " + app.preferences.getIntegerPreference('Grid/Horizontal/Ticks'));
$.writeln("Vert ticks: " + app.preferences.getIntegerPreference('Grid/Vertical/Ticks'));