macros.run works if you have evaluated the Macroscript already.
I need something different, more like what @Serejah is mentioning.
The logic could be like this
- read the macroscript-file as text
- search for the string
macroscriptand then it searches for the first( - Execute everything from
(to the end of the file.
There might be a bunch of commented text before the macroscript header starts, for example author notes with the word “Macroscript” followed by a paranthesis that has nothing to do with the macroscript. A solution could be that to ask the user for confirmation
Do you want to execute the code within
"macroscript Macroname tooltip:"blah blah" text text text"
ie, it shows you a preview of the first macroscript row to let the user confirm we found the correct macroscript start. If not, the user can press "search next".
Once you find the right spot, you can press Run the execute the code inside the Macroscript without executing the header.

