You have access to all FormAPI functions and variables very easily from your callserver by invoking the following Javascript:var api = parent.getScriptFrame();From this, you can get just about any information you want about the DCR. Use Perl to determine which directory to save to (to verify which directory has fewer than 500 files in it, etc.) but since callServer is executed asynchronously, you may want to invoke it from an onSave function. I'm not sure of the timing of this but assuming that your DCR has been saved by the time it gets to a certain point in your callSever (and it most likely would be), use Perl to verify that it exists and then move the file from the "data" directory to the appropriate sibling directory which has fewer than 500 files.Dave
You should be able to block the actual save until you've determined the path and explicitly set the DCR name. I would strongly advise against moving the DCR after it's been saved since any generated files (a generate action will require saving of the DCR first) will have EAs associated with the name and location of the DCR.
Hi,What you want to do is to catch the onSave event. In this function you make your callServer and return false (returning false stops the save process). Now when your callServer script finishes it invokes a function again on the dct/dcr (parent.getScriptFrame().yourfunctioname(). This function starts by setting the dcrsavepath etc. and in the end does a IWDatacapture.save() (which will not re-invoke your onSave event).This should work for you :-).RegardsVaqas