Notifications
Clear all

[Closed] How to turn a Maxscript into a MACRO

Hi there!

I have a bunch of really helpful maxscripts (.ms) that I’ve collected and there are a few I’d much rather assign to a keyboard shorcut. I know that a macroscript shows up in the customize menu so I can assign it easily but how would I achieve the same thing with maxscripts?

Cheers!

4 Replies

MAXScript Reference:
[…] MacroScripts have to be defined with the macroScript definition construct and can then be associated with a toolbar button by right-clicking a Shortcut toolbar or Tab and choosing Customize. […]

macroScript <name> [ category:<string> ] [buttonText:<string>] [toolTip:<string>] [icon:#(<string>, <index>) | icon:<string>] [silentErrors:<boolean>] ( <macro_script_body> )

Only thing you have to do is add the definition construct, as shown above and place your code within the breakets.

macroScript MacroScriptName category: “MacroScriptName” toolTip: “ToolTip”
(
macroScriptCode
)

Worked like a charm. Silly me for not thinking about the MAXscript reference first. Thanks a bunch!

Cheers!

BTW you can also select and drag text from the scripter window onto a toolbar.

J.

Yep, I did know about that part. That works just fine too except for the fact that it moves scripts into the ‘drag-and-drop’ directory and since I work on multiple PCs that’s not too convenient for me… Plus, I prefer keyboard shortcuts over clicking on a toolbar anyday

Cheers!