var doc = app.activeDocument should do it.
↧
var doc = app.activeDocument should do it.