I have a "hard" time figuring out how to create a command to take a selected file or files, figure out their folder and swap the root drive out and go to that "mirror" place.
I have a mapped network drive Z:\Projects, it has an equivalent in P:\root\Projects. I would like to have an action that reads the folder that is currently open, replace z:\ with p:\root\ and open that folder. As a bonus the restore selection would be great, but I could do without
I tried a Jscript and got the filename swapping working if I print it out, but I'm not sure how to set the current tab to that new location.
Here's the Jscript
function OnClick(clickData)
{
DOpus.ClearOutput();
var cmd = clickData.func.command;
cmd.deselect = false; // Prevent automatic deselection
if (clickData.func.sourcetab.selected.count == 0)
{
DOpus.Output(" (none)");
}
else
{
var file = clickData.func.sourcetab.selected(0);
var newpath = String(file).toLowerCase().replace("z:", "P:\\root");
DOpus.Output(newpath);
cmd.SetSource(newpath);
}
}
SetSource does nothing. Also if there's a better way I'd love to know!
Thanks!
-Johan