Changing gridlines with extendscript
I'd like to build a script that automatically adjusts the "Gridline every: ### pixels" preference based on the active comp's resolution. Yes I know about the proportional grid, but I like that the non-proportional grid has subdivisions so I prefer to use that. The issue I'm running into is that if I change the preference's value through extend script, it doesn't update in the comp viewer until I've opened and closed the preferences window. However, if I try to change the proportional grid's division, it updates in the comp viewer instantly. For whatever reason the preferences for the normal grid are in Adobe After Effects 14.0 Prefs-indep-general.txt, while the the preferences for the proportional grid are in Adobe After Effects 14.0 Prefs.txt, so I'm thinking that's probably the root of the problem. Anyone have any thoughts on what's causing this obstacle, and maybe a solution to fix it? Here's the code to change the preferences:
// Changes grid to every 64 pixels
app.preferences.savePrefAsString("Main Pref Section v2", "Pref_GRID_PIX_PER_DIV", "64.000000", PREFType.PREF_Type_MACHINE_INDEPENDENT);
// Changes proportional grid to 8 increments horizontally
app.preferences.savePrefAsString("Main Pref Section v2", "Pref_ANIMGRID_CELS_HORIZ", "8.000000");
