Open folder in destination when tab is locked

When I lock a tab I would like double clicking a folder or zip to open in the destination instead of the the source. Currently this will open in a new tab on the source, I can hold down crtl. But when tab is locked I would like this to be the default and not need control.
Is that possible?

cheers

You should be able to do that with a script on the All Folders filetype's Left Double-Click event. The script could look at the current tab and change what happens if it is locked.

Thanks @leo, got me on the right path, pretty simple script.

function OnDoubleClick(doubleClickData)
{
  if(doubleClickData.Tab.lock == "on" && doubleClickData.Tab.lister.dual != 0 && 
    doubleClickData.mouse == "left" &&  !doubleClickData.multiple && 
    doubleClickData.qualifiers == "none")
  {
    if(DOpus.FSUtil.GetType(doubleClickData.item) == "dir")
    {
      return "Go " + doubleClickData.item + " NEWTAB OPENINDEST";
    }
  }
}

First cut I used the RunCommand, but then I changed to returning the command. Any reason I might not want to do this?
First version

function OnDoubleClick(doubleClickData)
{
  if(doubleClickData.Tab.lock == "on" && doubleClickData.Tab.lister.dual != 0 && 
    doubleClickData.mouse == "left" &&  !doubleClickData.multiple && 
    doubleClickData.qualifiers == "none")
  {
    if(DOpus.FSUtil.GetType(doubleClickData.item) == "dir")
    {
      var dopusFactory = DOpus.Create();
      var command = dopusFactory.Command();
      command.RunCommand("Go " + doubleClickData.item + " NEWTAB OPENINDEST");
      return true;
    }
  }
}
1 Like

Returning the command seems better, but it may not make any real difference.

Makes the custom script smaller which is always good. thanks again