Replacing referenced file part way through script
Hi all,
I'm trying to put together a script which has several steps in it, and mid way through I want to have a referenced file (which is already in the scene) be replaced with a different file that the user specifies.
I think I want to be able to have an "open dialogue box come" up when the user first executes the script, so that they can specify the file they want to reference in. Then at the relevant point in the script have it replace the reference with their selection.
I read on another thread that this bit of script below can replace a referenced file with another one(in this case replacing a cube with a sphere):
file -loadReference "cubeRN" -type "mayaAscii" -options "v=0" "C:/desktop/sphere.ma";
But is there any way to have the script example above somehow link to a file that the user already specified though a dialogue box, instead of the actual line of code pointing to the specific file?
Please can anyone help with something like this?
Thanks.