3Ds Max Script "Different commands stacking and auto cycling" under one hotkey?


So i got an idea from one little usefull script i use (didnt make just downloaded it from somewhere).
Is it possible to, in 3ds max, create a certain script, and then assign it to a shorcut (like “U” or “SHIFT+U”)?
This certain script would "stack"different commands for different subobject levels (and maybe even object level (like geometry vs spline)) and always automatically cycle through the commands to the one correct command/action conditional on what you have currently selected? And all this in ONE script, that is assign to ONE keyboard shortcut…?

If no VERTICES (VERTEX) is selected then “Target Weld”, If one vertices (vertex) is selected then “Target Weld” (again), If 2 or more vertices are selected then “Weld (open Weld dialog window)” (or just “Weld”).
The same goes for EDGE -If no EDGE is selected then “Target Weld”, If one edge is selected then “Target Weld” (again), If 2 or more EDGES are selected then “Weld (open Weld dialog window)” (or just “Weld”).
Something similiar would happen in “Polygon” subobject level= If one polygon is selected do (i dont know) - “Extrude”, if 2 polygons are selected do “Bridge”.
That means, different operations conditional on how many “things” in given subobject level you have selected, and different actions also for each sub object level (at least for 3 - Vertices, Edges and Polygons, Open Borders could be also usefull probably). And ALL of this in ONE script, that can be assign to one shortcut?

Is is practically possible and “easy” to do in 3ds max? Wont there be any “problems” or drawbacks? Like that it would take “too long” (like a second etc.) to auto cycle through all the available commands and automatically choose the correct one?

And would it be also possible to even include different commands not only for Editable polygon object (being it object or just edit poly modifier) BUT also for splines (all in one one macroscript, “call-able” through one keyboard shortcut)?

I would believe this would be REALLY useful to have like i dont know… maybe even 8 commands in ONE keyboard shortcut instead of like 8 keyboard shortcuts… But i dont really see such scripts around… i know really only about one that does this (and that one gave me the idea)… So is it possible without any drawbacks? Why arent there tone of scripts using this :-)…?


if that’s yourselves script , just add some ‘if’ expression
if not , you need write ‘if’ expression in a new file , and ‘filein’ that scripts


no… am asking if its possible at all to write :-)…?


as i said , write some ‘if’ ,such as

  if selection.count = 1 do
       case  subobjectLevel  of 
       1: (
            local n = (polyop.getVertSelection $  as array).count
            if n < 2 then ( filein "Target Weld.ms")
            else  ( filein "Weld.ms")
     2: do EDGE functions

if not filein others script , just use that functions , such as use $.toggleCommandMode #Weld instead of filein “Target Weld.ms”