script problem

Hi,
I would like to make directions of spline more visible.
Yellow dot is sometimes not enough.
So I made a little script which use a real script of Paul Neale.
http://paulneale.com/clone-on-spline/
I did a maxscript.
When I open max and use the script I get an error.
I drag and drop maxscript file in max, and use the script, it works.
Any idea ?

(
if ((selection != undefined )and((classOf selection[1] == SplineShape) or (classOf selection[1] == Line)) ) do
(
	max modify mode
 
 
	spleen=selection[1]
 
	XX = (spleen.max - spleen.min).x
	YY = (spleen.max - spleen.min).y
	ZZ = (spleen.max - spleen.min).z
	MS = amax #(XX,YY,ZZ)
	print MS
	val = MS / 100
	dist = MS / 30
 
	ss = SplineShape pos:[0,0,0]
	ss.name = "jeter"
	addNewSpline ss
	addKnot ss 1 #corner #line [-val,0,0]
	addKnot ss 1 #corner #line [0,val,0]
	addKnot ss 1 #corner #line [val,0,0]
	updateShape ss
	ss
	select ss
 
	modPanel.addModToSelection (Renderable_Spline ()) ui:on
	$.modifiers[#Renderable_Spline].thickness = 0.001
	ConvertTo $ Editable_Poly
	modPanel.addModToSelection (PEN_CloneOnSpline ()) ui:on
	$.modifiers[#PEN_Clone_On_Spline].spline = spleen
	$.modifiers[#PEN_Clone_On_Spline].distance = dist
	$.modifiers[#PEN_Clone_On_Spline].Up_Vector_Index = 2
	$.wirecolor = black
	freeze $
	snapMode.toFrozen = false
	select spleen
	 for i = 1 to viewport.numViews do 
 	 (
    	viewport.activeViewport = i
   	viewport.SetShowEdgeFaces (true)
   	 )
 
)
)