Is there a way to detect if a script is running during the loading of S::Startup in AcadDoc.lsp? We have several functions that we run slightly different, if a script has executed them, by including the line (setq *script* t) as the first line after it opens a drawing and before it executes a function such as our (PlotRoutine). The “PlotRoutine” checks if the *script* variable is true and it then reads a file on the users local drive to use as the plot settings; else it uses the variables in memory to plot the layouts. This concept works great for all folder related scripts.
This week I was asked to find a way to not run certain S::Startup functions if a script is running. The list of functions to exclude are company specific and slow down the script process. In the S::Startup function I tested for *script*. It always returns nil. So the script commands are not executed until after AcadDoc.lsp is loaded. I’m thinking about having the script file create a temp file, and then have it delete it at the end of the script. I can then check for the temp file, instead of if the variable *script* is true.
Is there a better way using VBA that can detect if a script is running or an alternative method that will work better?