Maxscript editor tip/tutorial


Hi everyone,

I made a small video tutorial about a thing I found very usefull in the maxscript editor, I haven’t read anyone writing about it, but maybe I haven’t looked enough, but here it is:

Hopefully it’s of any use.



Hey Johan,

didn’t know that < : thanks for that!



That is one awesome time-saver. Thanks for sharing.


That is fantastic, thanks for putting that up there.


Just as a note, it is case sensitive.


That’s a good way to keep scripts written in a consistent way!


Thanks guys, it really shows how accustomed everyone was to the terrible, horrible old mxs editor, and we’re probably so happy with a pretty decent editor (although I can come up with a feature or 2 one, like code completion) not a lot of people delved into the new options… at least not me… until now that is… there are a lot more little gems hidden in the prefs file, like being able to open more then 10 files, multilinetabs etc… and I really wished the output pane could be used as a listener, so we could ditch the clumsy listener and have a streamlined window for editing and output.



a killer tip, man =)


speaking of improvements to the mxsEditor - with the klunky old one, i did enjoy opening scripts in multiple windows to compare them side-by-side. i can’t really do this easily with the tabbed interface. i’d like the option to “float” one of the tabs or open multiple editors. if anyone knows how to do this & i’m just missing it, i’d appreciate the tip!


A little tip to help with making it easier to format the abbreviations file.

Write the code as you normally would in a script, then using the replace tool (Ctrl+H) turn on the “Transform backslash expressions” checkbox (Alt+B) and perform find and replace on line breaks and tabs.

if EXPR then

If you use that chunk of code and then do a search and replace searching for "
" and replacing with "
" (no quotations), it will insert a "
" at the beginning of each new line.

Then do a search and replace using " " and "\ " and it will replace all of the tab characters.

All thats left to do is a few button presses using the “End” and “Delete” keys and your abbreviation file is nicely formatted.

EDIT: I just did the search and replace with "
" and "
" and this time it actually replaced the line breaks. Not too sure why it is leaving them in sometimes and sometimes not.


and I really wished the output pane could be used as a listener, so we could ditch the clumsy listener and have a streamlined window for editing and output.

totally agree :wink:

Thank for the tip , very useful !!


Maybe we should put up our abbreviations for other to have a look see.
Here are mine so far

-- Created: 		00-00-2009
-- Last Updated:	00-00-2009
-- Version:			0.10
-- Author :  Johan Boekhoven / /
-- Version:  3ds max 2009 (10) (should work in older versions too!)
-- Discription: DESCRIPTION
-- Usage: RUN IT
-- Wishlist:

<DOC> Description here.
	<bool> arg_a:		A description of the argument.
	<bool>		Function returns (anything?).
 if=if ARG then
) -- end if
) -- end else
 fn=fn NAME arg_a arg_b =
 str=struct NAME
 fora=for  in  do

 foraw=for  in  where ARG1 == ARG2 do

 fori=for i = 0 to 100 do

 foriw=for i = 0 to 100 where ARG1 == ARG2 do

 foribw=for i = 0 to 100 by  where ARG1 == ARG2 do

 rol=rollout ""

 start=menu header
 btn=button btn_ "" width: height: offset:[0,0] across:
 pbn=pickButton pbn_ "" width: height: offset:[0,0] across:
 spn=spinner spn_ "" width: range:[,,] type: offset:[0,0] across:
 chb=checkButton chb_ "" width: height: offset:[0,0] across:
 grp=group ""

Some are obviously specific for my needs, but maybe somebody can use it.
I think especially in the commenting and UI building and CA building department lot of speed can be gained by some well balanced abbreviations.

Has any also checked out the great work Rob is doing over at TAO and I try to follow the, I think some public accepted abbreviations could help on good coding practice, but that’s me.

@Mathieson, that’s a really good tip!!



do you know if it’s possible to remap the shortcut , I don’t find it very straight forward ??


you must edit the file.
To do this choose the option ‘open global option file’ from the tool menu.
Search the line ‘# User defined key commands’
and then add a line with your shortcut and the command you need.

you can find the explanation in the '[color=white]MAXScript Editor - Defining Custom Keyboard Shortcuts’[/color] tread, from the maxscript help

sorry for my english



Thank ! this work very well :applause:
the line to add is : Ctrl+?|IDM_ABBREV|


some dotnet one that I often use :rolleyes:

 /* .NET */
 dcol=(dotnetclass "system.drawing.color").fromargb 0 0 0
 dstr=(dotnetobject "system.string" "")
 darr=(dotnetclass "system.array")
 darrr=(dotnetobject "system.array[]" 1)
 dpt=dotnetobject "system.drawing.point" 0 0
 dsize=dotnetobject "system.drawing.size" 0 0
 dpad=dotnetobject "" 0 0 0 0
 dpen=(dotnetobject "system.drawing.pen" (dotnetobject "system.drawing.solidbrush"((dotnetclass "system.drawing.color").fromargb 0 0 0)) 1)
 dbrush=(dotnetobject "system.drawing.solidbrush" ((dotnetclass "system.drawing.color").fromargb 0 0 0))
 stcp=(dotnetobject "" (dotnetclass "").percent 50)
 stca=(dotnetobject "" (dotnetclass "").absolute 20)
 strp=(dotnetobject "" (dotnetclass "").percent 50)
 stra=(dotnetobject "" (dotnetclass "").absolute 20)



This thread is so usefull :wink: Thx to all involved
Should be stickied !!!


Ha Johan you’ve really hit upon a common note < :

FWIW I qwish we could open multiple script windows as well but i don’t think it is possible.



wooow!this thread very useful for me!thanks a lot! :bowdown:


:wavey: :bowdown: