CreateFolder READAUTO doesn't work reliably

Before READAUTO=left|right was possible I had a script that looked like this:

cmd.RunCommand('CreateFolder NAME="' + srcPath + '"');
cmd.RunCommand('CreateFolder NAME="' + dstPath + '"');
cmd.RunCommand('Go PATH="' + srcPath + '" NEWTAB=findexisting OPENINLEFT"');
cmd.RunCommand('Go PATH="' + dstPath + '" NEWTAB=findexisting OPENINRIGHT"');

This version always worked just fine.

With the new functionality introduced in 12.25.1 the script could be shortened to:

cmd.RunCommand('CreateFolder NAME="' + srcPath + '" READAUTO=left');
cmd.RunCommand('CreateFolder NAME="' + dstPath + '" READAUTO=right');

Strangely, this doesn't work all the time, sometimes it fails to read the folders into the file display. Even adding Go REFRESH is not a reliable remedy. Running the script a second time has AFAIR been always successful. Both folders sit on an SSD and already exist.

Testing with this a few times, it seems reliable so far:

function OnClick(clickData)
{
	var cmd = clickData.func.command;
	var srcPath = "Folder 1";
	var dstPath = "Folder 2";
	cmd.RunCommand('CreateFolder NAME="' + srcPath + '" READAUTO=left');
	cmd.RunCommand('CreateFolder NAME="' + dstPath + '" READAUTO=right');
}

Yeah, I had tried to write a script to demonstrate the issue, but it always worked :wink:

So here's the complete troublemaker script:

function OnClick(clickData) {
    var cmd = clickData.func.command;
    var tab = clickData.func.sourcetab;
    var fsu = DOpus.FSUtil();

    var currYear = DOpus.Create().Date().Format('D#yyyy');
    var srcPath = fsu.Resolve('/Dropbox\\Apps\\GPSLogger for Android');
    var dstPath = fsu.Resolve('/profile\\User\\Tracks\\' + currYear + '\\com.mendhak.gpslogger');

    cmd.RunCommand('CreateFolder NAME="' + srcPath + '" READAUTO=left');
    cmd.RunCommand('CreateFolder NAME="' + dstPath + '" READAUTO=right');
	// cmd.RunCommand('Go REFRESH');
    // cmd.RunCommand('Go PATH="' + srcPath + '" NEWTAB=findexisting OPENINLEFT"');
    // cmd.RunCommand('Go PATH="' + dstPath + '" NEWTAB=findexisting OPENINRIGHT"');

    cmd.RunCommand('Copy EXTRACT FILE="' + srcPath + '\\*.zip" TO="' + srcPath + '" WHENEXISTS=rename');
    cmd.RunCommand('Rename FROM="' + srcPath + '\\*.(gpx|geojson)" PRESET="Clean GPS"');  // WHENEXISTS=rename
    cmd.RunCommand('Copy MOVE FILE="' + srcPath + '\\*.(gpx|geojson)" TO="' + dstPath + '" WHENEXISTS=rename');
    cmd.RunCommand('Delete FILE="' + srcPath + '\\*.zip"');
    cmd.RunCommand('Set FOCUS=right');
    cmd.RunCommand('Set SOURCE=right');
    cmd.RunCommand('Select SHOWFOCUS');
}

Can you reproduce it without the stuff after the two CreateFolder lines? The rest shouldn't matter, unless something weird is going on (which is always possible). That's what I've been testing with, to avoid having to work out how to set up the folders/zips to make everything else work:

function OnClick(clickData)
{
    var cmd = clickData.func.command;
    var tab = clickData.func.sourcetab;
    var fsu = DOpus.FSUtil();

    var currYear = DOpus.Create().Date().Format('D#yyyy');
    var srcPath = fsu.Resolve('/OneDrive\\Apps\\GPSLogger for Android');
    var dstPath = fsu.Resolve('/profile\\User\\Tracks\\' + currYear + '\\com.mendhak.gpslogger');

    cmd.RunCommand('CreateFolder NAME="' + srcPath + '" READAUTO=left');
    cmd.RunCommand('CreateFolder NAME="' + dstPath + '" READAUTO=right');
}

So far that always works for me.

Maybe the lister's starting point is important. For example, starting from single or dual displays, or which tabs are already open.

Any locked folder tabs, or navlock turned on, that might complicate things?

Any On*FolderChange scripts installed?