I have some folders which were shuffled together and need tedious work to separate. I'm guessing there's a much better way to do this, but I'd also like to get more familiar with Dopus scripting....
Normally, selected files exist, but in a duplicate file collection, they may have been moved or deleted already.
This script opens 2 selected files paths in new tabs, "left" and "right"
How do I...
- Find out if they exist (selItem1.exists returns undefined)
- Make a dialog auto-close after 1s?
javascript...
function OnClick(clickData)
{
DOpus.ClearOutput();
var qu='"';
if (clickData.func.sourcetab.selected_files.count != 2)
{
DOpus.Output( "Need 2 files" );
return;
}
var selItem1 = clickData.func.sourcetab.selected_files(0);
var selItem2 = clickData.func.sourcetab.selected_files(1);
/*
if ((!selItem1.exists || !selItem2.exists))
{
DOpus.Output("One of them does not exist");
var oDlg = DOpus.Dlg ;
oDlg.message = "One of them does not exist " + selItem1.exists + "," + selItem2.exists ;
oDlg.title = "Compare Tabs Error";
oDlg.buttons = "OK";
oDlg.Show;
return;
}
*/
clickData.func.command.RunCommand("Go " +qu+ selItem1.path +qu+ " NEWTAB OPENINRIGHT TABNAME " +qu+ "C1" +qu);
clickData.func.command.RunCommand("Go " +qu+ selItem2.path +qu+ " NEWTAB OPENINLEFT TABNAME " +qu+ "C2" +qu);
return;
}