Making a script have a category and icon

I want my script, when run in maxscript or dragged in to max from windows, to create an SB_Tools Category and automatically use the icon i have created. I've got the following code......

MacroScript SB_Tools_MsoMtl 
category:"SB_Tools" 
tooltip:"Multi/Sub Object Mtl" 
Icon:#("SB_Tools_Multi-Sub",1)				
 
        rollout roll_MSOP "Multi/Sub-Object Presets V1.1" width:350 height:496
	(
	group "Create In Active Material Slot:"
	(
	editText basename "Material Base Name: " width:190 height:16 text:"myMaterial"
 
	button btn_MSStandard "Standard Multi/Sub" tooltip:"Create Standard Multi/Sub Material" width:100 height:20 align:#left across:2
	spinner spn_stdnum_mtl "Count:" tooltip:"Number of Multi/Sub Materials" width:50 height:16 range:[2,100,10] type:#integer fieldwidth:35 align:#right
 
	button btn_MSVRay "VRay Multi/Sub" tooltip:"Create VRay Multi/Sub Material" width:100 height:20 align:#left across:2
	spinner spn_vraynum_mtl "Count:" tooltip:"Number of Multi/Sub Materials" width:50 height:16 range:[2,100,10] type:#integer fieldwidth:35 align:#right
 
	button btn_MSmentalRay "MRay Multi/Sub" tooltip:"Create MentalRay Multi/Sub Material" width:100 height:20 align:#left across:2
	spinner spn_mraynum_mtl "Count:" tooltip:"Number of Multi/Sub Materials" width:50 height:16 range:[2,100,10] type:#integer fieldwidth:35 align:#right
 
	)
 
	HyperLink Hypl_homepage "SB_Tools" align:#center width:65 height:15 address:"http://www.scriptspot.com/users/script-butler/" color:(color 6 105 213) hovercolor:(color 6 105 213) visitedcolor:(color 78 78 177)
 
	on btn_MSStandard pressed do
	(
	mat = multimaterial()
	mat.count = spn_stdnum_mtl.value
	mat.name = basename.text as String
 
	for i=1 to mat.count do
	mat[i] = standardmaterial name:(basename.text + i as String) diffusecolor:(random black white)
 
							meditmaterials[activeMeditSlot] = mat
	)--end on
 
	on btn_MSVRay pressed do
	(
	mat = multimaterial()
	mat.count = spn_vraynum_mtl.value
	mat.name = basename.text as String
 
	for i=1 to mat.count do
	mat[i] = Vraymtl name:(basename.text + i as String) diffuse:(random black white)
 
							                                   meditmaterials[activeMeditSlot] = mat
	)--end on
 
 
       on btn_MSmentalRay pressed do
	(
	mat = multimaterial()
	mat.count = spn_mraynum_mtl.value
	mat.name = basename.text as String
 
 
	for i=1 to mat.count do
	mat[i] = Arch___Design__mi name:(basename.text + i as String) diffuse:(random black white)
 
							                                   meditmaterials[activeMeditSlot] = mat
	)--end on
 
	)--end ro
 
 
        createDialog roll_MSOP 210 145
	)

When i drag it in from windoes or run it through Maxscript i get the following error.

MAXScript FileIn Exception
--Syntax error: at rollout, expected(
--In line: rollout r

Again I'm stupmed as the why this happens..... any one got a clue as to why? I've tried adding in Parenthesis and reordering, but nothing i tried works.

Cheers.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Script_Butler's picture

That simple?

So I was missing one open parenthesis? I'm sure I tried that..... Maxscript is so annoying when it's that simple...

Now I will compile it in to an .mzp so it's easy for everyone.

Thanks again Tassel.

Cheers.

Script_Butler

tassel's picture

MacroScript SB_Tools_MsoMtl

MacroScript SB_Tools_MsoMtl 
category:"SB_Tools" 
tooltip:"Multi/Sub Object Mtl" 
Icon:#("SB_Tools_Multi-Sub",1)				
 
	( -- Star Macro Script
        rollout roll_MSOP "Multi/Sub-Object Presets V1.1" width:350 height:496
		(
 
			group "Create In Active Material Slot:"
			(
 
				editText basename "Material Base Name: " width:190 height:16 text:"myMaterial"
 
				button btn_MSStandard "Standard Multi/Sub" tooltip:"Create Standard Multi/Sub Material" width:100 height:20 align:#left across:2
				spinner spn_stdnum_mtl "Count:" tooltip:"Number of Multi/Sub Materials" width:50 height:16 range:[2,100,10] type:#integer fieldwidth:35 align:#right
 
				button btn_MSVRay "VRay Multi/Sub" tooltip:"Create VRay Multi/Sub Material" width:100 height:20 align:#left across:2
				spinner spn_vraynum_mtl "Count:" tooltip:"Number of Multi/Sub Materials" width:50 height:16 range:[2,100,10] type:#integer fieldwidth:35 align:#right
 
				button btn_MSmentalRay "MRay Multi/Sub" tooltip:"Create MentalRay Multi/Sub Material" width:100 height:20 align:#left across:2
				spinner spn_mraynum_mtl "Count:" tooltip:"Number of Multi/Sub Materials" width:50 height:16 range:[2,100,10] type:#integer fieldwidth:35 align:#right
			)
 
			HyperLink Hypl_homepage "SB_Tools" align:#center width:65 height:15 address:"http://www.scriptspot.com/users/script-butler/" color:(color 6 105 213) hovercolor:(color 6 105 213) visitedcolor:(color 78 78 177)
 
 
			on btn_MSStandard pressed do
			(
				mat = multimaterial()
				mat.count = spn_stdnum_mtl.value
				mat.name = basename.text as String
 
				for i=1 to mat.count do
				mat[i] = standardmaterial name:(basename.text + i as String) diffusecolor:(random black white)
 
				meditmaterials[activeMeditSlot] = mat
			)--end on
 
			on btn_MSVRay pressed do
			(
				mat = multimaterial()
				mat.count = spn_vraynum_mtl.value
				mat.name = basename.text as String
 
				for i=1 to mat.count do
				mat[i] = Vraymtl name:(basename.text + i as String) diffuse:(random black white)
 
				meditmaterials[activeMeditSlot] = mat
			)--end on
 
			on btn_MSmentalRay pressed do
			(
				mat = multimaterial()
				mat.count = spn_mraynum_mtl.value
				mat.name = basename.text as String
 
				for i=1 to mat.count do
				mat[i] = Arch___Design__mi name:(basename.text + i as String) diffuse:(random black white)
 
				meditmaterials[activeMeditSlot] = mat
			)--end on
 
		)--end ro
 
 
        createDialog roll_MSOP 210 145
 
	) -- End Macro Script

/ Raymond

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.