I have observed a (potentially buggy) behavior where commands like exporttable(), rundocument() will consider as the starting position for relative paths not modeldir(), but rather the folder of the last successfully indicated file through filebrowse().
My question is: how can I programatically "correct" the starting position for relative paths to be modeldir() after using filebrowse()?
Edit:
There are situations in which I have no other option than to rely on relative pathing, like the following: I have an .exe which is hard-coded to generate an output file in the same location where it is called from (find attached a dummy .exe that generates a .json with the current timestamp). If you run it directly from windows explorer, it'll drop the output file in the same folder. However, if you run it using rundocument(), the location of the output file will depend on the last path indicated through filebrowse(). And I need to have the output of the .exe remain in the same folder where that .exe is.
I am attaching a sample model that exemplifies the problematic behavior.