MacroscriptLister - needs repair
Hi!
this is one of my favorite scripts, or was, since it crashes my Max 2014 nowadays.
Original credits: I dont remember :( I searched for the internet, but couldn't find where I found this script in the first place.
Great many thanks to the original author anyway. :)
macroScript MacroscriptLister category:"Haider" toolTip:"Macroscript Lister..." buttontext:"Macroscript Lister..." ( ( rollout macroList "Macroscript List" ( local mcrCategories; local mcrNames; local mcrTexts; dropdownlist categoryList; dropdownlist mcrNamesList; button runMcr "Run"; on categoryList selected arg do ( mcrNamesList.items = mcrTexts[arg]; ) on runMcr pressed do ( --try ( macros.run categoryList.selected mcrNames[categoryList.selection][mcrNamesList.selection]; --) catch () ) ) local mcrCategories = #(); local mcrNames = #(); local mcrTexts = #(); local mcrFiles = #(); local mcrStream = stringstream ""; macros.list to:mcrStream; seek mcrStream 0; while (not (eof mcrStream)) do ( local line = (readDelimitedString mcrStream "\n"); local lineSplit = (filterString line "\""); local mcrName = lineSplit[2]; local mcrCategory = lineSplit[6]; local mcrFile = lineSplit[8]; local catIndex = (findItem mcrCategories mcrCategory); if (catIndex == 0) do ( append mcrCategories mcrCategory; append mcrNames #(); append mcrTexts #(); append mcrFiles #(); catIndex = mcrCategories.count; ) append mcrNames[catIndex] mcrName; append mcrTexts[catIndex] mcrName; append mcrFiles[catIndex] mcrFile; ) local grinIndex = (findItem mcrCategories "Grin tools"); if (grinIndex != 0) do ( if (mcrFiles[grinIndex] != undefined) do ( for i = 1 to mcrFiles[grinIndex].count do ( local mcr = openFile mcrFiles[grinIndex][i]; if (mcr != undefined) do ( seek mcr 0; skipToString mcr "toolTip:"; readDelimitedString mcr "\""; local newName = readDelimitedString mcr "\""; if (newName == "") do ( seek mcr 0; skipToString mcr "buttonText:"; readDelimitedString mcr "\""; newName = readDelimitedString mcr "\""; ) if (newName != "") do mcrTexts[grinIndex][i] = newName; ) ) ) ) createdialog macroList width:400 style:#(#style_toolwindow, #style_sysmenu); macroList.categoryList.items = mcrCategories; macroList.mcrNames = mcrNames; macroList.mcrTexts = mcrTexts; cui.RegisterDialogBar macroList; ) )
Comments
.
Many thanks my friend. Works like a charm.
To make it even more useful, I added
and
There is a tiny bug of some sort.
When you run the script, you see the first category, but the dropdownlist mcrNamesList appears empty. You will have to pick the category again to make the mcrNamesList show something.
Can this be fixed?
Kind regards
Haider
www.haider.se
.
Tools and Scripts for Autodesk 3dsMax
.
Thank you :)
Kind regards
Haider
www.haider.se