PDA

View Full Version : How to turn a Maxscript into a MACRO


CarlCampbell
04-07-2008, 01:01 PM
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!

zortech
04-07-2008, 02:05 PM
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
)

CarlCampbell
04-07-2008, 02:30 PM
Worked like a charm. Silly me for not thinking about the MAXscript reference first. Thanks a bunch!

Cheers!

j-man
04-07-2008, 04:41 PM
BTW you can also select and drag text from the scripter window onto a toolbar.

J.

CarlCampbell
04-07-2008, 04:45 PM
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!

CGTalk Moderation
04-07-2008, 04:45 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.