MAXScript runtime error

MAXScript runtime error

Anonymous
Not applicable
6,580 Views
7 Replies
Message 1 of 8

MAXScript runtime error

Anonymous
Not applicable
Hi all, I have this maxscript runtime error which always requires restart of the whole program. Very, very annoying:

"-- Runtime error: File not open. No I/O allowed: PATH_TO_SOME_TEMP_MACRO_FILE"

After that, every attempt to interpret a script fails with this error. Sometimes restarting 3ds max solves the problem, sometimes I need to restart it twice.
Please, any way to solve this?

Emil
0 Likes
6,581 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
At first blush, it looks as if a script were installed that was meant to be edited before it was run; "PATH_TO_SOME_TEMP_MACRO_FILE" looks like the sort of thing I'd use in an example where the user was expected to enter the path to a local file of their choice.
0 Likes
Message 3 of 8

Anonymous
Not applicable
Well, not quite. May be I was'nt too specific about the problem. When I try to compile a script that has error on it, after I correct the error I am not longer able to compile due to the error I described above.
PATH_TO_SOME_TEMP_MACRO_FILE is a temp file (__temp.mcr) that max creates automatically when you compile your scripts and is sotred to your application data folder (I changed the default location, same thing happens).
Put it another way, my scirpts compile until I make an error. After that, max needs to be restarted to able to compile again.
0 Likes
Message 4 of 8

Anonymous
Not applicable
In my experience, any script crapping out for any reason, means you need to re-start max to get other scripts to work.
0 Likes
Message 5 of 8

keithm
Enthusiast
Enthusiast
Emil:
Can you post/attach the script giving the error?


MM:
I respectfully disagree with that statement Might Marcos...

You need to re-execute the script, but very seldom do I need to restart Max due to a script erroring... Unless the script Errored because of a memory issue.
0 Likes
Message 6 of 8

Anonymous
Not applicable
OK, I'm attaching the script, there are actually 3 files. The main file, that you should compile is "upo_macroscript_export.ms" - it includes two other files. "upo_dialog_export.ms" is a dialog definition and is included by the main script, and the third is "upo_functions_export.ms", included in the second:

upo_macroscript_export.ms
---------|
---------|--upo_dialog_export.ms
--------- ---------|
--------- ---------|-- upo_functions_export.ms

Here's what you need to do to reproduce the error:

1. Compile (Ctrl+E) "upo_macroscript_export.ms", there should be no errors.
2. Now make an error, let say in "upo_functions_export.ms" change line 234 to "if isDynamic --then" (comment the "then")
3. Compile "upo_macroscript_export.ms" again (will give you error now)
4. Correct the error (uncomment "then").
5. Compile "upo_macroscript_export.ms" again - now everything should be ok, but it is not - I get the error I described in the first post. A runtime error, that has something to do with a temp macro. Every attempt to compile a script now will result to this error until you restart max.

PS: don't laugh at the code, I'm still learning.

upo.zip

0 Likes
Message 7 of 8

keithm
Enthusiast
Enthusiast
AAAAHH.. HA HA... max got you again... you have a MacroScript definition in a .ms file !

So max is not finding a .mcr file and is making some funky one for you

I've quickly reorganized your scripts a bit..

The macroScript portion is now a .mcr file and should be located in:
max root dir\ui\macroScripts\

The other two parts of the script I've located in a new folder INSIDE the standard scripts folder...
max root dir\scripts\upo\

You'll see I filein the dialog_export.ms from the .mcr and then include the functions from the dialog_export.ms

This configuration should eliminate the self creating .mcr you've got going on

upo_macroscript_export.zip

0 Likes
Message 8 of 8

Anonymous
Not applicable
Thanks Keith. You just saved me a lot of restarts (blah). As I said, I'm n00b :).
0 Likes