Visual Breakpoints for MAXScript
MXSBreakpoints.MAC is an UltraEdit macro that uses the bookmarks within UE as a form of visual breakpoints for the MXSDebugger. Just load the attached .MAC file in to UE's macro list to make use of it.
When you run the macro the following steps happen:
* Your current file is saved
* At any point in the file where a bookmark is found a 'break();' statement is added to the beginning of that line
* The file is saved off as a new temporary .ms file (c:MXSTemp.ms).
* The new file is executed in Max via the MXSCOM bridge
* The temporary file is closed
* Your original file is reloaded
* The editing cursor is positioned at the start of the line you were on when you executed the script.
* You must have a user tool configured to run the MXSCOM bridge. This tool must be named 'Run MAXScript'.
* If you're trying this on a newly created file it will be saved off to C:Program FilesIDM Computer SolutionsUltraEdit-32Edit# - where 'Edit#' is the name of the tab in UltraEdit. Either save your new file off before you run the macro or remember to do so afterwards.
* I wanted the macro to either only use - or ignore - named bookmarks so you could still have regular bookmarks in your file. Sadly - the macro language in UE doesn't support querying bookmarks for their names.
* Sometimes you will come back to your original file after you run the macro and your bookmarks will be gone. UltraEdit stores per file bookmark information in its main application INI file. This file is not updated when you save a document - only when UE is closed. This leads to the unfortunate problem of a new file being closed and opened without UltraEdit being closed and the bookmark information being lost. It doesn't happen every time - so UE must be temporarily storing that data in memory somewhere.
Save the file to your computer. Use UltraEdit's 'MacroLoad' or 'MacroLoad and Append to Existing' menu command to add the macro. Put bookmarks wherever you would like to have the script break and the debugger appear. Save your file and then either double-click the macro in UltraEdit's macro list or hit Ctrl+Alt+E.