The script generates three layers: for columns, rows and baselines. All these layers are the vector mask shapes filled with 10-percent opacity foreground color. As a result, the one Smart Object layer named [grid] remains.
Put script file in Presets → Script folder, where Photoshop installed (usually, that Programm Files → Adobe → Photoshop).
Then restart Photoshop, after that, the new script will be available in the Script list:
Now we can add shortcut to this script. Go to Shortcut settings Edit → Keyboard Shortcuts…, select in dropdown menu Shortcuts For: [Application Menus] item, find Files → Scripts → Modgrid and set some shortcut:
First, create new document, with necessary dimentions. Run the script, then setup window shows up:
Push button „Create grid“ and all done!
You could find one difficulty while comparing this script with the Guides. It appears if you need to hide immediately the grid.
This problem could be solved by one more simple script, which toggle shows/hides layer named [grid]:
Being installed like the first one, this script also could get it's own shortcut (note: some shortcut combinations couldn't be used. I didn't study them yet, so I couldn't tell you more and give the examples).