editable poly>detach faces>uvw map: 1 click script

greetings, im using max 2021 and some of my scripts arent working from 2014. i had one that would take a selected mesh, convert it to editable poly, then detach faces and apply a uvwmap all with one click. this was used to easily make imported geometry easily texturable for rendering.
my scripts got wiped with the old version of max, and this little bit is all thats left-and its giving me an error in max 2021. can yall help me sort this out? Thanks!

selected objects only:

for o in selection where classof o == Editable_mesh do (
addmodifier o (Poly_Select())
maxOps.CollapseNodeTo o 1 off
)

whole scene:

for o in geometry where classof o == Editable_mesh do (
addmodifier o (Poly_Select())
maxOps.CollapseNodeTo o 1 off
)