Add custom scripts to SME toolbar


Hi All.

Does somebody know how to add a custom script to the SME? I have bought some scripts before, which directly installs in the SME like DropToSlate for example. Here is a picture for reference:

Simple drag&drop from the Customize User Interface to SME won’t allow me to do that.

Thanks for the help in advance!


I posted the code we used in d2s here


Thanks for the reply!

Are you referencing this code:

if not ButtonExists toolbar_hwnd btnText then

local mbdata = gi.macrobuttondata.create macro_settings_ID “” “DropToSlate Settings” 0 “DropToSlate”
local toolMacroItem = gi.toolmacroitem.create 24 24 mbdata 31

toolbar.AddTool toolMacroItem toolbar.NumItems

local items = windows.getChildrenHWND toolbar_hwnd
UIAccessor.SetWindowText (items[items.count])[1] btnText

Do you run this code straight in the MAXScript editor? Running this code will not do anything. Running it for a second time will get this error:

– Error occurred in anonymous codeblock; filename: ; position: 40; line: 1
– Type error: Call needs function or class, got: undefined
– MAXScript callstack:
– thread data: threadID:3396

– [stack level: 0]
– In top-level


Sure, it doesn’t work this way :slight_smile:

  1. get sme window handle
  2. get sme toolbar window handle
  3. get macro id
  4. then use the above example

ps. I can’t post full solution for obvious reasons