There's probably an optionVar which contains the default path, so changing that var, opening the save dialog and resetting the var could be an option.
### see:
runTimeCommand -default true
-annotation ("Export Selection: Export selected objects (and " +
"related info) to a new file")
-category ("File")
-command ("checkForUnknownNodes(); projectViewer ExportActive")
ExportSelection;
### leads to:
projectViewer.mel
$typeAndMode = pv\_ActionSetup $startUpAction
;
where startUpAction is "ExportActive"
projectViewer "ExportActive";
calls
pv_ActionSetup ExportActive
### which does:
case "ExportActive": {
if (`optionVar -exists defaultFileExportActiveType`) {
$saveType = `optionVar -q defaultFileExportActiveType`;
}
$type[0] = "Export Selection";
$type[1] = $saveType;
$type[2] = "1";
setWorkingDirectory $workspace $saveType "scene";
break;
}
### which leads to:
setWorkingDirectory.mel
which does:
string $rootDir = `workspace -q -rd $workspace`;
string $defaultDir = `workspace -q -rd`;
global string $gDirRetainingOptionVar;
workspace -dir $rootDir $workspace; // Change to the root first.
and other stuff.
basically you need to see which of the workspace -q xxx provides the path which always appears, so you will do a workspace -e xxx to place your own in and perform the ExportSelection; which then queries the workspace -q xxx and gets your path. finally you change workspace -e xxx back to what you first got with workspace -q xxx to leave Maya in the initial state.
Hopefully this does the job.
Daniel