Undo/Redo Dropdown Labels

MAXScript now provides some control over the labels displayed in the MAX undo/redo dropdown list for undoable MAXScript operations. This is an improvement to just displaying "MAXScript" in all cases, as it did in prior versions.

Any undoable macroScript execution, such as via a toolbar button, menu item, hotkey or quad-menu item, will now be displayed in the undo/redo list with the name of the macroScript.

The 'undo on' context prefix now accepts an optional string literal (text in double quotes) after the 'undo' keyword, which will be used as the label for the undo block in the MAX undo/redo lists.

Syntax

undo ["undo_item_label" | label:<string_operand>] <bool_expr> <expr>

where "undo_item_label" must be a string literal, but <string_operand> evaluates to a string at runtime.

Example:

rollout test "test"

(

local undoString = "Button Press"

local buttonPress = 0

button b "press me"

on b pressed do with undo label:(undoString + (buttonPress +=1) as string) on box()

)

createdialog test

Example:

undo "add background" on

(

...

)

This example will generate an undo-block for all the operations in the block-expression following the prefix, which will display in the undo/redo lists with the given string as its name. The name must be a literal string and is optional, and will default to "MAXScript".

See also